Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I want to capture audio and video from webcam using ffmpeg on WindowsXP.
I know the command to capture only video as given below (In case somebody need it)

ffmpeg -f vfwcap -r 25 -i 0 sample.avi

where
1) -f is to specify force format.
2) vfwcap is for webcam video stream on Windows XP
3) -r 25 is to specify frame rate
4) -i 0 is to specify input device which is 0 incase of default webcam
5) sample.avi is the output file

So, this command will capture video stream from the webcam and store it into sample.avi

My problem is like I also want to capture audio at the same time.
ffmpeg has options for the same in Linux. But I didn't kind of find any help regarding this for Windows O/S.

If anybody knows this, then please help me.

Thanks in advance.

BTW, I know how to compile ffmpeg source on windows using MinGW and MSys. I also know how to use ffmpeg libraries in VC++ Express edition and VC++ VS2005 edition.
If anybody has the same requirements then please let me know

Thanks
Posted
Updated 1-Jun-11 8:13am
v3
Comments
Sergey Alexandrovich Kryukov 1-Jun-11 14:05pm    
You have only one tag "audio-video". Please tag platform and language. This way you have a chance that a right expert pays attention for your question.
--SA
Orcun Iyigun 1-Jun-11 14:20pm    
http://koorenneef.nl/content/capture-video-webcam-ffmpeg do you think this link is beneficial?
gksolanki 1-Jun-11 14:25pm    
Thanks orc_orc_orc, I will give it a shot

Thanks
gksolanki 2-Jun-11 2:25am    
Thanks for the link. I got the same command line option that I gave in this question earlier and they are for capturing video. My requirement is to capture audio too which is not there in that command line options. But thanks for your reply. If you have any other link then please give it to me.
WRCooke 9-Mar-12 9:41am    
gksolanki, did you ever find a solution for this? I am having the exact same issue.

1 solution

Check if this helps

DirectX.Capture Class Library[^]
 
Share this answer
 
Comments
gksolanki 3-Jun-11 2:09am    
Will this solution work with ffmpeg? It seems that it is for DirectX and .NET
Thanks for the help. I will go through it and check whether it is helpful or not?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900