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

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.

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

Video becomes choppy when the order in the hstack filter is changed

I have a FFmpeg command wherein I am merging 2 videos side by side using hstack filter. When I place first video on the right hand side and second video on the left hand side, the final merged video is perfect in quality and plays smoothly.
However, when I swap the order in hstack filter, the final video is very choppy.
Can someone please let me know the issue in this command? Many thanks in advance.
Also, the file size of the non working file is almost double than that of working file. Can you explain why?
Here is the working command:
ffmpeg -i 1_a.opus -i 2_a.opus -itsoffset 0.024 -i 1_v.mp4 -itsoffset 0.113 -i 2_v.mp4 -filter_complex "[1:a]adelay=15646|15646[a1]; [0:a][a1]amix; [3:v]trim=0:15.646,geq=0:128:128[silence]; [3:v]fifo[3v]; [silence][3v]concat[3_v_silence]; [3_v_silence][2:v]hstack" -preset ultrafast -y n_m_bars_try2.mp4
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 : Lavf58.12.100
Duration: 00:01:03.85, start: 0.000000, bitrate: 2644 kb/s
Stream #2:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 2633 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.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.12.100
Duration: 00:00:52.32, start: 0.000000, bitrate: 861 kb/s
Stream #3:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 860 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) -> fifo
amix -> Stream #0:0 (aac)
hstack -> Stream #0:1 (libx264)
Press [q] to stop, [?] for help
[libx264 # 0x528d600] using SAR=1/1
[libx264 # 0x528d600] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle
[libx264 # 0x528d600] profile Constrained Baseline, level 3.1
[libx264 # 0x528d600] 264 - core 155 r2901 7d0ff22 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to 'navid_mayank_bars_try2.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
frame= 1704 fps= 42 q=-1.0 Lsize= 14440kB time=00:01:08.12 bitrate=1736.5kbits/s dup=3 drop=21229 speed=1.69x
video:13448kB audio:953kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.269503%
[aac # 0x52b8680] Qavg: 22255.799
[libx264 # 0x528d600] frame I:7 Avg QP:16.29 size: 46284
[libx264 # 0x528d600] frame P:1697 Avg QP:18.36 size: 7924
[libx264 # 0x528d600] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 # 0x528d600] mb P I16..4: 1.8% 0.0% 0.0% P16..4: 31.0% 0.0% 0.0% 0.0% 0.0% skip:67.2%
[libx264 # 0x528d600] coded y,uvDC,uvAC intra: 29.9% 59.3% 17.5% inter: 13.4% 24.6% 0.8%
[libx264 # 0x528d600] i16 v,h,dc,p: 36% 29% 18% 17%
[libx264 # 0x528d600] i8c dc,h,v,p: 42% 25% 21% 11%
[libx264 # 0x528d600] kb/s:1616.23
Non working command:
ffmpeg -i 1_a.opus -i 2_a.opus -itsoffset 0.024 -i 1_v.mp4 -itsoffset 0.113 -i 2_v.mp4 -filter_complex "[1:a]adelay=15646|15646[a1]; [0:a][a1]amix; [3:v]trim=0:15.646,geq=0:128:128[silence]; [3:v]fifo[3v]; [silence][3v]concat[3_v_silence]; [2:v][3_v_silence]hstack" -preset ultrafast -y m_n_bars_try2.mp4
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 : Lavf58.12.100
Duration: 00:01:03.85, start: 0.000000, bitrate: 2644 kb/s
Stream #2:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 2633 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.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.12.100
Duration: 00:00:52.32, start: 0.000000, bitrate: 861 kb/s
Stream #3:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 860 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:input0
Stream #3:0 (h264) -> trim
Stream #3:0 (h264) -> fifo
amix -> Stream #0:0 (aac)
hstack -> Stream #0:1 (libx264)
Press [q] to stop, [?] for help
[libx264 # 0x6d21600] using SAR=1/1
[libx264 # 0x6d21600] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle
[libx264 # 0x6d21600] profile Constrained Baseline, level 5.1
[libx264 # 0x6d21600] 264 - core 155 r2901 7d0ff22 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to 'mayank_navid_bars_try2.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, 333 fps, 10656 tbn, 333 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.999992 too large
Last message repeated 12 times
More than 1000 frames duplicated 33280kB time=00:01:08.03 bitrate=4007.4kbits/s dup=982 drop=1590 speed=0.536x
frame=22679 fps=177 q=-1.0 Lsize= 33892kB time=00:01:08.10 bitrate=4076.9kbits/s dup=1339 drop=1590 speed=0.531x
video:32804kB audio:953kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.401324%
[aac # 0x6d4c680] Qavg: 22255.799
[libx264 # 0x6d21600] frame I:91 Avg QP:15.31 size: 51639
[libx264 # 0x6d21600] frame P:22588 Avg QP:18.24 size: 1279
[libx264 # 0x6d21600] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 # 0x6d21600] mb P I16..4: 0.2% 0.0% 0.0% P16..4: 13.0% 0.0% 0.0% 0.0% 0.0% skip:86.8%
[libx264 # 0x6d21600] coded y,uvDC,uvAC intra: 44.9% 54.0% 29.9% inter: 2.0% 10.9% 0.1%
[libx264 # 0x6d21600] i16 v,h,dc,p: 45% 24% 13% 18%
[libx264 # 0x6d21600] i8c dc,h,v,p: 51% 20% 18% 11%
[libx264 # 0x6d21600] kb/s:3945.79
One of your videos is 333 fps and the other is 25. The order in which you apply them affects the frame rate of the output file. 25 is much easier to output than 333. Try adding '-r pal' just before declaring your output file.

Segment duration variation is higher than the +/- 50% allowed by DASH-IF

I am implement a proof of concept page with video player that uses DASH. I am having a difficult time getting the video right and I am not sure whether this is an encoding issue or MP4Box issue.
Since I am working on Ubuntu I had to change a few parameters for ffmpeg, but according to what I read this should be fine:
~/ffmpeg/ffmpeg -c:a aac -ar 44100 -ac 1 -codec:v libx264 \
-profile:v baseline -level 13 -b:v 2000k video_transcoded.mp4 -i video.mp4
Then to create the MPD I am running this:
MP4Box -dash 10000 -dash-profile live \
-segment-name video_transcoded video_transcoded.mp4
I am getting this response at the end, which might be why no player will play my video:
[DASH] two languages in adaptation set: und will be kept eng will be ignored
DASHing file video_transcoded.mp4
[DASH]: Segment duration variation is higher than the +/- 50% allowed by DASH-IF (min 1.044, max 10.448) - please reconsider encoding
Here is the output of ffmpeg:
ffmpeg version N-53477-g689211d-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.1 (Debian 5.3.1-10) 20160224
configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --enable-librtmp --enable-libmfx --cc=gcc
libavutil 55. 19.100 / 55. 19.100
libavcodec 57. 28.100 / 57. 28.100
libavformat 57. 28.100 / 57. 28.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 39.102 / 6. 39.102
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 'gladiator.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isomavc1
creation_time : 2013-02-12 19:14:56
Duration: 02:50:56.98, start: 0.000000, bitrate: 923 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x544 [SAR 1:1 DAR 40:17], 823 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
Metadata:
creation_time : 2013-02-12 19:14:56
handler_name : 2000.Extended.Remastered.720p.BluRay.x264-HDEVO.mkv.264#trackID=1:fps=23.976#GPAC0.5.1-DEV-rev4283
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 95 kb/s (default)
Metadata:
creation_time : 2013-02-12 15:32:26
handler_name : Sound Media Handler
[libx264 # 0xaf12920] using SAR=1/1
[libx264 # 0xaf12920] frame MB size (80x34) > level limit (396)
[libx264 # 0xaf12920] DPB size (3 frames, 8160 mbs) > level limit (0 frames, 2376 mbs)
[libx264 # 0xaf12920] MB rate (65214) > level limit (11880)
[libx264 # 0xaf12920] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 # 0xaf12920] profile Constrained Baseline, level 1.3
[libx264 # 0xaf12920] 264 - core 148 r236 a01e339 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 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=0 weightp=0 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=2000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'gladiator2.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isomavc1
encoder : Lavf57.28.100
Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x544 [SAR 1:1 DAR 40:17], q=-1--1, 2000 kb/s, 23.98 fps, 24k tbn, 23.98 tbc (default)
Metadata:
creation_time : 2013-02-12 19:14:56
handler_name : 2000.Extended.Remastered.720p.BluRay.x264-HDEVO.mkv.264#trackID=1:fps=23.976#GPAC0.5.1-DEV-rev4283
encoder : Lavc57.28.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 0 vbv_delay: -1
Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, mono, fltp, 69 kb/s (default)
Metadata:
creation_time : 2013-02-12 15:32:26
handler_name : Sound Media Handler
encoder : Lavc57.28.100 aac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
After transcoding is completed I get this:
frame= 132 fps= 15 q=25.0 Lsize= 1112kB time=00:00:05.31 bitrate=1713.0kbits/s speed=0.603x
video:1062kB audio:45kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.414602%
[libx264 # 0xab63de0] frame I:1 Avg QP:21.29 size:121187
[libx264 # 0xab63de0] frame P:131 Avg QP:23.40 size: 7372
[libx264 # 0xab63de0] mb I I16..4: 9.2% 0.0% 90.8%
[libx264 # 0xab63de0] mb P I16..4: 0.9% 0.0% 0.3% P16..4: 37.2% 7.0% 1.8% 0.0% 0.0% skip:52.7%
[libx264 # 0xab63de0] final ratefactor: 21.58
[libx264 # 0xab63de0] coded y,uvDC,uvAC intra: 48.8% 72.2% 30.7% inter: 8.9% 14.6% 0.8%
[libx264 # 0xab63de0] i16 v,h,dc,p: 28% 33% 18% 21%
[libx264 # 0xab63de0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 16% 15% 8% 7% 8% 6% 12% 6%
[libx264 # 0xab63de0] i8c dc,h,v,p: 52% 21% 19% 8%
[libx264 # 0xab63de0] ref P L0: 92.9% 5.2% 1.8%
[libx264 # 0xab63de0] kb/s:1646.80
[aac # 0xab64c40] Qavg: 112.650
What can I do to make this work?

How to deal with "Buffer queue overflow, dropping." (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.

correctly escaping text in drawtext filter

According to documentation %{}:, should be escaped with slash. But when I escape % the text is not added. There's error message saying Stray % near ')'. But what does it mean and how I can fix it? Command and output:
$ /usr/bin/ffmpeg -y -i /home/www/255871.mov -af 'aresample=async=1:min_hard_comp=0.100000' -vf 'scale=480:trunc(ow/a/2)*2,transpose=1 [in];movie=watermarks/text-box440.mov,scale=320:55 [bg];[in][bg] overlay=x=20:y=main_h-80,drawtext=fontsize=20:fix_bounds=1:fontfile=Helvetica\\:Style=bold:fontcolor=0xe6b300:text=small kitten \%\):x=30:y=h-80+ascent/2:draw=gte(t\,0)\;lt(t\,5) [out]' -pix_fmt yuv420p -r 24.39 -map_metadata -1 -movflags +faststart -f mp4 -vcodec libx264 -b:v 800k -maxrate 1100k -bufsize 2M -bt 256k -profile:vbaseline -acodec libfdk_aac -ab 64k -ar 44100 -ac 1 /tmp/kitten.mp4
ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 15 2013 18:40:14 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
configuration: --enable-gpl --enable-libmp3lame --enable-libvo-aacenc --enable-libx264 --enable-version3 --enable-pthreads --enable-libfaac --enable-nonfree --enable-libfdk_a
ac --enable-fontconfig --enable-libfreetype
libavutil 52. 18.100 / 52. 18.100
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.104 / 54. 63.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 42.103 / 3. 42.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/www/255871.mov':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2012-07-17 07:42:35
model : iPhone 3GS
model-rus : iPhone 3GS
encoder : 4.2.1
encoder-rus : 4.2.1
date : 2012-07-17T10:42:35+0300
date-rus : 2012-07-17T10:42:35+0300
make : Apple
make-rus : Apple
Duration: 00:00:09.38, start: 0.000000, bitrate: 790 kb/s
Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 480x360, 720 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc
Metadata:
rotate : 90
creation_time : 2012-07-17 07:42:35
handler_name : Core Media Data Handler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 63 kb/s
Metadata:
creation_time : 2012-07-17 07:42:35
handler_name : Core Media Data Handler
[Parsed_drawtext_5 # 0x2ae9b00] Using "/usr/share/fonts/default/Type1/n019003l.pfb"
[libx264 # 0x2ae7d40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 # 0x2ae7d40] profile Constrained Baseline, level 2.1
[libx264 # 0x2ae7d40] 264 - core 130 r2274 c832fe9 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 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=0 weightp=0 keyint=250 keyint_min=24 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=800 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1100 vbv_bufsize=2000 nal_hrd=none ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/tmp/kitten.mp4':
Metadata:
encoder : Lavf54.63.104
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 360x480, q=-1--1, 800 kb/s, 19512 tbn, 24.39 tbc
Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, mono, s16, 64 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> libx264)
Stream #0:1 -> #0:1 (aac -> libfdk_aac)
Press [q] to stop, [?] for help
[Parsed_drawtext_5 # 0x2ae9b00] Stray % near ')'
Last message repeated 201 times
Stray % near ')'0.0 q=27.0 size= 480kB time=00:00:07.96 bitrate= 493.4kbits/s dup=0 drop=35
[Parsed_drawtext_5 # 0x2ae9b00] Stray % near ')'
Last message repeated 77 times
Starting second pass: moving header on top of the file
frame= 231 fps=0.0 q=-1.0 Lsize= 1002kB time=00:00:09.47 bitrate= 866.6kbits/s dup=0 drop=50
video:921kB audio:74kB subtitle:0 global headers:0kB muxing overhead 0.680957%
[libx264 # 0x2ae7d40] frame I:1 Avg QP:24.43 size: 13264
[libx264 # 0x2ae7d40] frame P:230 Avg QP:23.72 size: 4041
[libx264 # 0x2ae7d40] mb I I16..4: 24.8% 0.0% 75.2%
[libx264 # 0x2ae7d40] mb P I16..4: 2.3% 0.0% 4.8% P16..4: 34.4% 28.8% 9.4% 0.0% 0.0% skip:20.3%
[libx264 # 0x2ae7d40] coded y,uvDC,uvAC intra: 62.5% 54.2% 4.4% inter: 19.6% 20.3% 0.1%
[libx264 # 0x2ae7d40] i16 v,h,dc,p: 36% 29% 19% 16%
[libx264 # 0x2ae7d40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 21% 20% 6% 8% 7% 7% 6% 6%
[libx264 # 0x2ae7d40] i8c dc,h,v,p: 65% 15% 17% 3%
[libx264 # 0x2ae7d40] ref P L0: 93.4% 4.3% 2.3%
[libx264 # 0x2ae7d40] kb/s:796.32
Found the solution. The reason of this error is that ffmpeg tries to expand text with % to function as stated in documentation:
Sequence of the form %{...} are expanded. The text between the braces
is a function name, possibly followed by arguments separated by ’:’.
If the arguments contain special characters or delimiters (’:’ or
’}’), they should be escaped.
So simply adding expansion=none to filter configuration solves the issue.

Resources