[FFmpeg-user] Webcam capture with ffmpeg on Windows: need help with raw capture + preview window.

Paul Goins general at vultaire.net
Wed May 22 07:33:48 CEST 2013


Hi,

I've been experimenting with ffmpeg as a replacement for the abysmal
webcam software provided with my Logitech web cam.  I'm not an ffmpeg
pro by any means; I'm studying a lot though and have put in
significant effort to try to figure this out myself.  Pointers would
be really helpful.

Basically, I'm trying to do a "raw" 720p webcam/microphone capture via
dshow, and am also trying to hook in a preview window via ffplay.


My command line looks like this (line breaks inserted for readability):

ffmpeg -f dshow -rtbufsize 1000000k -s 1280x720 -r 30 \
     -i video="Logicool HD Webcam C310":audio="マイク (Realtek High Definition Au" \
     -vcodec copy -acodec copy -r 30 -threads 4 output.avi \
     -s 426x240 -pix_fmt yuv420p -f rawvideo - \
     | ffplay -f rawvideo -pixel_format yuv420p -video_size 426x240 -


And for completeness, my input streams look like:

Input #0, dshow, from 'video=Logicool HD Webcam C310:audio=繝槭う繧ッ (Realtek High Definition Au':
   Duration: N/A, start: 175477.576000, bitrate: 1411 kb/s
     Stream #0:0: Video: rawvideo, bgr24, 1280x720, 30 tbr, 10000k tbn, 30 tbc
     Stream #0:1: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s


Problems encountered are:

1. ffplay output is delayed by a second or two.

2. output.avi gets cut off prematurely; this does not happen if I omit
    piping to ffplay.

3. I get error messages such as "real-time buffer 62% full! frame
    dropped!" after about 40 seconds.  Without the ffplay stream, I do
    not get this.


I'm not sure I've provided enough info, but would any of you have
suggestions for how to make this work?

Thanks,

- Paul Goins


More information about the ffmpeg-user mailing list