Link to home
Start Free TrialLog in
Avatar of mabell
mabell

asked on

Video Capture with directshow

hi all, I want to know how to capture pics and avi and be able to select the video source using directshow(without the drivers dialog boxes) in code.
thanks
Avatar of Wim ten Brink
Wim ten Brink
Flag of Netherlands image

Hmmm... I've been looking in "The Tomes of Delphi/Win32 Multimedia API" but haven't found much info.
You could look in the registry for the key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\MediaResources\msvideo
and walk through all subkeys that are listed here. Or maybe one of the other keys in this area.
Avatar of mabell
mabell

ASKER

OK.. but how I set which device I want to use?
Avatar of mabell

ASKER

I just check .. it list the drivers not the devices names (video source)
Searching... Found the function mciSendCommand that you use with the MCI_RECORD parameter to record. The first parameter of this function points to a recording device. I guess you can get this by using the mciGetDeviceID API which requires a name and returns an ID.
Still, I have the book but need to read it first. Never had the chance to read it before. ;-) Still, it's an interesting book.
Avatar of mabell

ASKER

I took a look at mmsystem.hlp but I don't found the mci command to retreive the capture devices names and I don't understant how to use mci messages to retreive data response from it...
Give me your address and I will send you couple sample projects for video capture. All can detect your capture devices and let you to select one from a list.
a good component for video capture is TVideoCapture from egor averchenko (which I use in my projects)
you can get it at www.torry.net/video.htm
another set of DS components (also video capture) is DSPack from henry gourvest
get it at www.progdigy.com

o get a list of devices with TVideoCapture you simply call GetVideoDevicesList
you can also get lists for AudioDevices as well as VideoCompressors and AudioCmpressors
Avatar of mabell

ASKER

Good but I don't want to use a component I just want to know how to get and set the video source in code .. I have checked the components codes but it have too more stuff in this to me to find out how to do it...  
aha
what do you do with the source you choose ?
you use it in anyway or what ?
do you capture the video at all with your app ?
Avatar of mabell

ASKER

No I checked the source of the components to understand how it was done .. I know how to capture pics and avi but I don't know how to change the source (capture device)so I don't need a component that is doing all the things related to capture.
and what are you using ? VWF I guess
well about that I don't know how to change the device programatically
I had the same problem when starting the vide project
there were also lots of other limitations that made me change to DirectShow
with DirectShow I really haven't found a thing I couldn't do
so maybe you should rethink about capture methods
Avatar of mabell

ASKER

Ok so where I can find information on how to capture avi and pics with different video source without poping dialog box to select them ?
with VFW that isn't possible (at least I haven't found a way)
with DirectShow simply use TVideoCapture I mentioned before
simply drop the component on the form and you're ready to choose any of the installed video and audio sources as well as any installed video and audio compression codecs
you can also set the framerate, frame width and height
capture to a video file with audio or grab a snapshot
there's an included demo showing how to do things
I have further enhanced the component to give it support for capturing audio buffers
I've contacted egor but he hasn't replied
Avatar of mabell

ASKER

The problem is that I only have Delphi 3 :(
mabell:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
mabell,
No comment has been added lately (18 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Accept Lee_Nover's answer http:#7166730 and Refund

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

anAKiN
EE Cleanup Volunteer
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial