What is the best method for capturing video using Visual C++? [solved]
-
Hey everyone! I am currently working on a project that requires the capture of video from a video capture card. This video needs to be recorded for later analysis. There are many different examples online, and a few here on CodeProject, but I would really like some advice. Which API or method is the best for video capture with the requirements below? 1. Ability to select from multiple devices. In this particular case, I need support for a TV capture card or a webcam. 2. Ability to preview video in realtime. 3. Ability to record the output to a file or series of files. 4. Has to be compatible with Visual C++. Thanks for the help! -Nathan
modified on Wednesday, August 19, 2009 2:49 PM
-
Hey everyone! I am currently working on a project that requires the capture of video from a video capture card. This video needs to be recorded for later analysis. There are many different examples online, and a few here on CodeProject, but I would really like some advice. Which API or method is the best for video capture with the requirements below? 1. Ability to select from multiple devices. In this particular case, I need support for a TV capture card or a webcam. 2. Ability to preview video in realtime. 3. Ability to record the output to a file or series of files. 4. Has to be compatible with Visual C++. Thanks for the help! -Nathan
modified on Wednesday, August 19, 2009 2:49 PM
DirectX DirectShow is the answer your questions.You could use it to capture and configurate web cams,capture video from files,capture from TV tuners,capture network streams and etc.Microsoft Media Foundation which starts from Windows Vista as alternative of DirectX and Windows media SDK also could be useful. :)
Life is a stage and we are all actors!
-
Hey everyone! I am currently working on a project that requires the capture of video from a video capture card. This video needs to be recorded for later analysis. There are many different examples online, and a few here on CodeProject, but I would really like some advice. Which API or method is the best for video capture with the requirements below? 1. Ability to select from multiple devices. In this particular case, I need support for a TV capture card or a webcam. 2. Ability to preview video in realtime. 3. Ability to record the output to a file or series of files. 4. Has to be compatible with Visual C++. Thanks for the help! -Nathan
modified on Wednesday, August 19, 2009 2:49 PM
As Hristo Bojilov's, so does my vote also go to DirectShow.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
DirectX DirectShow is the answer your questions.You could use it to capture and configurate web cams,capture video from files,capture from TV tuners,capture network streams and etc.Microsoft Media Foundation which starts from Windows Vista as alternative of DirectX and Windows media SDK also could be useful. :)
Life is a stage and we are all actors!
Thank you for the quick response to my question! Yes, I've heard mention of DirectShow. I have tried reading some of the DirectShow documentation, but I am not exactly sure where I should get started with the API. Do you have any suggestions of resources that I should read? The regular MSDN documentation seems a bit clunky to navigate, and I'm not exactly sure what my starting point should be.
-
Thank you for the quick response to my question! Yes, I've heard mention of DirectShow. I have tried reading some of the DirectShow documentation, but I am not exactly sure where I should get started with the API. Do you have any suggestions of resources that I should read? The regular MSDN documentation seems a bit clunky to navigate, and I'm not exactly sure what my starting point should be.
There isn't many to many samples how to work with DirectShow in C++.The reason is that COM is not the favourite model for most of the developers.Here is nice sample how to capture single frame from web camera using C++.You could easy adapt it to your MFC app for example.I highly recommend to test your graphs with GraphEdit or GraphStudio or some similar graph configuration testing tool before you create them programatically.
Life is a stage and we are all actors!
modified on Wednesday, August 19, 2009 12:30 PM
-
There isn't many to many samples how to work with DirectShow in C++.The reason is that COM is not the favourite model for most of the developers.Here is nice sample how to capture single frame from web camera using C++.You could easy adapt it to your MFC app for example.I highly recommend to test your graphs with GraphEdit or GraphStudio or some similar graph configuration testing tool before you create them programatically.
Life is a stage and we are all actors!
modified on Wednesday, August 19, 2009 12:30 PM
-
Thank you, Hristo. Those resources look good (much better than my searches were yielding). I will read up on them and I will attempt to test them within GraphEdit.
-
Thank you for the quick response to my question! Yes, I've heard mention of DirectShow. I have tried reading some of the DirectShow documentation, but I am not exactly sure where I should get started with the API. Do you have any suggestions of resources that I should read? The regular MSDN documentation seems a bit clunky to navigate, and I'm not exactly sure what my starting point should be.
last time i looked, there were a whole bunch of samples in the DirectShow SDK. i found them quite useful for what i had to do (frame grabbing).