Trying to write to disk the output of a USB capture card and can't combine video and audio
I've been doing a fair bit of digging into this as this is my first project to convert some old magnetic tape media to digital. ffmpeg seems like exactly what I want be using. I'm kinda newbie to this so I'm hoping for some guidance. I'm using ffmpeg on Arch linux and trying to convert some old video to digital. The setup is pretty straightforward and if I connect to the capture device with something like VLC I get the video and audio just fine. So now I want to capture that with ffmpeg and write it to a file so I can edit it and clean it up with something like OpenShot. I'm only so-so familiar with ffmpeg and I've been digging through the man pages and here is where I am at. This command captures perfect audio, but obviously no video: ffmpeg -f alsa -ac 2 -i front:CARD=Capture,DEV=0 out.mpeg This command captures perfect video, but likewise no audio: ffmpeg -f video4linux2 -i /dev/video0 out.mpeg So combining them together should give me: ffmpeg -y -f alsa -ac 2 -i front:CARD=Capture,DEV=0 -f video4linux2 -i /dev/video0 out.mpeg 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 built with gcc 10.2.0 (GCC) configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-shared --enable-version3 libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100 Guessed Channel Layout for Input Stream #0.0 : stereo 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 Stream #1:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 995328 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc Stream mapping: Stream #1:0 -> #0:0 (rawvideo (native) -> mpeg1video (native)) Stream #0:0 -> #0:1 (pcm_s16le (native) -> mp2 (native)) Press [q] to stop, [?] for help [video4linux2,v4l2 @ 0x56248fe0ab80] Dequeued v4l2 buffer contains corrupted data (0 bytes). Last message repeated 30 times [alsa @ 0x56248fdb3840] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8) [mpeg @ 0x56248fe0dfc0] VBV buffer size not set, using default size of 230KB If you want the mpeg file to be compliant to some specification Like DVD, VCD or others, make sure you set the correct buffer size Output #0, mpeg, to 'out.mpeg': Metadata: encoder : Lavf58.45.100 Stream #0:0: Video: mpeg1video, yuv420p(progressive), 1920x1080, q=2-31, 200 kb/s, 30 fps, 90k tbn, 30 tbc Metadata: encoder : Lavc58.91.100 mpeg1video Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s Metadata: encoder : Lavc58.91.100 mp2 frame= 2 fps=0.0 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=2.0 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=1.3 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=1.0 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.8 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.7 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.6 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.5 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.4 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.4 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.4 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.3 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.3 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.3 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.3 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.2 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.2 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.2 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.2 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.2 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.2 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.2 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.2 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.2 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.2 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.2 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/sframe= 2 fps=0.1 q=3.2 size= 0kB time=01:48:49.26 bitrate= 0.0kbits/s[video4linux2,v4l2 @ 0x56248fe0ab80] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8) [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=0 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=2020 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=4061 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=6102 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=8143 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=10184 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=12225 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=14266 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=16307 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=18348 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=20389 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=22430 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=24471 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=26512 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=28553 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=30594 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=32635 size=36451 [mpeg @ 0x56248fe0dfc0] buffer underflow st=0 bufi=34676 size=36451 frame= 2 fps=0.1 q=2.0 Lsize= 1470kB time=01:48:49.30 bitrate= 1.8kbits/s speed= 221x video:63kB audio:1388kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.314351% Exiting normally, received signal 2. I then opted to change some values based on a couple things. I adjusted the thread_queue and I also altered the output format: $ ffmpeg -y -thread_queue_size 4096 -f video4linux2 -framerate 60 -input_format mjpeg -video_size 1920x1080 -i /dev/video0 -thread_queue_size 4096 -f alsa -ac 2 -i front:CARD=Capture,DEV=0 out_raw.mp4 ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 10.2.0 (GCC) configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-shared --enable-version3 libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100 [video4linux2,v4l2 @ 0x56509c622980] Dequeued v4l2 buffer contains corrupted data (0 bytes). Last message repeated 31 times [mjpeg @ 0x56509c623f80] EOI missing, emulating Input #0, video4linux2,v4l2, from '/dev/video0': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080, 60 fps, 60 tbr, 1000k tbn, 1000k tbc Guessed Channel Layout for Input Stream #1.0 : stereo Input #1, alsa, from 'front:CARD=Capture,DEV=0': Duration: N/A, start: 1608162060.630640, bitrate: 1536 kb/s Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264)) Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native)) Press [q] to stop, [?] for help [libx264 @ 0x56509c68d540] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX [libx264 @ 0x56509c68d540] profile High 4:2:2, level 4.2, 4:2:2, 8-bit [libx264 @ 0x56509c68d540] 264 - core 160 r3011 cde9a93 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'out_raw.mp4': Metadata: encoder : Lavf58.45.100 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuvj422p(pc, progressive), 1920x1080, q=-1--1, 60 fps, 15360 tbn, 60 tbc Metadata: encoder : Lavc58.91.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s Metadata: encoder : Lavc58.91.100 aac frame= 31 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= frame= 51 fps= 50 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= frame= 57 fps= 38 q=31.0 size= 0kB time=20:56:52.53 bitrate= 0.0kbits/ frame= 57 fps= 28 q=31.0 size= 0kB time=20:56:52.53 bitrate= 0.0kbits/ frame= 57 fps= 23 q=31.0 size= 0kB time=20:56:52.53 bitrate= 0.0kbits/ frame= 57 fps= 19 q=31.0 size= 0kB time=20:56:52.53 bitrate= 0.0kbits/ frame= 57 fps= 16 q=31.0 size= 0kB time=20:56:52.53 bitrate= 0.0kbits/ frame= 57 fps= 14 q=31.0 size= 0kB time=20:56:52.53 bitrate= 0.0kbits/ frame= 57 fps= 13 q=31.0 size= 0kB time=20:56:52.53 bitrate= 0.0kbits/ frame= 57 fps= 11 q=31.0 size= 0kB time=20:56:52.53 bitrate= 0.0kbits/ frame= 57 fps= 10 q=31.0 size= 0kB time=20:56:52.53 bitrate= 0.0kbits/ frame= 57 fps=9.4 q=31.0 size= 0kB time=20:56:52.53 bitrate= 0.0kbits/ frame= 57 fps=8.7 q=31.0 size= 0kB time=20:56:52.53 bitrate= 0.0kbits/ frame= 57 fps=8.1 q=31.0 size= 0kB time=20:56:52.53 bitrate= 0.0kbits/ frame= 57 fps=7.5 q=31.0 size= 0kB time=20:56:52.53 bitrate= 0.0kbits/ frame= 57 fps=6.4 q=-1.0 Lsize= 557kB time=20:56:53.46 bitrate= 0.1kbits/s speed=8.52e+03x video:428kB audio:123kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.098067% [libx264 @ 0x56509c68d540] frame I:1 Avg QP:22.99 size: 6002 [libx264 @ 0x56509c68d540] frame P:16 Avg QP:22.21 size: 6749 [libx264 @ 0x56509c68d540] frame B:40 Avg QP:23.66 size: 8097 [libx264 @ 0x56509c68d540] consecutive B-frames: 3.5% 0.0% 26.3% 70.2% [libx264 @ 0x56509c68d540] mb I I16..4: 37.0% 63.0% 0.0% [libx264 @ 0x56509c68d540] mb P I16..4: 23.4% 26.5% 0.0% P16..4: 5.1% 0.4% 0.2% 0.0% 0.0% skip:44.5% [libx264 @ 0x56509c68d540] mb B I16..4: 12.5% 19.4% 0.0% B16..8: 21.3% 1.7% 0.1% direct: 1.5% skip:43.4% L0:60.6% L1:39.0% BI: 0.4% [libx264 @ 0x56509c68d540] 8x8 transform intra:58.1% inter:70.0% [libx264 @ 0x56509c68d540] coded y,uvDC,uvAC intra: 11.6% 0.0% 0.0% inter: 2.4% 0.1% 0.0% [libx264 @ 0x56509c68d540] i16 v,h,dc,p: 72% 24% 3% 1% [libx264 @ 0x56509c68d540] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 19% 54% 1% 0% 0% 0% 0% 0% [libx264 @ 0x56509c68d540] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 65% 33% 2% 0% 0% 0% 0% 0% 0% [libx264 @ 0x56509c68d540] i8c dc,h,v,p: 99% 0% 1% 0% [libx264 @ 0x56509c68d540] Weighted P-Frames: Y:0.0% UV:0.0% [libx264 @ 0x56509c68d540] ref P L0: 37.9% 1.6% 41.6% 18.9% [libx264 @ 0x56509c68d540] ref B L0: 49.0% 35.7% 15.3% [libx264 @ 0x56509c68d540] ref B L1: 84.9% 15.1% [libx264 @ 0x56509c68d540] kb/s:3687.33 [aac @ 0x56509c68e3c0] Qavg: 12434.811 I'm sorta getting to the point where I'm throwing stuff against the wall to see what sticks. I was hoping that someone could give me some advice. The source of the media is from a component output video signal, into a component-to-hdmi converter. From that converter I got into a 1080p 60pfs hdmi-hdmi pass through that connects to the computer via USB and shows up as /dev/video0 and the audio source listed above. It works great because I can connect to it through VLC and get good audio and video. Thanks everyone! As always, any help is definitely appreciated.
Am 17.12.2020 um 00:47 schrieb Geoff Sweet <mailinator@whootis.com>:
ffmpeg -y -f alsa -ac 2 -i front:CARD=Capture,DEV=0 -f video4linux2 -i /dev/video0 out.mpeg
Unrelated: „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
Thank you for the feedback. Interestingly, this: [video4linux2,v4l2 @ 0x56248fe0ab80] Dequeued v4l2 buffer contains corrupted data (0 bytes). Appears to be my headache and I kinda discovered it by accident. I was experimenting with some suggestions from another forum and found this command: ffmpeg -y -thread_queue_size 1024 -f alsa -channels 2 -i front:CARD=Capture,DEV=0 -thread_queue_size 1024 -f video4linux2 -video_size 640x480 -i /dev/video0 -c:v libx264 -crf 0 -g 1 -c:a copy output.mkv Worked great. Until I ran it again and it fell on its face. It's definitely not something in the ffmpeg space, it's the v4l2. First time you run that command after plugging the capture device in, it runs fine with no errors. Second time you run it you get that corrupted data error. If I unplug the capture device, then plug it back in it appears to reset the v4l2 device interface. Then running that command above again produces really nice clean in-sync video. So I guess I have a work around. I suppose I will move this over to the v4l2 folks and see what they make of it. Looks like theres already a few threads on Google about it. Thanks again for the followup. -Geoff On 2020-12-16 22:51, Carl Eugen Hoyos wrote:
Am 17.12.2020 um 00:47 schrieb Geoff Sweet <mailinator@whootis.com>:
ffmpeg -y -f alsa -ac 2 -i front:CARD=Capture,DEV=0 -f video4linux2 -i /dev/video0 out.mpeg
Unrelated: „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 _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
participants (2)
-
Carl Eugen Hoyos -
Geoff Sweet