[FFmpeg-user] Trying to write to disk the output of a USB capture card and can't combine video and audio

Carl Eugen Hoyos ceffmpeg at gmail.com
Thu Dec 17 08:51:38 EET 2020

> Am 17.12.2020 um 00:47 schrieb Geoff Sweet <mailinator at whootis.com>:
> ffmpeg -y -f alsa -ac 2 -i front:CARD=Capture,DEV=0 -f video4linux2 -i /dev/video0 out.mpeg

„mpeg“ output will not make you happy.

> But that command kinda falls on its face. I get the audio, but no video:
> ffmpeg -y -f alsa -ac 2 -i front:CARD=Capture,DEV=0 -f video4linux2 -i /dev/video0 out.mpeg
> ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers

Please remember to test current FFmpeg git head before posting here.


> Input #0, alsa, from 'front:CARD=Capture,DEV=0':
> Duration: N/A, start: 1608093176.894565, bitrate: 1536 kb/s
> Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
> [video4linux2,v4l2 @ 0x56248fe0ab80] Dequeued v4l2 buffer contains corrupted data (0 bytes).
> Input #1, video4linux2,v4l2, from '/dev/video0':
> Duration: N/A, start: 0.000000, bitrate: 995328 kb/s

The start times do not match, this makes recording very difficult because there will likely be A/V desync.

Try the v4l2 input option -ts abs
See: https://ffmpeg.org/ffmpeg-devices.html#Options-18

Carl Eugen

More information about the ffmpeg-user mailing list