[FFmpeg-user] Grabbing video through the webcam

Cecil Westerhof Cecil at decebal.nl
Sat Jan 14 21:19:49 CET 2012


Op zaterdag 14 jan 2012 12:00 CET schreef dE .:

> On 01/14/12 21:25, Cecil Westerhof wrote:
>> I upgraded to openSUSE 12.1 and at the moment wxcam does not work
>> there. I tried cheese, but this does not record audio.
>>
>> I cam across a command-line for ffmpeg and I use now:
>> ffmpeg -y -f oss -i /dev/dsp -f video4linux2 -s 640x480 -i /dev/video0 out.avi
>>
>> This works reasonable well. Video is not so good, but audio is. Is
>> there a way to get better video? When I use cheese the video is a lot
>> better as when I use ffmpeg.
>>
>> What also would be nice if I could see what I am recording. Is that
>> possible?
>>
>> What is the ‘right’ way to stop? Now I stop with Ctrl+C, but that does
>> not give a clear cut.
>>
>
> Increase the resolution, and use a specific video codec -
>
> ffmpeg -y -f alsa -i plughw:0,0 -f video4linux2 -s 640x480 -i /dev/video0
> 	-preset ultrafast -b 20000k -vcodec libx264 out.avi
>
> And use alsa instead of OSS.

I have been experimenting and with:
    ffmpeg -y -f oss -i /dev/dsp -f video4linux2 -s 640x480 -i /dev/video0 -f avi -vcodec mpeg4 -b 600k -g 150 -bf 2 -acodec libmp3lame -ar 8000 -ab 16k out.avi

I get good results on one computer. On another (the one I want to use
for it) the audio is not good. A lot of noise. But that could also be
because that one has openSUSE 11.4 and the one I get good results on
has openSUSE 12.1. I'll try your command-line also.

Why alsa instead of oss? (The example in the manpage uses oss. If alsa
is better, maybe the manpage should be updated.)

No possibility to see what I am recording?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof


More information about the ffmpeg-user mailing list