Solved

Video Capture with directshow

Posted on 2002-07-19
17
425 Views
Last Modified: 2010-04-04
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
Comment
Question by:mabell
  • 7
  • 4
  • 2
  • +4
17 Comments
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 7165927
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
 

Author Comment

by:mabell
ID: 7165933
OK.. but how I set which device I want to use?
0
 

Author Comment

by:mabell
ID: 7165942
I just check .. it list the drivers not the devices names (video source)
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 7165971
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
 

Author Comment

by:mabell
ID: 7166062
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
 
LVL 9

Expert Comment

by:ginsonic
ID: 7166204
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
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 7166730
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
 

Author Comment

by:mabell
ID: 7167223
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 12

Expert Comment

by:Lee_Nover
ID: 7167275
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
 

Author Comment

by:mabell
ID: 7167427
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
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 7167586
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
 

Author Comment

by:mabell
ID: 7167982
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
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 7169188
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
 

Author Comment

by:mabell
ID: 7169778
The problem is that I only have Delphi 3 :(
0
 

Expert Comment

by:CleanupPing
ID: 9343026
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
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 9461334
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
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 9537789
PAQed, with points refunded (450)

Computer101
E-E Admin
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now