Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. How To use DirectX 9.0 for displaying video from devices and capturing frames

How To use DirectX 9.0 for displaying video from devices and capturing frames

Scheduled Pinned Locked Moved Graphics
csharpgraphicsalgorithmstutorialasp-net
11 Posts 3 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L LoneInvader2007

    Hi I am developing an application where i want to display live video and also do some image processing. I tried: 1. Video for Windows API : easy but not quite comprehensive and not able to use overlay 2. 3rd Party SDK: nice quality still no overlay support, no single frame capture fn.! 3. GDI+ is an option but not quite preferable for fast video display and capture where I think DirectX goes well. Thus selected latest DirectX v9 which is latest for WinXP. 4. searched for DirecX but got DirectShow links which is deprecated in DirectX 9. also could not find suitable code for capturing single frame. I've been searching for quite a while now. searched through CodeProject, MSDN, Google; but could not get exactly what i wanted. :doh: Thus can you guide/suggest in the following area: How to easily use DirectX 9.0 for displaying video from devices and capturing frames I want to achieve this with very simple ( minimalistic) coding as i am beginner in this area and would not like to indulge with the complexity of DirectX (one of the most complex API's by Microsoft) for that purpose please suggest how to use Windows Media Player SDK or Windows SDX. How to use DirectX 9.0 API's in - 1. Live video: display live video from digital camera / (analog camera + framegrabber card). 2. Overlay: displaying informative data over(on top of) the video (i guess this is what they call Overlay) 3. Capture Frame : capturing Current frame(image) for Image processing platform: C#.NET, Visual Studio 2005, .Net Framework 2.0, WinXP Prof. SP2 on Pentium Core 2 duo 2GHz , 1GB Ram PC with Intel onboard graphics accelerator. any help/suggestion or links highly appreciated ... thanks.

    M Offline
    M Offline
    Mark Salsbery
    wrote on last edited by
    #2

    LoneInvader2007 wrote:

    searched for DirecX but got DirectShow links which is deprecated in DirectX 9.

    It's not deprecated. In fact DirectShow is so not deprecated that its SDK was rolled into the platform SDK because it's a standard part of the operating system. The next generation (Vista+) Windows multimedia platform is Media Foundation[^] You are, of course, free to use whatever capture and render methods you choose... just keep in mind DirectShow has taken care of a LOT of the render/capture work for you :) Mark

    Mark Salsbery Microsoft MVP - Visual C++ :java:

    L 1 Reply Last reply
    0
    • L LoneInvader2007

      Hi I am developing an application where i want to display live video and also do some image processing. I tried: 1. Video for Windows API : easy but not quite comprehensive and not able to use overlay 2. 3rd Party SDK: nice quality still no overlay support, no single frame capture fn.! 3. GDI+ is an option but not quite preferable for fast video display and capture where I think DirectX goes well. Thus selected latest DirectX v9 which is latest for WinXP. 4. searched for DirecX but got DirectShow links which is deprecated in DirectX 9. also could not find suitable code for capturing single frame. I've been searching for quite a while now. searched through CodeProject, MSDN, Google; but could not get exactly what i wanted. :doh: Thus can you guide/suggest in the following area: How to easily use DirectX 9.0 for displaying video from devices and capturing frames I want to achieve this with very simple ( minimalistic) coding as i am beginner in this area and would not like to indulge with the complexity of DirectX (one of the most complex API's by Microsoft) for that purpose please suggest how to use Windows Media Player SDK or Windows SDX. How to use DirectX 9.0 API's in - 1. Live video: display live video from digital camera / (analog camera + framegrabber card). 2. Overlay: displaying informative data over(on top of) the video (i guess this is what they call Overlay) 3. Capture Frame : capturing Current frame(image) for Image processing platform: C#.NET, Visual Studio 2005, .Net Framework 2.0, WinXP Prof. SP2 on Pentium Core 2 duo 2GHz , 1GB Ram PC with Intel onboard graphics accelerator. any help/suggestion or links highly appreciated ... thanks.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #3

      LoneInvader2007 wrote:

      the complexity of DirectX (one of the most complex API's by Microsoft)

      Nah. The mixer APIs are infinitely more of a PITA to work with :)

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      1 Reply Last reply
      0
      • M Mark Salsbery

        LoneInvader2007 wrote:

        searched for DirecX but got DirectShow links which is deprecated in DirectX 9.

        It's not deprecated. In fact DirectShow is so not deprecated that its SDK was rolled into the platform SDK because it's a standard part of the operating system. The next generation (Vista+) Windows multimedia platform is Media Foundation[^] You are, of course, free to use whatever capture and render methods you choose... just keep in mind DirectShow has taken care of a LOT of the render/capture work for you :) Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        L Offline
        L Offline
        LoneInvader2007
        wrote on last edited by
        #4

        @ Mark Salsbery - Thanks for your reply.

        Mark Salsbery wrote:

        DirectShow has taken care of a LOT of the render/capture work

        provided DirectShow is well documented/supported on MSDN or elsewhere; can DirectShow help in drawing graphics over the video (live video from camera)? As these lines from Wikipedia Article http://en.wikipedia.org/wiki/DirectShow[^] imply it does'nt - "Windows XP introduced a new filter called the Video Mixing Renderer 7 (VMR-7 or sometimes just referred to as VMR). The number 7 was because VMR-7 only used DirectDraw version 7 to render the video and did not have the option to use GDI drawing. The main new feature of VMR-7 was the ability to mix multiple streams and graphics, allowing applications to draw text and graphics over the video " due to WinXP OS constraint, Thus I selected Direct3D (DirectX 9) over previous DirectDraw and DirectShow. (added to it the complexity of DirectX and the simplicity of me as a beginner in this field :), i would really prefer the Managed DirectX or XNA as these API's provide simplified access through .NET. keeping in mind that my current application is a machine vision application which only demands simple video capture display and capturing single frames for Image Processing. For DirectX, web is full with help/guidance for game development and no such serious help is available for unique applications such as this one. Thread like this is pretty much needed for such type of applications which will then prosper on DirectX technology. On behalf of many I have just started the thread. I request everyone to take a note of this and contribute to this thread by answering the questions raised here and similarly wherever. Thanks. any help/guidance/feedback will really be appreciated Question: How To use DirectX 9.0 For Machine Vision Application: How to use DirectX 9.0 API's in - 1. Live video: display live video from digital camera / (analog camera + framegrabber card). 2. Overlay: displaying informative data over(on top of) the video (i guess this is what they call Overlay) 3. Capture Frame : capturing Current frame(image) for Image processing platform: C#.NET, Visualt Studio 2005, .Net Framework 2.0, WinXP Prof. SP2 on Pentium Dual Core 3GHz PC with Intel

        M 2 Replies Last reply
        0
        • L LoneInvader2007

          @ Mark Salsbery - Thanks for your reply.

          Mark Salsbery wrote:

          DirectShow has taken care of a LOT of the render/capture work

          provided DirectShow is well documented/supported on MSDN or elsewhere; can DirectShow help in drawing graphics over the video (live video from camera)? As these lines from Wikipedia Article http://en.wikipedia.org/wiki/DirectShow[^] imply it does'nt - "Windows XP introduced a new filter called the Video Mixing Renderer 7 (VMR-7 or sometimes just referred to as VMR). The number 7 was because VMR-7 only used DirectDraw version 7 to render the video and did not have the option to use GDI drawing. The main new feature of VMR-7 was the ability to mix multiple streams and graphics, allowing applications to draw text and graphics over the video " due to WinXP OS constraint, Thus I selected Direct3D (DirectX 9) over previous DirectDraw and DirectShow. (added to it the complexity of DirectX and the simplicity of me as a beginner in this field :), i would really prefer the Managed DirectX or XNA as these API's provide simplified access through .NET. keeping in mind that my current application is a machine vision application which only demands simple video capture display and capturing single frames for Image Processing. For DirectX, web is full with help/guidance for game development and no such serious help is available for unique applications such as this one. Thread like this is pretty much needed for such type of applications which will then prosper on DirectX technology. On behalf of many I have just started the thread. I request everyone to take a note of this and contribute to this thread by answering the questions raised here and similarly wherever. Thanks. any help/guidance/feedback will really be appreciated Question: How To use DirectX 9.0 For Machine Vision Application: How to use DirectX 9.0 API's in - 1. Live video: display live video from digital camera / (analog camera + framegrabber card). 2. Overlay: displaying informative data over(on top of) the video (i guess this is what they call Overlay) 3. Capture Frame : capturing Current frame(image) for Image processing platform: C#.NET, Visualt Studio 2005, .Net Framework 2.0, WinXP Prof. SP2 on Pentium Dual Core 3GHz PC with Intel

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #5

          LoneInvader2007 wrote:

          can DirectShow help in drawing graphics over the video (live video from camera)?

          Yes. Whether it does what you need it to do or not, I don't know. I do know Wikipedia isn't the ultimate source of info on DirectShow. Using the Video Mixing Renderer[^] Rendering is just one part. Acquisition also need to be considered. Does the device have a WDM driver? If you've got capture covered already, you can do rendering however you want to. I personally use DirectShow for capturing from WDM and legacy VFW devices. I do my own custom rendering for drawing on the video frames before they are rendered, using GDI, not Direct3D (I personally found no benefit from the added complexity of Direct3D, since all I'd use it for is back-buffers that don't need to be on hardware). The DirectShow SDK is freely available and includes enough sample code to create working apps by mostly copy/paste - check it out, see if it's what you need. Use whatever is best for your application.

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          L 1 Reply Last reply
          0
          • L LoneInvader2007

            @ Mark Salsbery - Thanks for your reply.

            Mark Salsbery wrote:

            DirectShow has taken care of a LOT of the render/capture work

            provided DirectShow is well documented/supported on MSDN or elsewhere; can DirectShow help in drawing graphics over the video (live video from camera)? As these lines from Wikipedia Article http://en.wikipedia.org/wiki/DirectShow[^] imply it does'nt - "Windows XP introduced a new filter called the Video Mixing Renderer 7 (VMR-7 or sometimes just referred to as VMR). The number 7 was because VMR-7 only used DirectDraw version 7 to render the video and did not have the option to use GDI drawing. The main new feature of VMR-7 was the ability to mix multiple streams and graphics, allowing applications to draw text and graphics over the video " due to WinXP OS constraint, Thus I selected Direct3D (DirectX 9) over previous DirectDraw and DirectShow. (added to it the complexity of DirectX and the simplicity of me as a beginner in this field :), i would really prefer the Managed DirectX or XNA as these API's provide simplified access through .NET. keeping in mind that my current application is a machine vision application which only demands simple video capture display and capturing single frames for Image Processing. For DirectX, web is full with help/guidance for game development and no such serious help is available for unique applications such as this one. Thread like this is pretty much needed for such type of applications which will then prosper on DirectX technology. On behalf of many I have just started the thread. I request everyone to take a note of this and contribute to this thread by answering the questions raised here and similarly wherever. Thanks. any help/guidance/feedback will really be appreciated Question: How To use DirectX 9.0 For Machine Vision Application: How to use DirectX 9.0 API's in - 1. Live video: display live video from digital camera / (analog camera + framegrabber card). 2. Overlay: displaying informative data over(on top of) the video (i guess this is what they call Overlay) 3. Capture Frame : capturing Current frame(image) for Image processing platform: C#.NET, Visualt Studio 2005, .Net Framework 2.0, WinXP Prof. SP2 on Pentium Dual Core 3GHz PC with Intel

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #6

            LoneInvader2007 wrote:

            due to WinXP OS constraint

            What do you mean? Do you need to support OS versions older than XP? Mark

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            L 1 Reply Last reply
            0
            • M Mark Salsbery

              LoneInvader2007 wrote:

              can DirectShow help in drawing graphics over the video (live video from camera)?

              Yes. Whether it does what you need it to do or not, I don't know. I do know Wikipedia isn't the ultimate source of info on DirectShow. Using the Video Mixing Renderer[^] Rendering is just one part. Acquisition also need to be considered. Does the device have a WDM driver? If you've got capture covered already, you can do rendering however you want to. I personally use DirectShow for capturing from WDM and legacy VFW devices. I do my own custom rendering for drawing on the video frames before they are rendered, using GDI, not Direct3D (I personally found no benefit from the added complexity of Direct3D, since all I'd use it for is back-buffers that don't need to be on hardware). The DirectShow SDK is freely available and includes enough sample code to create working apps by mostly copy/paste - check it out, see if it's what you need. Use whatever is best for your application.

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              L Offline
              L Offline
              LoneInvader2007
              wrote on last edited by
              #7

              Mark Salsbery wrote:

              Yes. Whether it does what you need it to do or not, I don't know. I do know Wikipedia isn't the ultimate source of info on DirectShow.

              Thanks for your recommendation. application needs basic drawing on the live video display. thanks for the msdn link, how could'nt i get that link :( need to check. will convey the status... meanwhile (if there is a need for a good text) could you suggest a good one for DirectShow 9

              M 1 Reply Last reply
              0
              • M Mark Salsbery

                LoneInvader2007 wrote:

                due to WinXP OS constraint

                What do you mean? Do you need to support OS versions older than XP? Mark

                Mark Salsbery Microsoft MVP - Visual C++ :java:

                L Offline
                L Offline
                LoneInvader2007
                wrote on last edited by
                #8

                Mark Salsbery wrote:

                What do you mean? Do you need to support OS versions older than XP?

                Application needs to be developed only for Win XP variants and not targeting any other versions of Windows. Platform is as specified below: platform: C#.NET, Visual Studio 2005, .Net Framework 2.0, WinXP Prof. SP2 on Pentium Dual Core 3GHz PC with Intel on-board graphics accelerator.(graphics card can be considered for DirectX) I will see if there is a Managed way (XNA, Managed DirectX) since that (managed code) will be better for the .NET application we are developing. Need to check if XNA can be used for DirectShow 9 (i guess not).

                1 Reply Last reply
                0
                • L LoneInvader2007

                  Mark Salsbery wrote:

                  Yes. Whether it does what you need it to do or not, I don't know. I do know Wikipedia isn't the ultimate source of info on DirectShow.

                  Thanks for your recommendation. application needs basic drawing on the live video display. thanks for the msdn link, how could'nt i get that link :( need to check. will convey the status... meanwhile (if there is a need for a good text) could you suggest a good one for DirectShow 9

                  M Offline
                  M Offline
                  Mark Salsbery
                  wrote on last edited by
                  #9

                  LoneInvader2007 wrote:

                  could you suggest a good one for DirectShow 9

                  I'm still using the ServerĀ® 2003 R2 Platform SDK[^] but the newest SDK is the Windows SDK[^]. Mark

                  Mark Salsbery Microsoft MVP - Visual C++ :java:

                  T 1 Reply Last reply
                  0
                  • M Mark Salsbery

                    LoneInvader2007 wrote:

                    could you suggest a good one for DirectShow 9

                    I'm still using the ServerĀ® 2003 R2 Platform SDK[^] but the newest SDK is the Windows SDK[^]. Mark

                    Mark Salsbery Microsoft MVP - Visual C++ :java:

                    T Offline
                    T Offline
                    tanvon malik
                    wrote on last edited by
                    #10

                    Hi very interesting thread about DirectShow, I really liked it; I myself use Platform SDK 2003, don't you think Microsoft to make the DirectShow as a separate SDK, they are moving it from DirectX SDK to Platform SDK now in Windows SDK. Because for newer people it is sometimes awkward to see this that DirectShow is being placed here and there. And our newsgroups are swarming with questions like, DirectShow is not in DirectX SDK ? Where to find DirectShow SDK ? Which version to use ? Another thing is this that they are not calling it deprecated, but behaving like that, I think so. Although I myself still programming in DirectShow. thanks for the patience.

                    tanvon malik http://tanvon.wordpress.com http://DirectShow.wordpress.com DirectShow in URDU language http://groups.yahoo.com/group/tanvon http://www.codeproject.com/script/articles/list_articles.asp?userid=1638055

                    M 1 Reply Last reply
                    0
                    • T tanvon malik

                      Hi very interesting thread about DirectShow, I really liked it; I myself use Platform SDK 2003, don't you think Microsoft to make the DirectShow as a separate SDK, they are moving it from DirectX SDK to Platform SDK now in Windows SDK. Because for newer people it is sometimes awkward to see this that DirectShow is being placed here and there. And our newsgroups are swarming with questions like, DirectShow is not in DirectX SDK ? Where to find DirectShow SDK ? Which version to use ? Another thing is this that they are not calling it deprecated, but behaving like that, I think so. Although I myself still programming in DirectShow. thanks for the patience.

                      tanvon malik http://tanvon.wordpress.com http://DirectShow.wordpress.com DirectShow in URDU language http://groups.yahoo.com/group/tanvon http://www.codeproject.com/script/articles/list_articles.asp?userid=1638055

                      M Offline
                      M Offline
                      Mark Salsbery
                      wrote on last edited by
                      #11

                      Moving the DirectShow SDK is definitely awkward. I'm not sure what the benefit was supposed to be, but it was moved and that's where it's at. All we can do is spread the word.

                      tanvon malik wrote:

                      they are not calling it deprecated, but behaving like that,

                      I would say "matured", not deprecated. There's no further development going on for pre-Vista OS versions, so continued development will be for the new technologies introduced in Vista. Microsoft Media Foundation[^] is the next generation :) Cheers, Mark

                      Mark Salsbery Microsoft MVP - Visual C++ :java:

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups