• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 447
  • Last Modified:

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
0
mabell
Asked:
mabell
  • 7
  • 4
  • 2
  • +4
1 Solution
 
Wim ten BrinkSelf-employed developerCommented:
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.
0
 
mabellAuthor Commented:
OK.. but how I set which device I want to use?
0
 
mabellAuthor Commented:
I just check .. it list the drivers not the devices names (video source)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Wim ten BrinkSelf-employed developerCommented:
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.
0
 
mabellAuthor Commented:
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...
0
 
ginsonicCommented:
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.
0
 
Lee_NoverCommented:
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
0
 
mabellAuthor Commented:
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...  
0
 
Lee_NoverCommented:
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 ?
0
 
mabellAuthor Commented:
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.
0
 
Lee_NoverCommented:
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
0
 
mabellAuthor Commented:
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 ?
0
 
Lee_NoverCommented:
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
0
 
mabellAuthor Commented:
The problem is that I only have Delphi 3 :(
0
 
CleanupPingCommented:
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.
0
 
Lukasz LachCommented:
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
0
 
Computer101Commented:
PAQed, with points refunded (450)

Computer101
E-E Admin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 7
  • 4
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now