ffmpeg keep framerate as source - ffmpeg

I am trying to use ffmpeg to overlay a video on a backgroud image. But the output video has different framerate(25) and length compared to the source video, I guess this is causing the tiny out-of-sync between video and audio in the output. How can I tune the command to keep the framerate same as source?
ffmpeg -i crop.mp4
ffmpeg version 4.3.1-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --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-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
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
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'crop.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.76.100
Duration: 00:02:26.10, start: 0.000000, bitrate: 1378 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1080x810, 1240 kb/s, 31.25 fps, 31.25 tbr, 16k tbn, 62.50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
Here is the command
/data/ffmpeg-4.4-amd64-static/ffmpeg -i background_image_crop.png -i crop.mp4 -filter_complex "[0:v][1:v]overlay=x=0:y=H/2-h/2" -c:a copy output.mp4
ffmpeg version 4.4-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --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-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Input #0, png_pipe, from 'background_image_crop.png':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: png, rgb24(pc), 1080x1920, 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'crop.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.76.100
Duration: 00:02:26.10, start: 0.000000, bitrate: 1378 kb/s
Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1080x810, 1240 kb/s, 31.25 fps, 31.25 tbr, 16k tbn, 62.50 tbc (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream mapping:
Stream #0:0 (png) -> overlay:main
Stream #1:0 (h264) -> overlay:overlay
overlay -> Stream #0:0 (libx264)
Stream #1:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[libx264 # 0x57da140] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 0x57da140] profile High, level 4.0, 4:2:0, 8-bit
[libx264 # 0x57da140] 264 - core 161 r3048 b86ae3c - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - 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=60 lookahead_threads=10 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:
encoder : Lavf58.76.100
Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, progressive), 1080x1920, q=2-31, 25 fps, 12800 tbn (default)
Metadata:
encoder : Lavc58.134.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
frame= 3653 fps= 96 q=-1.0 Lsize= 24563kB time=00:02:26.07 bitrate=1377.5kbits/s dup=0 drop=911 speed=3.85x
video:22143kB audio:2299kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.492343%
[libx264 # 0x57da140] frame I:16 Avg QP:14.36 size:125240
[libx264 # 0x57da140] frame P:989 Avg QP:17.65 size: 13266
[libx264 # 0x57da140] frame B:2648 Avg QP:25.21 size: 2851
[libx264 # 0x57da140] consecutive B-frames: 1.1% 4.3% 7.6% 87.1%
[libx264 # 0x57da140] mb I I16..4: 11.1% 72.4% 16.4%
[libx264 # 0x57da140] mb P I16..4: 2.6% 7.4% 0.6% P16..4: 14.9% 4.4% 2.3% 0.0% 0.0% skip:67.9%
[libx264 # 0x57da140] mb B I16..4: 0.3% 0.6% 0.0% B16..8: 13.8% 1.0% 0.1% direct: 0.4% skip:83.8% L0:43.9% L1:53.9% BI: 2.2%
[libx264 # 0x57da140] 8x8 transform intra:69.0% inter:87.7%
[libx264 # 0x57da140] coded y,uvDC,uvAC intra: 39.2% 62.5% 18.5% inter: 2.7% 4.8% 0.0%
[libx264 # 0x57da140] i16 v,h,dc,p: 33% 27% 8% 32%
[libx264 # 0x57da140] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 19% 21% 4% 5% 5% 4% 5% 3%
[libx264 # 0x57da140] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 20% 10% 5% 8% 8% 6% 6% 3%
[libx264 # 0x57da140] i8c dc,h,v,p: 49% 19% 25% 7%
[libx264 # 0x57da140] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x57da140] ref P L0: 66.6% 10.3% 18.0% 5.1%
[libx264 # 0x57da140] ref B L0: 91.4% 7.2% 1.4%
[libx264 # 0x57da140] ref B L1: 96.8% 3.2%
[libx264 # 0x57da140] kb/s:1241.39

For your example is 31.25 fps, Richard use parameter -r for fps value in the start of code, like this
ffmpeg -r 31.25 -i background_image_crop.png -i crop.mp4 -filter_complex "[0:v][1:v]overlay=x=0:y=H/2-h/2" -c:a copy -preset ultrafast -movflags -faststart output.mp4
(I add -movflags -faststart for the video charge fast, and preset ultrafast to do all fast, only for this example)
I has probed this example getting the next data:
ffmpeg -i output.mp4
Duration: 00:06:33.39, start: 0.000000, bitrate: 1523 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 1421 kb/s, 31.25 fps, 31.25 tbr, 16k tbn, 62.50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (default)
Metadata:
handler_name : SoundHandler

Related

Overlaying a transparent webm on an MP4 freezes at the start sometimes

I'm currently using the command
ffmpeg -i mainvideo.mp4 -vcodec libvpx -i myoverlay.webm -filter_complex "overlay = 5:5" done.mp4
To overlay a transparent webm on top of my main mp4. But for some reason the output video is frozen for the first 1~ second but the audio is completely fine.
I've tried this command with other videos and it works sometimes but most of the time the first few frames seem frozen
Edit.
I have two main mp4 files, broken_source.mp4 and working_source.mp4. Putting the overlay on broken_source results in the output having the first 1~ second of video frozen (audio completely fine) but putting the same overlay on working_source.mp4 is perfect and has no issues
Logs for putting the overlay on working_source:
ffmpeg -i working_source.mp4 -vcodec libvpx -i chat.webm -filter_complex "overlay = 0:0" working_complete.mp4
ffmpeg version 4.3.1-2021-01-01-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
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
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'working_source.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.51.101
Duration: 00:00:31.02, start: 0.000000, bitrate: 6176 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 6035 kb/s, 60 fps, 60 tbr, 90k tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
[libvpx # 0000016fb5074a80] v1.9.0-128-g3a38edea2
Last message repeated 1 times
Input #1, matroska,webm, from 'chat.webm':
Metadata:
ENCODER : Lavf58.51.101
Duration: 00:00:31.00, start: 0.000000, bitrate: 449 kb/s
Stream #1:0: Video: vp8, yuva420p(tv, progressive), 500x300, SAR 1:1 DAR 5:3, 60 fps, 60 tbr, 1k tbn, 1k tbc (default)
Metadata:
alpha_mode : 1
ENCODER : Lavc58.101.101 libvpx
DURATION : 00:00:31.000000000
[libvpx # 0000016fb50761c0] v1.9.0-128-g3a38edea2
Stream mapping:
Stream #0:0 (h264) -> overlay:main (graph 0)
Stream #1:0 (libvpx) -> overlay:overlay (graph 0)
overlay (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libvpx # 0000016fb50761c0] v1.9.0-128-g3a38edea2
[libx264 # 0000016fb5072040] using SAR=1/1
[libx264 # 0000016fb5072040] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 0000016fb5072040] profile High, level 4.2, 4:2:0, 8-bit
[libx264 # 0000016fb5072040] 264 - core 161 r3027 4121277 - 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 'working_complete.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 60 fps, 15360 tbn, 60 tbc (default)
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(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc58.91.100 aac
frame= 1861 fps= 44 q=-1.0 Lsize= 20013kB time=00:00:31.01 bitrate=5285.3kbits/s speed=0.729x
video:19477kB audio:486kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.244893%
[libx264 # 0000016fb5072040] frame I:8 Avg QP:19.04 size:240534
[libx264 # 0000016fb5072040] frame P:538 Avg QP:23.76 size: 23836
[libx264 # 0000016fb5072040] frame B:1315 Avg QP:31.66 size: 3951
[libx264 # 0000016fb5072040] consecutive B-frames: 3.0% 3.5% 14.8% 78.7%
[libx264 # 0000016fb5072040] mb I I16..4: 6.4% 47.4% 46.2%
[libx264 # 0000016fb5072040] mb P I16..4: 1.2% 4.2% 1.9% P16..4: 21.4% 5.3% 2.9% 0.0% 0.0% skip:63.1%
[libx264 # 0000016fb5072040] mb B I16..4: 0.1% 0.2% 0.1% B16..8: 12.6% 1.5% 0.5% direct: 0.4% skip:84.6% L0:35.9% L1:60.0% BI: 4.1%
[libx264 # 0000016fb5072040] 8x8 transform intra:55.5% inter:60.0%
[libx264 # 0000016fb5072040] coded y,uvDC,uvAC intra: 63.5% 77.4% 40.4% inter: 3.7% 4.6% 0.7%
[libx264 # 0000016fb5072040] i16 v,h,dc,p: 19% 37% 15% 29%
[libx264 # 0000016fb5072040] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 18% 23% 7% 7% 7% 7% 6% 8%
[libx264 # 0000016fb5072040] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 22% 17% 7% 8% 7% 7% 6% 6%
[libx264 # 0000016fb5072040] i8c dc,h,v,p: 45% 27% 18% 11%
[libx264 # 0000016fb5072040] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0000016fb5072040] ref P L0: 74.5% 13.9% 9.1% 2.5%
[libx264 # 0000016fb5072040] ref B L0: 91.9% 7.4% 0.7%
[libx264 # 0000016fb5072040] ref B L1: 96.6% 3.4%
[libx264 # 0000016fb5072040] kb/s:5144.05
[aac # 0000016fb5026a80] Qavg: 193.230
Logs for putting the overlay on broken_source:
ffmpeg -i broken_source.mp4 -vcodec libvpx -i chat.webm -filter_complex "overlay = 0:0" broken_complete.mp4
ffmpeg version 4.3.1-2021-01-01-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
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
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'broken_source.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.26.101
Duration: 00:00:45.02, start: 0.000000, bitrate: 5962 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 5952 kb/s, 60 fps, 60 tbr, 90k tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
[libvpx # 0000021071f90280] v1.9.0-128-g3a38edea2
Last message repeated 1 times
Input #1, matroska,webm, from 'chat.webm':
Metadata:
ENCODER : Lavf58.51.101
Duration: 00:00:31.00, start: 0.000000, bitrate: 449 kb/s
Stream #1:0: Video: vp8, yuva420p(tv, progressive), 500x300, SAR 1:1 DAR 5:3, 60 fps, 60 tbr, 1k tbn, 1k tbc (default)
Metadata:
alpha_mode : 1
ENCODER : Lavc58.101.101 libvpx
DURATION : 00:00:31.000000000
[libvpx # 0000021072020dc0] v1.9.0-128-g3a38edea2
Stream #0:0 (h264) -> overlay:main (graph 0)
Stream #1:0 (libvpx) -> overlay:overlay (graph 0)
overlay (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libvpx # 0000021072020dc0] v1.9.0-128-g3a38edea2
[libx264 # 0000021072022980] using SAR=1/1
[libx264 # 0000021072022980] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 0000021072022980] profile High, level 4.2, 4:2:0, 8-bit
[libx264 # 0000021072022980] 264 - core 161 r3027 4121277 - 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 'broken_complete.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 60 fps, 15360 tbn, 60 tbc (default)
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(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc58.91.100 aac
frame= 2701 fps= 47 q=-1.0 Lsize= 23020kB time=00:00:45.01 bitrate=4189.5kbits/s dup=60 drop=0 speed=0.789x
video:22242kB audio:708kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.309473%
[libx264 # 0000021072022980] frame I:11 Avg QP:18.82 size:210832
[libx264 # 0000021072022980] frame P:742 Avg QP:23.14 size: 18106
[libx264 # 0000021072022980] frame B:1948 Avg QP:31.16 size: 3604
[libx264 # 0000021072022980] consecutive B-frames: 1.7% 4.2% 6.2% 87.8%
[libx264 # 0000021072022980] mb I I16..4: 10.0% 46.2% 43.7%
[libx264 # 0000021072022980] mb P I16..4: 1.6% 4.5% 1.5% P16..4: 16.5% 4.2% 2.4% 0.0% 0.0% skip:69.3%
[libx264 # 0000021072022980] mb B I16..4: 0.1% 0.3% 0.1% B16..8: 11.3% 1.4% 0.4% direct: 0.4% skip:86.0% L0:36.5% L1:59.3% BI: 4.3%
[libx264 # 0000021072022980] 8x8 transform intra:57.4% inter:64.8%
[libx264 # 0000021072022980] coded y,uvDC,uvAC intra: 55.4% 42.1% 14.8% inter: 3.3% 2.1% 0.3%
[libx264 # 0000021072022980] i16 v,h,dc,p: 21% 37% 15% 27%
[libx264 # 0000021072022980] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 18% 24% 6% 7% 6% 7% 6% 7%
[libx264 # 0000021072022980] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 22% 16% 7% 7% 7% 7% 6% 6%
[libx264 # 0000021072022980] i8c dc,h,v,p: 58% 22% 15% 5%
[libx264 # 0000021072022980] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0000021072022980] ref P L0: 68.9% 16.6% 10.8% 3.6%
[libx264 # 0000021072022980] ref B L0: 91.6% 7.2% 1.2%
[libx264 # 0000021072022980] ref B L1: 95.9% 4.1%
[libx264 # 0000021072022980] kb/s:4047.35
[aac # 0000021072024840] Qavg: 189.405

ffmpeg: problems playing video on android

(Translated) Hello! I have the following problem. I concatenate multiple ts files and convert to mp4 with ffmpeg. I do this operation multiple times in an automated way, so I don't always check the results, but whenever I do, on the computer, the result obtained is as expected. However, some videos, when played on an Android device, are seen incorrectly in any application: Chrome, Firefox, Vlc, etc. The version of ffmpeg I use is the latest. This is the command I use:
ffmpeg.exe -hwaccel dxva2 -y -f concat -i list.txt -acodec copy -vcodec copy output.mp4 -preset normal
Results:
PC
Android
This is the output of ffmpeg:
ffmpeg version n4.3.1-26-gca55240b8c Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3-win32 (GCC) 20200320
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libxml2 --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-opencl --enable-libvmaf --disable-vulkan --enable-libvorbis --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --disable-libglslang --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libtwolame --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
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
Trailing option(s) found in the command: may be ignored.
Input #0, concat, from 'list.txt':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Data: timed_id3 (ID3 / 0x20334449)
Stream #0:1: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, unknown/bt470bg/unknown, progressive), 320x568, 29.50 fps, 29.50 tbr, 90k tbn, 180k tbc
Stream #0:2: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, mono, fltp, 64 kb/s
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf58.45.100
Stream #0:0: Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown, progressive), 320x568, q=2-31, 29.50 fps, 29.50 tbr, 90k tbn, 90k tbc
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 64 kb/s
Stream mapping:
Stream #0:1 -> #0:0 (copy)
Stream #0:2 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 9504 fps=8330 q=-1.0 Lsize= 24561kB time=00:07:42.26 bitrate= 435.3kbits/s speed= 405x
video:21200kB audio:3100kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.073735%
Not all videos are "yuv420p (tv, unknown / bt470bg / unknown, progressive)", but this should not be the problem, since other videos with this information are seen correctly on Android.
To correct this type of video I do the following:
ffmpeg -y -f concat -i list.txt -c:v libx264 -preset slow -crf 22 -pix_fmt yuv420p -c:a aac -b:a 128k output.mp4
So I get the video to play correctly both on pc and Android. Unfortunately, automating the process by always using this last line occasionally causes problems (starting file 40MB, ending file> 1GB, more than 2 hours)
I would like, if possible, help me identify which videos will be viewed incorrectly on Android. Thank you very much in advance. Finally, this is the answer that ffmpeg gives when executing the line with which I fix the file:
ffmpeg version n4.3.1-26-gca55240b8c Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3-win32 (GCC) 20200320
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libxml2 --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-opencl --enable-libvmaf --disable-vulkan --enable-libvorbis --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --disable-libglslang --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libtwolame --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
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
Input #0, concat, from 'list.txt':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Data: timed_id3 (ID3 / 0x20334449)
Stream #0:1: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, unknown/bt470bg/unknown, progressive), 320x568, 29.50 fps, 29.50 tbr, 90k tbn, 180k tbc
Stream #0:2: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, mono, fltp, 64 kb/s
Stream mapping:
Stream #0:1 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:2 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 # 000001efdbaee540] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 000001efdbaee540] profile High, level 3.0, 4:2:0, 8-bit
[libx264 # 000001efdbaee540] 264 - core 161 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 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=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=22.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'd.mp4':
Metadata:
encoder : Lavf58.45.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 320x568, q=-1--1, 29.50 fps, 15104 tbn, 29.50 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), 44100 Hz, mono, fltp, 128 kb/s
Metadata:
encoder : Lavc58.91.100 aac
More than 1000 frames duplicated 8960kB time=00:02:06.74 bitrate= 579.1kbits/s dup=999 drop=0 speed=15.7x
frame=13638 fps=468 q=-1.0 Lsize= 32033kB time=00:07:42.20 bitrate= 567.8kbits/s dup=4134 drop=0 speed=15.9x
video:25547kB audio:5995kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.557852%
[libx264 # 000001efdbaee540] frame I:87 Avg QP:19.17 size: 12750
[libx264 # 000001efdbaee540] frame P:4630 Avg QP:21.89 size: 4286
[libx264 # 000001efdbaee540] frame B:8921 Avg QP:23.89 size: 583
[libx264 # 000001efdbaee540] consecutive B-frames: 8.9% 8.6% 9.1% 73.4%
[libx264 # 000001efdbaee540] mb I I16..4: 12.2% 76.2% 11.6%
[libx264 # 000001efdbaee540] mb P I16..4: 3.7% 11.0% 0.8% P16..4: 37.1% 16.2% 5.7% 0.0% 0.0% skip:25.4%
[libx264 # 000001efdbaee540] mb B I16..4: 0.3% 0.9% 0.1% B16..8: 30.4% 3.1% 0.3% direct: 0.8% skip:64.2% L0:51.4% L1:44.3% BI: 4.3%
[libx264 # 000001efdbaee540] 8x8 transform intra:71.2% inter:66.8%
[libx264 # 000001efdbaee540] direct mvs spatial:99.9% temporal:0.1%
[libx264 # 000001efdbaee540] coded y,uvDC,uvAC intra: 52.5% 42.1% 5.5% inter: 9.7% 9.0% 0.3%
[libx264 # 000001efdbaee540] i16 v,h,dc,p: 19% 21% 9% 50%
[libx264 # 000001efdbaee540] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 11% 13% 6% 9% 11% 9% 11% 8%
[libx264 # 000001efdbaee540] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 9% 8% 6% 14% 14% 11% 9% 6%
[libx264 # 000001efdbaee540] i8c dc,h,v,p: 46% 20% 23% 12%
[libx264 # 000001efdbaee540] Weighted P-Frames: Y:2.9% UV:0.8%
[libx264 # 000001efdbaee540] ref P L0: 72.3% 12.2% 11.3% 2.1% 1.9% 0.2% 0.0%
[libx264 # 000001efdbaee540] ref B L0: 93.1% 5.5% 1.1% 0.3%
[libx264 # 000001efdbaee540] ref B L1: 97.6% 2.4%
[libx264 # 000001efdbaee540] kb/s:452.67
[aac # 000001efdbaee9c0] Qavg: 10682.834

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.

ffmpeg : Conversion to mkv with compatibility with Samsung BluRay

I have several videos (FullHD resolution) which I want to convert to mkv format and play on my Samsung BluRay Player (model BD-J5900).
Based on User Manual (http://media.datatail.com/docs/manual/252846_en.pdf , page 6) it supports mkv playing if codecs are:
Video : H.264 BP/MP/HP
Audio : MP3
Thus, based on https://ffmpeg.org/ffmpeg.html the command to convert it into proper format is:
ffmpeg -i input.avi -f matroska -vcodec libx264 -acodec mp3 output.mkv
It converts, but file is not playable on player. It say "Video format is not supported".
After checking info here: https://trac.ffmpeg.org/wiki/Encode/H.264 - I thought it may require some compatibility and change the command to :
ffmpeg -i input.avi -f matroska -vcodec libx264 -profile:v baseline -level 3.0 -acodec mp3 output.mkv
But it also didn't help - player demonstrates the same error.
How to fix that?
Thanks!
Updated:
Also tested following options
ffmpeg -i input.file -f matroska -vcodec libx264 -preset veryslow -x264-params bluray_compat=1 -acodec mp3 output.mkv
ffmpeg -i input.file -f matroska -vcodec libx264 -preset veryslow -profile:v high -level 4.2 -x264-params bluray_compat=1 -acodec mp3 output.mkv
ffmpeg -i input.file -f matroska -vcodec libx264 -preset veryslow -profile:v baseline -level 3.0 -x264-params bluray_compat=1 -acodec mp3 output.mkv
ffmpeg -i input.file -vcodec libx264 -vf format=yuv420p -preset veryslow -acodec mp3 output.mkv
Also not supported.
Updated:
Console output for command without profile flag:
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
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
[mov,mp4,m4a,3gp,3g2,mj2 # 0000019abc2aa4c0] sample aspect ratio already set to 1:1, ignoring 'pasp' atom (65536:65536)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\Yehor\Desktop\video_conversion\input\VID_20180620_165336103.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2018-06-20T22:55:12.000000Z
com.android.version: 7.0
Duration: 00:01:34.19, start: 0.000000, bitrate: 17178 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, smpte170m), 1920x1080, 17016 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
rotate : 90
creation_time : 2018-06-20T22:55:12.000000Z
handler_name : VideoHandle
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 2018-06-20T22:55:12.000000Z
handler_name : SoundHandle
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[libx264 # 0000019abc348e00] using SAR=1/1time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[libx264 # 0000019abc348e00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 0000019abc348e00] profile High, level 4.0
[libx264 # 0000019abc348e00] 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=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, matroska, to 'C:\Users\Yehor\Desktop\video_conversion\output\VID_20180620_165336103.mkv':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
com.android.version: 7.0
encoder : Lavf58.12.100
Stream #0:0(eng): Video: h264 (libx264) (H264 / 0x34363248), yuvj420p(pc), 1080x1920 [SAR 1:1 DAR 9:16], q=-1--1, 30 fps, 1k tbn, 30 tbc (default)
Metadata:
encoder : Lavc58.18.100 libx264
creation_time : 2018-06-20T22:55:12.000000Z
handler_name : VideoHandle
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
displaymatrix: rotation of -0.00 degrees
Stream #0:1(eng): Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp (default)
Metadata:
creation_time : 2018-06-20T22:55:12.000000Z
handler_name : SoundHandle
encoder : Lavc58.18.100 libmp3lame
frame= 2823 fps= 15 q=-1.0 Lsize= 80210kB time=00:01:34.10 bitrate=6982.7kbits/s speed=0.492x
video:78692kB audio:1469kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.061441%
[libx264 # 0000019abc348e00] frame I:14 Avg QP:21.43 size:187644
[libx264 # 0000019abc348e00] frame P:728 Avg QP:23.93 size: 68336
[libx264 # 0000019abc348e00] frame B:2081 Avg QP:27.79 size: 13553
[libx264 # 0000019abc348e00] consecutive B-frames: 1.3% 0.6% 2.0% 96.1%
[libx264 # 0000019abc348e00] mb I I16..4: 5.7% 71.5% 22.7%
[libx264 # 0000019abc348e00] mb P I16..4: 2.0% 8.8% 0.9% P16..4: 46.2% 20.0% 12.2% 0.0% 0.0% skip:10.1%
[libx264 # 0000019abc348e00] mb B I16..4: 0.2% 0.9% 0.1% B16..8: 45.3% 4.9% 1.0% direct: 2.8% skip:44.9% L0:45.7% L1:47.3% BI: 7.0%
[libx264 # 0000019abc348e00] 8x8 transform intra:75.1% inter:69.7%
[libx264 # 0000019abc348e00] coded y,uvDC,uvAC intra: 56.8% 70.0% 15.9% inter: 18.3% 19.2% 2.4%
[libx264 # 0000019abc348e00] i16 v,h,dc,p: 18% 33% 15% 34%
[libx264 # 0000019abc348e00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 20% 24% 5% 8% 8% 8% 5% 5%
[libx264 # 0000019abc348e00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 19% 13% 6% 9% 9% 9% 7% 5%
[libx264 # 0000019abc348e00] i8c dc,h,v,p: 53% 23% 17% 7%
[libx264 # 0000019abc348e00] Weighted P-Frames: Y:15.7% UV:2.6%
[libx264 # 0000019abc348e00] ref P L0: 49.7% 11.2% 25.9% 11.3% 1.9%
[libx264 # 0000019abc348e00] ref B L0: 88.2% 9.2% 2.6%
[libx264 # 0000019abc348e00] ref B L1: 96.2% 3.8%
[libx264 # 0000019abc348e00] kb/s:6843.33
Console output for command with profile flag:
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
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
[mov,mp4,m4a,3gp,3g2,mj2 # 0000018124b5b080] sample aspect ratio already set to 1:1, ignoring 'pasp' atom (65536:65536)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\Yehor\Desktop\video_conversion\input\VID_20180620_165336103.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2018-06-20T22:55:12.000000Z
com.android.version: 7.0
Duration: 00:01:34.19, start: 0.000000, bitrate: 17178 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, smpte170m), 1920x1080, 17016 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
rotate : 90
creation_time : 2018-06-20T22:55:12.000000Z
handler_name : VideoHandle
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 2018-06-20T22:55:12.000000Z
handler_name : SoundHandle
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[libx264 # 0000018124bf9100] using SAR=1/1time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[libx264 # 0000018124bf9100] frame MB size (68x120) > level limit (1620)
[libx264 # 0000018124bf9100] DPB size (1 frames, 8160 mbs) > level limit (0 frames, 8100 mbs)
[libx264 # 0000018124bf9100] MB rate (244800) > level limit (40500)
[libx264 # 0000018124bf9100] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 0000018124bf9100] profile Constrained Baseline, level 3.0
[libx264 # 0000018124bf9100] 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=1:0:0 analyse=0x1:0x131 me=umh subme=10 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=24 chroma_me=1 trellis=2 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 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=40 intra_refresh=0 rc_lookahead=60 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, matroska, to 'C:\Users\Yehor\Desktop\video_conversion\output\VID_20180620_165336103.mkv':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
com.android.version: 7.0
encoder : Lavf58.12.100
Stream #0:0(eng): Video: h264 (libx264) (H264 / 0x34363248), yuvj420p(pc), 1080x1920 [SAR 1:1 DAR 9:16], q=-1--1, 30 fps, 1k tbn, 30 tbc (default)
Metadata:
encoder : Lavc58.18.100 libx264
creation_time : 2018-06-20T22:55:12.000000Z
handler_name : VideoHandle
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
displaymatrix: rotation of -0.00 degrees
Stream #0:1(eng): Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp (default)
Metadata:
creation_time : 2018-06-20T22:55:12.000000Z
handler_name : SoundHandle
encoder : Lavc58.18.100 libmp3lame
frame= 2823 fps= 11 q=-1.0 Lsize= 106243kB time=00:01:34.16 bitrate=9242.5kbits/s speed=0.358x
video:104723kB audio:1469kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.047877%
[libx264 # 0000018124bf9100] frame I:14 Avg QP:24.31 size:181656
[libx264 # 0000018124bf9100] frame P:2809 Avg QP:27.29 size: 37271
[libx264 # 0000018124bf9100] mb I I16..4: 24.0% 0.0% 76.0%
[libx264 # 0000018124bf9100] mb P I16..4: 2.7% 0.0% 2.0% P16..4: 45.5% 15.6% 4.7% 0.4% 0.1% skip:28.9%
[libx264 # 0000018124bf9100] coded y,uvDC,uvAC intra: 40.3% 61.3% 13.8% inter: 21.0% 20.2% 3.7%
[libx264 # 0000018124bf9100] i16 v,h,dc,p: 22% 30% 23% 26%
[libx264 # 0000018124bf9100] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 15% 12% 9% 12% 12% 12% 9% 7%
[libx264 # 0000018124bf9100] i8c dc,h,v,p: 52% 22% 18% 8%
[libx264 # 0000018124bf9100] kb/s:9107.11
Problem solved with this code:
ffmpeg -f matroska -i input_file.*** -c:v libx264 -preset veryslow -crf 23 -profile:v high -level:v 4.1 -pix_fmt yuv420p -flags global_header -c:a aac output_file.mkv
Tested with ffmpeg 4.0.2 on Windows 10 [x64]
Probably, there is a room to play with CRF to decrease the size of final 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?

Resources