Solved

Video Capture with directshow

Posted on 2002-07-19
17
431 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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!

 
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
 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 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