How to deal with "Buffer queue overflow, dropping." (ffmpeg) - ffmpeg

Sometimes it works great and sometimes I'm getting this message
[Parsed_overlay_0 # 0x7f9520518800] [framesync # 0x7f9521021e28] Buffer queue overflow, dropping.
by running this command
ffmpeg -i a1.mp4 -i watermark150x125.png -filter_complex 'overlay=10:10' output.mp4
I tried different variation of "overlay" like overlay=W-w-5:H-h-5, overlay=10:main_h-overlay_h-10, overlay=main_w-overlay_w-10:main_h-overlay_h-10 - getting the same result.
Here is the output of the ffmpeg command.
ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.6.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
[mov,mp4,m4a,3gp,3g2,mj2 # 0x7f952101d200] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
artist : a1
album :
comment :
date : 0
genre :
title : a1
encoder : Lavf56.4.101
Duration: 00:01:41.51, start: 0.000000, bitrate: 227 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 426x240 [SAR 1:1 DAR 71:40], 97 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 120x90 [SAR 1:1 DAR 4:3], 90k tbr, 90k tbn, 90k tbc
Input #1, png_pipe, from 'watermark150x125.png':
Duration: N/A, bitrate: N/A
Stream #1:0: Video: png, rgba, 150x125 [SAR 2835:2835 DAR 6:5], 25 tbr, 25 tbn, 25 tbc
[swscaler # 0x7f9521013e00] deprecated pixel format used, make sure you did set range correctly
[libx264 # 0x7f9521030e00] using SAR=1/1
[libx264 # 0x7f9521030e00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 # 0x7f9521030e00] profile High, level 2.1
[libx264 # 0x7f9521030e00] 264 - core 144 r2533 c8a773e - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - 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=6 lookahead_threads=1 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 'output.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
artist : a1
album :
comment :
date : 0
genre :
title : a1
encoder : Lavf56.25.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 426x240 [SAR 1:1 DAR 71:40], q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc (default)
Metadata:
encoder : Lavc56.26.100 libx264
Stream #0:1(und): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc56.26.100 libvo_aacenc
Stream mapping:
Stream #0:0 (h264) -> overlay:main (graph 0)
Stream #0:2 (mjpeg) -> overlay:overlay (graph 0)
overlay (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (aac (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help
[Parsed_overlay_0 # 0x7f9520518800] [framesync # 0x7f9521021e28] Buffer queue overflow, dropping.
Last message repeated 385 times
[Parsed_overlay_0 # 0x7f9520518800] [framesync # 0x7f9521021e28] Buffer queue overflow, dropping.
Last message repeated 564 times
[Parsed_overlay_0 # 0x7f9520518800] [framesync # 0x7f9521021e28] Buffer queue overflow, dropping.
Last message repeated 546 times
[Parsed_overlay_0 # 0x7f9520518800] [framesync # 0x7f9521021e28] Buffer queue overflow, dropping.
Last message repeated 569 times
[Parsed_overlay_0 # 0x7f9520518800] [framesync # 0x7f9521021e28] Buffer queue overflow, dropping.
Last message repeated 593 times
[Parsed_overlay_0 # 0x7f9520518800] [framesync # 0x7f9521021e28] Buffer queue overflow, dropping.
Last message repeated 312 times
frame= 3041 fps=645 q=-1.0 Lsize= 1800kB time=00:01:41.52 bitrate= 145.3kbits/s dup=2975 drop=0
video:149kB audio:1587kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.700745%
[libx264 # 0x7f9521030e00] frame I:14 Avg QP:19.91 size: 6947
[libx264 # 0x7f9521030e00] frame P:768 Avg QP:10.30 size: 27
[libx264 # 0x7f9521030e00] frame B:2259 Avg QP:13.67 size: 15
[libx264 # 0x7f9521030e00] consecutive B-frames: 0.9% 0.1% 0.1% 98.9%
[libx264 # 0x7f9521030e00] mb I I16..4: 18.7% 59.0% 22.3%
[libx264 # 0x7f9521030e00] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.1% 0.0% 0.0% 0.0% 0.0% skip:99.9%
[libx264 # 0x7f9521030e00] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.1% 0.0% 0.0% direct: 0.0% skip:99.9% L0:50.7% L1:49.3% BI: 0.0%
[libx264 # 0x7f9521030e00] 8x8 transform intra:59.1% inter:31.9%
[libx264 # 0x7f9521030e00] coded y,uvDC,uvAC intra: 21.4% 12.4% 7.4% inter: 0.0% 0.0% 0.0%
[libx264 # 0x7f9521030e00] i16 v,h,dc,p: 39% 30% 30% 0%
[libx264 # 0x7f9521030e00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 47% 16% 1% 0% 0% 1% 0% 1%
[libx264 # 0x7f9521030e00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 38% 15% 3% 3% 3% 6% 4% 7%
[libx264 # 0x7f9521030e00] i8c dc,h,v,p: 80% 15% 4% 1%
[libx264 # 0x7f9521030e00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x7f9521030e00] ref P L0: 96.5% 1.2% 2.3%
[libx264 # 0x7f9521030e00] ref B L0: 51.5% 48.5%
[libx264 # 0x7f9521030e00] ref B L1: 99.6% 0.4%
[libx264 # 0x7f9521030e00] kb/s:11.97

I only got errors with videos that didn't have libx264 codec.
So, after adding ffmpeg -i a1.mp4 -vcodec libx264 -crf 0 newa1.mp4 - everything starts working fine.

Related

Stacking different length videos not working with ffmpeg and -itsoffset

I developed a video conferencing app that records the video streams separately, and I am now looking for a way to merge them. At the moment I am experimenting with -itsoffset and hstack to stack 2 videos side by side using this command:
ffmpeg \
-itsoffset 17 -i smaller.mp4 \
-itsoffset 0 -i bigger.mp4 \
-filter_complex hstack=inputs=2 \
-c:v libx264 -crf 23 out.mp4
The result is a side by side video where both streams remain frozen for 17 seconds then start playing, even the bigger.mp4 video that should start at time 0.
Any help would be really appreciated!
ffmpeg verbose:
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 4.9.2 (Debian 4.9.2-10+deb8u1)
configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libspeex --enab le-shared --enable-pthreads --enable-libopenjpeg --enable-nonfree --enable-libopus --enable-libvorbis --enable-libvpx
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'smaller.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
Duration: 00:00:05.16, start: 0.000000, bitrate: 444 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 480x360 [SAR 1:1 DAR 4:3], 330 kb/s, 32 fps, 32 tbr, 16384 tbn, 64 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 103 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'bigger.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.36.100
Duration: 00:00:22.03, start: 0.000000, bitrate: 290 kb/s
Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 480x360 [SAR 1:1 DAR 4:3], 177 kb/s, 32 fps, 32 tbr, 16384 tbn, 64 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 103 kb/s (default)
Metadata:
handler_name : SoundHandler
File 'out.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
Stream #0:0 (h264) -> hstack:input0 (graph 0)
Stream #1:0 (h264) -> hstack:input1 (graph 0)
hstack (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 # 0x206ed00] using SAR=1/1
[libx264 # 0x206ed00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 # 0x206ed00] profile High, level 3.1
[libx264 # 0x206ed00] 264 - core 146 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - 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=3 lookahead_threads=1 sliced_thre ads=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 scene cut=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.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 960x360 [SAR 1:1 DAR 8:3], q=-1--1, 32 fps, 16384 tbn, 32 tbc (default)
Metadata:
encoder : Lavc58.35.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc58.35.100 aac
frame= 709 fps=130 q=-1.0 Lsize= 573kB time=00:00:22.12 bitrate= 212.2kbits/s dup=544 drop=0 speed=4.05x
video:478kB audio:81kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.445685%
[libx264 # 0x206ed00] frame I:3 Avg QP:16.86 size: 38355
[libx264 # 0x206ed00] frame P:190 Avg QP:18.22 size: 1633
[libx264 # 0x206ed00] frame B:516 Avg QP:16.23 size: 123
[libx264 # 0x206ed00] consecutive B-frames: 1.3% 2.8% 6.8% 89.1%
[libx264 # 0x206ed00] mb I I16..4: 6.6% 54.8% 38.6%
[libx264 # 0x206ed00] mb P I16..4: 0.4% 1.5% 0.2% P16..4: 8.7% 4.0% 1.9% 0.0% 0.0% skip:83.3%
[libx264 # 0x206ed00] mb B I16..4: 0.0% 0.1% 0.0% B16..8: 4.2% 0.3% 0.0% direct: 0.0% skip:95.4% L0:37.2% L1:58.9% BI: 4.0%
[libx264 # 0x206ed00] 8x8 transform intra:66.2% inter:63.4%
[libx264 # 0x206ed00] coded y,uvDC,uvAC intra: 66.1% 65.6% 21.6% inter: 1.7% 1.1% 0.0%
[libx264 # 0x206ed00] i16 v,h,dc,p: 21% 26% 11% 42%
[libx264 # 0x206ed00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 23% 13% 5% 7% 8% 7% 7% 6%
[libx264 # 0x206ed00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 24% 9% 6% 7% 7% 6% 7% 7%
[libx264 # 0x206ed00] i8c dc,h,v,p: 46% 25% 20% 9%
[libx264 # 0x206ed00] Weighted P-Frames: Y:1.1% UV:0.0%
[libx264 # 0x206ed00] ref P L0: 66.0% 19.4% 12.0% 2.6% 0.0%
[libx264 # 0x206ed00] ref B L0: 87.2% 11.8% 1.0%
[libx264 # 0x206ed00] ref B L1: 95.2% 4.8%
[libx264 # 0x206ed00] kb/s:176.52
[aac # 0x204aa00] Qavg: 247.398
hstack doesn't sync by timestamps. You'll need to pad the delayed video.
ffmpeg \
-i smaller.mp4 \
-i bigger.mp4 \
-filter_complex \
"[0]tpad=start_duration=17[left];\
[left][1]hstack=inputs=2;\
[0]adelay=17s|17s[lefta];[lefta][1]amix=2" \
-c:v libx264 -crf 23 out.mp4

FFmpeg - Buffer queue overflow, dropping - when combining 2 videos and using concat, hstack and trim

I am trying to merge two videos using concat and hstack but getting buffer overflow error resulting in the one of the video getting paused for few seconds.
I tried adding fifo and h264 video codec as suggested on this forum but the issue persists.
Can someone please let me know the issue in this command? Many thanks in advance.
ffmpeg -i 1_a.opus -i 2_a.opus -i 1_v.mp4 -i 2_v_bars.mp4 -filter_complex "[1:a]adelay=15720|15720[a1]; [0:a][a1]amix; [3:v]trim=0:15.81,geq=0:128:128,fifo [silence]; [silence][3:v]concat,fifo [3_v_silence]; [3_v_silence][2:v]hstack,fifo" -vcodec libx264 -strict experimental -y out_fifo_h264_2.mp4
Following is the output:
ffmpeg version 4.0.2-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
Input #0, ogg, from '1_a.opus':
Duration: 00:01:03.82, start: -0.020000, bitrate: 37 kb/s
Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp
Input #1, ogg, from '2_a.opus':
Duration: 00:00:52.40, start: -0.020000, bitrate: 44 kb/s
Stream #1:0: Audio: opus, 48000 Hz, stereo, fltp
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '1_v.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Duration: 00:01:03.83, start: 0.000000, bitrate: 2313 kb/s
Stream #2:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 2302 kb/s, 333 fps, 333 tbr, 10656 tbn, 666 tbc (default)
Metadata:
handler_name : VideoHandler
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from '2_v_bars.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.12.100
Duration: 00:00:52.32, start: 0.000000, bitrate: 286 kb/s
Stream #3:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 284 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream mapping:
Stream #0:0 (opus) -> amix:input0
Stream #1:0 (opus) -> adelay
Stream #2:0 (h264) -> hstack:input1
Stream #3:0 (h264) -> trim
Stream #3:0 (h264) -> concat:in1:v0
amix -> Stream #0:0 (aac)
fifo -> Stream #0:1 (libx264)
Press [q] to stop, [?] for help
[libx264 # 0x50722c0] using SAR=1/1
[libx264 # 0x50722c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle
[libx264 # 0x50722c0] profile High, level 3.1
[libx264 # 0x50722c0] 264 - core 155 r2901 7d0ff22 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - 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=3 lookahead_threads=1 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_fifo_h264_2.mp4':
Metadata:
encoder : Lavf58.12.100
Stream #0:0: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
encoder : Lavc58.18.100 aac
Stream #0:1: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1280x480 [SAR 1:1 DAR 8:3], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
encoder : Lavc58.18.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Past duration 0.924919 too large
[Parsed_concat_5 # 0x52e2e00] Buffer queue overflow, dropping.trate= 415.7kbits/s dup=0 drop=3349 speed=0.955x
Last message repeated 11 times
[Parsed_concat_5 # 0x52e2e00] Buffer queue overflow, dropping.trate= 394.0kbits/s dup=0 drop=3533 speed=0.962x
Last message repeated 11 times
[Parsed_concat_5 # 0x52e2e00] Buffer queue overflow, dropping.trate= 376.7kbits/s dup=0 drop=3698 speed=0.963x
Last message repeated 11 times
[Parsed_concat_5 # 0x52e2e00] Buffer queue overflow, dropping.trate= 362.1kbits/s dup=0 drop=3851 speed=0.96x
Last message repeated 12 times
[Parsed_concat_5 # 0x52e2e00] Buffer queue overflow, dropping.trate= 345.6kbits/s dup=0 drop=4033 speed=0.965x
Last message repeated 13 times
[Parsed_concat_5 # 0x52e2e00] Buffer queue overflow, dropping.trate= 331.0kbits/s dup=0 drop=4208 speed=0.969x
Last message repeated 12 times
[Parsed_concat_5 # 0x52e2e00] Buffer queue overflow, dropping.trate= 318.2kbits/s dup=0 drop=4381 speed=0.971x
Last message repeated 12 times
[Parsed_concat_5 # 0x52e2e00] Buffer queue overflow, dropping.trate= 305.8kbits/s dup=0 drop=4555 speed=0.974x
Last message repeated 12 times
[Parsed_concat_5 # 0x52e2e00] Buffer queue overflow, dropping.trate= 294.4kbits/s dup=0 drop=4733 speed=0.977x
Last message repeated 13 times
[Parsed_concat_5 # 0x52e2e00] Buffer queue overflow, dropping.trate= 283.7kbits/s dup=0 drop=4912 speed=0.98x
Last message repeated 12 times
[Parsed_concat_5 # 0x52e2e00] Buffer queue overflow, dropping.trate= 410.2kbits/s dup=0 drop=5094 speed=0.984x
Last message repeated 10 times
frame= 1706 fps= 26 q=-1.0 Lsize= 4924kB time=00:01:08.16 bitrate= 591.8kbits/s dup=0 drop=21053 speed=1.02x
video:3914kB audio:958kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.061062%
[aac # 0x5040040] Qavg: 22388.959
[libx264 # 0x50722c0] frame I:7 Avg QP:15.90 size: 26657
[libx264 # 0x50722c0] frame P:502 Avg QP:19.36 size: 5413
[libx264 # 0x50722c0] frame B:1197 Avg QP:23.11 size: 922
[libx264 # 0x50722c0] consecutive B-frames: 5.2% 1.9% 5.5% 87.5%
[libx264 # 0x50722c0] mb I I16..4: 26.8% 56.4% 16.7%
[libx264 # 0x50722c0] mb P I16..4: 3.0% 2.8% 0.6% P16..4: 21.6% 6.4% 3.2% 0.0% 0.0% skip:62.3%
[libx264 # 0x50722c0] mb B I16..4: 0.2% 0.1% 0.0% B16..8: 18.8% 0.9% 0.1% direct: 0.4% skip:79.5% L0:49.1% L1:48.8% BI: 2.1%
[libx264 # 0x50722c0] 8x8 transform intra:45.7% inter:70.7%
[libx264 # 0x50722c0] coded y,uvDC,uvAC intra: 39.5% 57.5% 22.6% inter: 4.2% 6.4% 0.2%
[libx264 # 0x50722c0] i16 v,h,dc,p: 22% 31% 19% 28%
[libx264 # 0x50722c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 23% 38% 2% 2% 2% 2% 3% 2%
[libx264 # 0x50722c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 35% 29% 21% 2% 3% 4% 2% 3% 1%
[libx264 # 0x50722c0] i8c dc,h,v,p: 55% 23% 18% 5%
[libx264 # 0x50722c0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x50722c0] ref P L0: 65.6% 12.4% 16.1% 5.9%
[libx264 # 0x50722c0] ref B L0: 85.0% 12.2% 2.7%
[libx264 # 0x50722c0] ref B L1: 95.4% 4.6%
[libx264 # 0x50722c0] kb/s:469.82
The FIFOs should be inserted for inputs whose use will be delayed.
So, the command should be
ffmpeg -i 1_a.opus -i 2_a.opus -i 1_v.mp4 -i 2_v_bars.mp4 -filter_complex \
"[1:a]adelay=15720|15720[a1]; [0:a][a1]amix;\
[3:v]trim=0:15.81,geq=0:128:128[silence];[3:v]fifo[3v];[silence][3v]concat[3_v_silence];\
[3_v_silence][2:v]hstack" -vcodec libx264 -y out_fifo_h264_2.mp4
You're using v4.0.2 so -strict is not needed.

Add black video to video with sound

I'm trying to insert 13 seconds of black video at the start of a video that has sound using ffmpeg like so:
ffmpeg -f lavfi -i "color=c=black:s=720x406:r=25:sar=1/1" -i input.mp4 -filter_complex \
"[0:v] trim=end=13,setpts=PTS-STARTPTS [blackstart]; \
[blackstart] [1:v] concat=n=2:v=1:a=0[out]" \
-map "[out]" -c:a copy output.mp4
However the sound is not being maintained. What am I doing incorrectly? -c:a copy does not seem to work should I be using a [1:a] somewhere?
garrett-retina:~ garrett-macbookretina$ ffmpeg -f lavfi -i "color=c=red:s=720x406:r=25:sar=1/1" -i input.mp4 -filter_complex \
> "[0:v] trim=end=13,setpts=PTS-STARTPTS [blackstart]; \
> [blackstart] [1:v] concat=n=2:v=1:a=0[out]" \
> -map "[out]" -c:a copy output.mp4
ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.2.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libavresample 3. 1. 0 / 3. 1. 0
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
Input #0, lavfi, from 'color=c=red:s=720x406:r=25:sar=1/1':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x406 [SAR 1:1 DAR 360:203], 25 tbr, 25 tbn, 25 tbc
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.56.100
Duration: 33:59:47.32, start: 0.000000, bitrate: 179 kb/s
Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x406 [SAR 1:1 DAR 360:203], 62 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, stereo, fltp, 114 kb/s (default)
Metadata:
handler_name : SoundHandler
[libx264 # 0x7fa344048400] using SAR=1/1
[libx264 # 0x7fa344048400] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 # 0x7fa344048400] profile High, level 3.0
[libx264 # 0x7fa344048400] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - 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 '/Users/garrett-macbookretina/Desktop/Best of Luck With the Wall/exports/test.mp4':
Metadata:
encoder : Lavf57.56.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 720x406 [SAR 1:1 DAR 360:203], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
encoder : Lavc57.64.101 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream mapping:
Stream #0:0 (rawvideo) -> trim
Stream #1:0 (h264) -> concat:in1:v0
concat -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
frame=3060008 fps=432 q=-1.0 Lsize= 957795kB time=34:00:00.20 bitrate= 64.1kbits/s speed=17.3x
video:921972kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.885564%
[libx264 # 0x7fa344048400] frame I:16585 Avg QP:13.67 size: 49743
[libx264 # 0x7fa344048400] frame P:770518 Avg QP:16.48 size: 91
[libx264 # 0x7fa344048400] frame B:2272905 Avg QP:25.11 size: 22
[libx264 # 0x7fa344048400] consecutive B-frames: 0.9% 0.1% 0.4% 98.6%
[libx264 # 0x7fa344048400] mb I I16..4: 10.2% 39.7% 50.1%
[libx264 # 0x7fa344048400] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.7% 0.0% 0.0% 0.0% 0.0% skip:99.1%
[libx264 # 0x7fa344048400] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.2% 0.0% 0.0% direct: 0.0% skip:99.8% L0:46.9% L1:53.1% BI: 0.1%
[libx264 # 0x7fa344048400] 8x8 transform intra:39.9% inter:52.0%
[libx264 # 0x7fa344048400] coded y,uvDC,uvAC intra: 86.1% 77.1% 60.4% inter: 0.0% 0.1% 0.0%
[libx264 # 0x7fa344048400] i16 v,h,dc,p: 66% 10% 13% 11%
[libx264 # 0x7fa344048400] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 20% 14% 6% 7% 7% 7% 7% 11%
[libx264 # 0x7fa344048400] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 19% 11% 7% 9% 8% 8% 7% 9%
[libx264 # 0x7fa344048400] i8c dc,h,v,p: 59% 19% 17% 5%
[libx264 # 0x7fa344048400] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x7fa344048400] ref P L0: 53.9% 4.0% 16.6% 25.5% 0.0%
[libx264 # 0x7fa344048400] ref B L0: 27.9% 71.6% 0.5%
[libx264 # 0x7fa344048400] ref B L1: 97.6% 2.4%
[libx264 # 0x7fa344048400] kb/s:61.71
garrett-retina:~ garrett-macbookretina$
You need to add silent audio as well. One method using anullsrc:
ffmpeg \
-f lavfi -i "color=c=black:s=720x406:r=25:sar=1/1:d=13" \
-f lavfi -t 1 -i anullsrc=cl=stereo:r=16000 \
-i input.mp4 \
-filter_complex \
"[2:v]setpts=PTS-STARTPTS[video]; \
[0:v][1:a][video][2:a]concat=n=2:v=1:a=1[v][a]" \
-map "[v]" -map "[a]" output.mp4
The silent audio duration only needs to be shorter than the black video duration; the concat filter will pad the rest automatically.
I'm unable to test this example at the moment, but if it is broken let me know and I can fix it later.

FFMPEG - Concatenate 2 MP4 Files, one has video and audio and the other has only audio

I am trying to merge 2 mp4 files using FFMPEG. One of these files has both video and audio (track1.mp4), while the other one has only audio (track2.mp4). The names of these files are listed in a text file called 'filesToMerge.txt' in the following manner:
file 'track1.mp4'
file 'track2.mp4'
I then execute the following ffmpeg command to merge them.
ffmpeg -f concat -i filesToMerge.txt -c copy output.mp4
However, the concatenated file that is generated consists of only the first file that is listed in filesToMerge.txt. That is, if track1.mp4 (which has both video and audio) is the first file in the list, then only that file makes up output.mp4 (the concatenated file produced) and vice versa.
I would like for both files to be in output.mp4. I am using Ubuntu 14.04 (if that helps). How can I solve this problem?
When I run this command
ffmpeg -i track1.mp4 -i track2.mp4 output.mp4
I get the following
ffmpeg version N-76944-g15206ff Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libdcadec --enable-libfreetype --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
libavutil 55. 9.100 / 55. 9.100
libavcodec 57. 16.101 / 57. 16.101
libavformat 57. 19.100 / 57. 19.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 17.100 / 6. 17.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'track1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Duration: 00:00:10.76, start: 0.023220, bitrate: 351 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x400 [SAR 400:533 DAR 800:533], 181 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'track2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
creation_time : 1970-01-01 00:00:00
encoder : Lavf52.32.0
Duration: 00:00:32.21, start: 0.000000, bitrate: 46 kb/s
Stream #1:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 43 kb/s (default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : SoundHandler
[libx264 # 0x3950ce0] using SAR=400/533
[libx264 # 0x3950ce0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
[libx264 # 0x3950ce0] profile High, level 3.0
[libx264 # 0x3950ce0] 264 - core 142 r2491 24e4fed - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - 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=1 lookahead_threads=1 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 'output.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.19.100
Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 800x400 [SAR 400:533 DAR 800:533], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc57.16.101 libx264
Stream #0:1(und): Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc57.16.101 libfdk_aac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
frame= 270 fps= 99 q=28.0 Lsize= 382kB time=00:00:10.72 bitrate= 291.9kbits/s dup=1 drop=0
video:230kB audio:143kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.482656%
[libx264 # 0x3950ce0] frame I:2 Avg QP:18.87 size:109452
[libx264 # 0x3950ce0] frame P:68 Avg QP:15.09 size: 171
[libx264 # 0x3950ce0] frame B:200 Avg QP:23.33 size: 23
[libx264 # 0x3950ce0] consecutive B-frames: 1.1% 0.0% 1.1% 97.8%
[libx264 # 0x3950ce0] mb I I16..4: 11.0% 39.6% 49.5%
[libx264 # 0x3950ce0] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 5.9% 0.1% 0.0% 0.0% 0.0% skip:93.9%
[libx264 # 0x3950ce0] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.3% 0.0% 0.0% direct: 0.0% skip:99.7% L0:21.8% L1:78.2% BI: 0.0%
[libx264 # 0x3950ce0] 8x8 transform intra:39.7% inter:92.8%
[libx264 # 0x3950ce0] coded y,uvDC,uvAC intra: 92.0% 95.0% 73.2% inter: 0.1% 1.4% 0.0%
[libx264 # 0x3950ce0] i16 v,h,dc,p: 1% 30% 4% 66%
[libx264 # 0x3950ce0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 6% 55% 16% 2% 4% 2% 8% 2% 6%
[libx264 # 0x3950ce0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 18% 13% 7% 9% 7% 12% 6% 11%
[libx264 # 0x3950ce0] i8c dc,h,v,p: 44% 35% 10% 11%
[libx264 # 0x3950ce0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x3950ce0] ref P L0: 98.1% 0.2% 1.1% 0.5%
[libx264 # 0x3950ce0] ref B L0: 85.1% 13.2% 1.7%
[libx264 # 0x3950ce0] ref B L1: 93.6% 6.4%
[libx264 # 0x3950ce0] kb/s:174.10
So if I'm understanding correctly, you want the final outputted video file to play track1.mp4, which will have video and audio, and then track2.mp4, which will have only audio and display nothing? The following answer assumes this is your desired output.
I tried several solutions, namely splitting the audio from the video and concatenating the audios first, then remerging, and generating a black video to go with the track2.mp4. I couldn't convince either to work. The final solution I found that DID work well is a bash script on the ffmpeg wiki's Concatenate page.
The steps are very straightforward. Copy the bash script into a file named "mmcat" in the same directory as track1/2.mp4. Then run
chmod +x mmcat && ./mmcat track1.mp4 track2.mp4 final.mp4
You should now have your desired file in final.mp4.
Note that this method does involve some transcoding, so you will theoretically lose some quality in doing so. Based on my experimentations, I don't believe this is avoidable since stream copying is only supported if the codecs exactly match, and you don't appear to be in that situation (your audio files have different bitrates, sample rates, etc).
Also note that whatever is in the final frame of video from track1 will be displayed, frozen, for the duration of track2. If you want it to go to black, you'd better make sure your final frame in track1 is a black frame. Doing so has been left as an exercise for OP.

Two nearly identical ffmpeg commands, one works, the other freezes up

In both of these examples, I'm passing two inputs to ffmpeg applying a filter to the first input, and outputting it all to a .mp4.
Example 1
ffmpeg -y -threads 4 -ss 23.536 -t 44.854 -i .tmp/processing/vid-one.webm -ss 13.516 -t 54.874 -i .tmp/processing/vid-two.webm -filter_complex "[0]scale=320:-1,pad=2*iw:2*ih:0:120[left];[1]scale=320:-1[right];[left][right]overlay=main_w/2:120,scale=640:480" -shortest .tmp/processing/temp-23536-68390.mp4
Example 2
ffmpeg -y -threads 4 -ss 68.39 -t 3.646 -i .tmp/processing/vid-one.webm -ss 58.37 -t 13.666 -i .tmp/processing/vid-two.webm -filter_complex "[0]scale=320:-1,pad=2*iw:2*ih:0:120[left];[1]scale=320:-1[right];[left][right]overlay=main_w/2:120,scale=640:480" -shortest .tmp/processing/temp-68390-72036.mp4
In the logging output I can get an idea of where it gets hung up.
Output Example 1
the output gets to this frame= line and it updates the output like this
ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.7.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --enable-opencl --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 36.100 / 56. 36.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, matroska,webm, from '.tmp/processing/vid-one.webm':
Metadata:
encoder : libwebm-0.2.1.0
creation_time : 2015-09-27 18:54:09
Duration: 00:01:10.35, start: 0.000000, bitrate: 45 kb/s
Stream #0:0(eng): Audio: opus, 48000 Hz, mono, fltp (default)
Stream #0:1(eng): Video: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 1k tbr, 1k tbn, 1k tbc (default)
Input #1, matroska,webm, from '.tmp/processing/vid-two.webm':
Metadata:
encoder : libwebm-0.2.1.0
creation_time : 2015-09-27 18:54:19
Duration: 00:00:59.58, start: 0.000000, bitrate: 356 kb/s
Stream #1:0(eng): Audio: opus, 48000 Hz, mono, fltp (default)
Stream #1:1(eng): Video: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 1k tbr, 1k tbn, 1k tbc (default)
[libx264 # 0x7faa59843e00] using SAR=1/1
[libx264 # 0x7faa59843e00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 # 0x7faa59843e00] profile High, level 5.2
[libx264 # 0x7faa59843e00] 264 - core 144 r2533 c8a773e - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - 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=6 lookahead_threads=1 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 '.tmp/processing/temp-23536-68390.mp4':
Metadata:
encoder : Lavf56.36.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 1k fps, 16k tbn, 1k tbc (default)
Metadata:
encoder : Lavc56.41.100 libx264
Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 Hz, mono, s16, 128 kb/s (default)
Metadata:
encoder : Lavc56.41.100 libvo_aacenc
Stream mapping:
Stream #0:1 (vp8) -> scale (graph 0)
Stream #1:1 (vp8) -> scale (graph 0)
scale (graph 0) -> Stream #0:0 (libx264)
Stream #0:0 -> #0:1 (opus (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help
Input stream #0:1 frame changed from size:640x480 fmt:yuv420p to size:320x240 fmt:yuv420p
Input stream #1:1 frame changed from size:640x480 fmt:yuv420p to size:1016x846 fmt:yuv420p
frame=13321 fps=268 q=33.0 size= 1321kB time=00:00:41.85 bitrate= 258.5kbits/s dup=13frame=25895 fps=258 q=33.0 size= 2268kB time=00:00:44.81 bitrate= 414.5kbits/s dup=25frame=35230 fps=244 q=33.0 size= 2936kB time=00:00:44.81 bitrate= 536.6kbits/s dup=35frame=41866 fps=231 q=33.0 size= 3552kB time=00:00:44.81 bitrate= 649.4kbits/s dup=41Past duration 0.999992 too large
frame=41868 fps=231 q=-1.0 Lsize= 4089kB time=00:00:44.85 bitrate= 746.8kbits/s dup=41862 drop=20
video:3108kB audio:479kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 13.986680%
[libx264 # 0x7faa59843e00] frame I:168 Avg QP:18.70 size: 12936
[libx264 # 0x7faa59843e00] frame P:10552 Avg QP:14.49 size: 37
[libx264 # 0x7faa59843e00] frame B:31148 Avg QP:17.67 size: 20
[libx264 # 0x7faa59843e00] consecutive B-frames: 0.8% 0.0% 0.0% 99.2%
[libx264 # 0x7faa59843e00] mb I I16..4: 40.0% 39.7% 20.3%
[libx264 # 0x7faa59843e00] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.2% 0.0% 0.0% 0.0% 0.0% skip:99.7%
[libx264 # 0x7faa59843e00] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.0% 0.0% 0.0% direct: 0.0% skip:100.0% L0: 7.4% L1:92.6% BI: 0.0%
[libx264 # 0x7faa59843e00] 8x8 transform intra:39.8% inter:54.0%
[libx264 # 0x7faa59843e00] coded y,uvDC,uvAC intra: 31.6% 26.7% 16.9% inter: 0.0% 0.1% 0.0%
[libx264 # 0x7faa59843e00] i16 v,h,dc,p: 68% 22% 9% 1%
[libx264 # 0x7faa59843e00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 45% 14% 1% 3% 5% 2% 5% 3%
[libx264 # 0x7faa59843e00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 47% 10% 1% 2% 2% 3% 2% 3%
[libx264 # 0x7faa59843e00] i8c dc,h,v,p: 73% 13% 12% 2%
[libx264 # 0x7faa59843e00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x7faa59843e00] ref P L0: 99.3% 0.4% 0.1% 0.2%
[libx264 # 0x7faa59843e00] ref B L0: 68.7% 31.3%
[libx264 # 0x7faa59843e00] ref B L1: 99.3% 0.7%
[libx264 # 0x7faa59843e00] kb/s:608.06
Output Example 2
When it gets to the frame= line, it hangs
ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.7.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --enable-opencl --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 36.100 / 56. 36.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, matroska,webm, from '.tmp/processing/vid-one.webm':
Metadata:
encoder : libwebm-0.2.1.0
creation_time : 2015-09-27 18:54:09
Duration: 00:01:10.35, start: 0.000000, bitrate: 45 kb/s
Stream #0:0(eng): Audio: opus, 48000 Hz, mono, fltp (default)
Stream #0:1(eng): Video: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 1k tbr, 1k tbn, 1k tbc (default)
Input #1, matroska,webm, from '.tmp/processing/vid-two.webm':
Metadata:
encoder : libwebm-0.2.1.0
creation_time : 2015-09-27 18:54:19
Duration: 00:00:59.58, start: 0.000000, bitrate: 356 kb/s
Stream #1:0(eng): Audio: opus, 48000 Hz, mono, fltp (default)
Stream #1:1(eng): Video: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 1k tbr, 1k tbn, 1k tbc (default)
[libx264 # 0x7fdb4a802600] using SAR=1/1
[libx264 # 0x7fdb4a802600] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 # 0x7fdb4a802600] profile High, level 5.2
[libx264 # 0x7fdb4a802600] 264 - core 144 r2533 c8a773e - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - 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=6 lookahead_threads=1 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 '.tmp/processing/temp-68390-72036.mp4':
Metadata:
encoder : Lavf56.36.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 1k fps, 16k tbn, 1k tbc (default)
Metadata:
encoder : Lavc56.41.100 libx264
Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 Hz, mono, s16, 128 kb/s (default)
Metadata:
encoder : Lavc56.41.100 libvo_aacenc
Stream mapping:
Stream #0:1 (vp8) -> scale (graph 0)
Stream #1:1 (vp8) -> scale (graph 0)
scale (graph 0) -> Stream #0:0 (libx264)
Stream #0:0 -> #0:1 (opus (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help
Input stream #0:1 frame changed from size:640x480 fmt:yuv420p to size:320x240 fmt:yuv420p
Input stream #1:1 frame changed from size:640x480 fmt:yuv420p to size:1016x846 fmt:yuv420p
frame= 0 fps=0.0 q=0.0 Lsize= 17kB time=00:00:01.97 bitrate= 71.8kbits/s
version: ffmpeg version 2.7.2
This problem comes from frame size changing: "Input stream #0:1 frame changed from size:640x480 fmt:yuv420p to size:320x240 fmt:yuv420p"
Scale your input video to the same size first, then do the overlay stuff.

Resources