[FFmpeg-user] How to properly record sound when capturing web cam?

Jean Louis ffmpeg at rcdrun.com
Tue May 1 19:33:52 EEST 2018


On Tue, May 01, 2018 at 06:14:15PM +0200, Carl Eugen Hoyos wrote:
> 2018-05-01 18:04 GMT+02:00, Jean Louis <ffmpeg at rcdrun.com>:
> 
> > [video4linux2,v4l2 @ 0x2590a40] Detected monotonic timestamps, converting
> > Input #0, video4linux2,v4l2, from '/dev/video0':
> >   Duration: N/A, start: 1525190574.860860
> 
> > Input #1, alsa, from 'default':
> >   Duration: N/A, start: 1525190574.924269
> 
> This is correct now, as said it could not work before.
> (If it did work for some encoders, this indicates a
> bug there.)
> 
> > [alsa @ 0x2592fc0] Thread message queue blocking;
> > consider raising the thread_queue_size option (current value: 100)
> > [video4linux2,v4l2 @ 0x2590a40] Thread message queue blocking;
> > consider raising the thread_queue_size option (current value: 8)
> 
> You should try to fix this.
> 
> Are you sure your system is fast enough for vp9 realtime
> encoding?

This is Thinkpad L430, pretty fast machine. Should
be working.

I have tried this one:

ffmpeg -y -f v4l2 -thread_queue_size 800 -video_size 800x448 -i /dev/video0 -f alsa -thread_queue_size 10000 -ac 1 -ar 14400 -i default  -q:v 5  output.webm; mplayer output.webm; ls -l output.webm

and that one works without warnings of the
thread_queue_size, maybe it would work with less
of it, but with 3000 it was still warning.

Yet, the result that sound is interrupted in WEBM
and MP4 and MKV formats is still same. If the
video is 15 seconds, 3 seconds before the sound is
off, and I could see on screen that only 10+
seconds were recorded.

OGV format is working well.

MPG format is working well but not with less than
15 fps, which is unrelated, so I can record it
with 640x480 without problems it has more fps.

If video is 7 seconds, sound is off about on 5th
second.

Jean


More information about the ffmpeg-user mailing list