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.
Related
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
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
I'm using the rtsp-simple-server (https://github.com/aler9/rtsp-simple-server) and feed the RTSP Server with a FFMPEG stream.
I use a docker compose file to start the stream:
version: "3.8"
services:
ffmpeg:
container_name: ffmpeg-base
restart: always
image: "jenssgb/rtspffmpeg:base"
depends_on:
- rtsp-server
volumes:
- $PWD/:/video
network_mode: "host"
command: "ffmpeg -re -stream_loop -1 -i /video/footage-1-b.mp4 -c copy -f rtsp rtsp://localhost:8554/compose-rtsp"
rtsp-server:
container_name: rtsp-server-base
restart: always
image: "aler9/rtsp-simple-server"
network_mode: "host"
Now I'm trying to reduce the FPS of my video with transcoding it:
command: -re -stream_loop -1 -i ${VIDEO_FILE} -vf "fps=${FPS_COMPOSE}" -f rtsp rtsp://localhost:8554/compose-rtsp
This is basically working, but the quality of the output video becomes pretty bad. I tried a lot of things like -c:v libx264 which did help for a minute but let ffmpeg crash then.
av_interleaved_write_frame(): Broken pipe0:00:09.99 bitrate=N/A speed=0.985x
[rtsp # 0x5563b1755640] Packets poorly interleaved, failed to avoid negative timestamp -33660 in stream 0.
Try -max_interleave_delta 0 as a possible workaround.
av_interleaved_write_frame(): Broken pipe
Error writing trailer of rtsp://localhost:8554/compose-rtsp: Broken pipe
Any idea how I can reduce the FPS send the stream to the server but keep the video quality? Later I'm going to reduce the resolution as well - but for now I want to keep resolution and quality but only reduce the FPS.
Full logs from my test with -c:v libx264:
ffmpeg -re -stream_loop -1 -i footage-1-b.mp4 -vf "fps=5" -c:v libx264 -f rtsp rtsp://localhost:8554/compose-rtsp
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'footage-1-b.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : Session streamed by "nessyMediaServer"
encoder : Lavf58.29.100
comment : h264_3
Duration: 00:59:59.63, start: 0.000000, bitrate: 2099 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuvj420p(pc), 1280x720 [SAR 1:1 DAR 16:9], 2061 kb/s, 24.96 fps, 25 tbr, 12800 tbn, 25 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, mono, fltp, 35 kb/s (default)
Metadata:
handler_name : SoundHandler
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
[aac # 0x56277bc7f840] Too many bits 8832.000000 > 6144 per frame requested, clamping to max
[libx264 # 0x56277bbc33c0] using SAR=1/1
[libx264 # 0x56277bbc33c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 0x56277bbc33c0] profile High, level 3.1
[libx264 # 0x56277bbc33c0] 264 - core 155 r2917 0a84d98 - 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=5 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, rtsp, to 'rtsp://localhost:8554/compose-rtsp':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : Session streamed by "nessyMediaServer"
comment : h264_3
encoder : Lavf58.29.100
Stream #0:0(und): Video: h264 (libx264), yuvj420p(pc), 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 5 fps, 90k tbn, 5 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc58.54.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), 8000 Hz, mono, fltp, 48 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc58.54.100 aac
av_interleaved_write_frame(): Broken pipe0:00:09.87 bitrate=N/A speed=0.978x
[rtsp # 0x56277bba0640] Packets poorly interleaved, failed to avoid negative timestamp -33660 in stream 0.
Try -max_interleave_delta 0 as a possible workaround.
av_interleaved_write_frame(): Broken pipe
Error writing trailer of rtsp://localhost:8554/compose-rtsp: Broken pipe
frame= 50 fps=4.6 q=23.0 Lsize=N/A time=00:00:10.21 bitrate=N/A speed=0.947x
video:162kB audio:8kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libx264 # 0x56277bbc33c0] frame I:1 Avg QP:19.85 size:165667
[libx264 # 0x56277bbc33c0] frame P:13 Avg QP:20.88 size:140481
[libx264 # 0x56277bbc33c0] frame B:36 Avg QP:24.58 size: 55445
[libx264 # 0x56277bbc33c0] consecutive B-frames: 4.0% 0.0% 0.0% 96.0%
[libx264 # 0x56277bbc33c0] mb I I16..4: 4.4% 30.8% 64.8%
[libx264 # 0x56277bbc33c0] mb P I16..4: 4.1% 10.6% 20.0% P16..4: 24.4% 24.8% 13.3% 0.0% 0.0% skip: 2.6%
[libx264 # 0x56277bbc33c0] mb B I16..4: 0.8% 2.0% 4.0% B16..8: 40.3% 14.5% 5.2% direct:11.8% skip:21.4% L0:77.1% L1: 7.9% BI:14.9%
[libx264 # 0x56277bbc33c0] 8x8 transform intra:30.1% inter:11.9%
[libx264 # 0x56277bbc33c0] coded y,uvDC,uvAC intra: 82.5% 60.9% 26.6% inter: 55.0% 42.4% 2.7%
[libx264 # 0x56277bbc33c0] i16 v,h,dc,p: 17% 26% 34% 23%
[libx264 # 0x56277bbc33c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 33% 15% 3% 4% 5% 4% 3% 9%
[libx264 # 0x56277bbc33c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 22% 13% 3% 17% 11% 5% 3% 6%
[libx264 # 0x56277bbc33c0] i8c dc,h,v,p: 54% 25% 16% 5%
[libx264 # 0x56277bbc33c0] Weighted P-Frames: Y:7.7% UV:7.7%
[libx264 # 0x56277bbc33c0] ref P L0: 33.2% 11.6% 29.0% 23.9% 2.4%
[libx264 # 0x56277bbc33c0] ref B L0: 79.6% 11.9% 8.5%
[libx264 # 0x56277bbc33c0] ref B L1: 95.9% 4.1%
[libx264 # 0x56277bbc33c0] kb/s:3190.34
[aac # 0x56277bc7f840] Qavg: 65536.000
Conversion failed!
Thank you,
J
When you say, "the quality of the video becomes pretty bad," I guess you mean your transcoded output video has a lot of block artifacts in it. That's generally because you haven't allocated enough bandwidth to your output video stream. Without enough output bandwidth to play with, the coder quantizes and eliminates higher-frequency stuff so it looks nasty.
You didn't mention what sort of program material you have. But it's worth mentioning this: in material with lots of motion (think James Bond flick) it doesn't save much bandwidth to reduce the frame rate: we're coding the difference between successive frames. The longer you wait between frames, the more differences there are to code (and the harder the motion estimator has to work). If you radically reduce the frame rate (from 24 to 2 for example) it gets much worse.
Talking-heads material is generally less sensitive to framerate.
You might try setting your bandwidth -- your output bitrate -- explicitly like this.
-b:v 1000K -maxrate 1200K -bufsize 500K
These parameters tell ffmpeg to give you a one mbps constant-rate stream with some variation allowed. Something like this from your example ...
-re -stream_loop -1 -i ${VIDEO_FILE} -vf "fps=${FPS_COMPOSE}" -b:v 1M -maxrate 1M -bufsize 500K -f rtsp rtsp://localhost:8554/compose-rtsp
It might be easiest to try various combinations of ffmpeg parameters on your laptop so you can quick-cycle various attempts before you choose one to put in your docker image.
This question already has answers here:
FFmpeg filter_complex concat gives only first input on crop
(1 answer)
Problems building Image slideshow with sliding transition using ffmpeg
(1 answer)
ffmpeg: chain of multiple filter_complex, re-using intermediate output stream
(1 answer)
Closed 3 years ago.
I'm attempting to scale and blur (sections of) a video with ffmpeg complex filters. This has actually been working in production for years.
I'm now running a newer build of ffmpeg on Ubuntu 18.04 and getting an error relating to the filters where the same command works fine on Ubuntu 16.04's ffmpeg against the same video.
Specifically, I'm seeing the following error:
mov,mp4,m4a,3gp,3g2,mj2 # 0x56055a5902c0] Invalid stream specifier: vs0.
Last message repeated 1 times
Stream specifier 'vs0' in filtergraph description ... matches no streams.
Has something about the complex filter API changed that would make this same input invalid in a newer version of ffmpeg?
The command in question is just running the following in a Bash terminal.
ffmpeg -ss 60 -i ~/test.mp4 -y -filter_complex "[0:v]scale=-2:'min(320,ih)'[vs0];[vs0]crop=in_w/9:in_h/2:0:0,boxblur=5:1:cr=3:ar=3[b0];[vs0]crop=in_w/9:in_h/2:in_w-out_w:0,boxblur=5:1:cr=3:ar=3[b1];[vs0]crop=(in_w-2*in_w/9):in_h/20:in_w/9:0,boxblur=5:1:cr=3:ar=3[b2];[vs0][b0]overlay=0:0[ovr0];[ovr0][b1]overlay=main_w-overlay_w:0[ovr1];[ovr1][b2]overlay=main_w/9:0[vs1]" -map [vs1] -an -ac 2 -b:a 128k -acodec aac -b:v 1024k -r 30 -vcodec libx264 -t 300 -y -preset slow -movflags faststart -pix_fmt yuv420p -f mp4 ~/out.mp4
If we break up the complex filter statement, it looks like:
[0:v]scale=-2:'min(320,ih)'[vs0];
[vs0]crop=in_w/9:in_h/2:0:0,boxblur=5:1:cr=3:ar=3[b0];
[vs0]crop=in_w/9:in_h/2:in_w-out_w:0,boxblur=5:1:cr=3:ar=3[b1];
[vs0]crop=(in_w-2*in_w/9):in_h/20:in_w/9:0,boxblur=5:1:cr=3:ar=3[b2];
[vs0][b0]overlay=0:0[ovr0];[ovr0][b1]overlay=main_w-overlay_w:0[ovr1];
[ovr1][b2]overlay=main_w/9:0[vs1]
On ffmpeg version N-86980-g62b7553 (Ubuntu 16.04), everything works great as it has done for years.
$ ffmpeg -ss 60 -i ~/test.mp4 -y -filter_complex "[0:v]scale=-2:'min(320,ih)'[vs0];[vs0]crop=in_w/9:in_h/2:0:0,boxblur=5:1:cr=3:ar=3[b0];[vs0]crop=in_w/9:in_h/2:in_w-out_w:0,boxblur=5:1:cr=3:ar=3[b1];[vs0]crop=(in_w-2*in_w/9):in_h/20:in_w/9:0,boxblur=5:1:cr=3:ar=3[b2];[vs0][b0]overlay=0:0[ovr0];[ovr0][b1]overlay=main_w-overlay_w:0[ovr1];[ovr1][b2]overlay=main_w/9:0[vs1]" -map [vs1] -an -ac 2 -b:a 128k -acodec aac -b:v 1024k -r 30 -vcodec libx264 -t 300 -y -preset slow -movflags faststart -pix_fmt yuv420p -f mp4 ~/out.mp4
ffmpeg version N-86980-g62b7553 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-openssl --enable-nonfree
libavutil 55. 73.100 / 55. 73.100
libavcodec 57.102.100 / 57.102.100
libavformat 57. 76.100 / 57. 76.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 98.100 / 6. 98.100
libswscale 4. 7.102 / 4. 7.102
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/cmaier/test.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.76.100
Duration: 00:10:00.00, start: 0.000000, bitrate: 1036 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 768x480, 1033 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream mapping:
Stream #0:0 (h264) -> scale
Stream #0:0 (h264) -> crop
Stream #0:0 (h264) -> crop
Stream #0:0 (h264) -> overlay:main
overlay -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[libx264 # 0x27b2ca0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 # 0x27b2ca0] profile High, level 3.1
[libx264 # 0x27b2ca0] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 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=2 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=abr mbtree=1 bitrate=1024 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/home/cmaier/out.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.76.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 768x480, q=-1--1, 1024 kb/s, 30 fps, 15360 tbn, 30 tbc (default)
Metadata:
encoder : Lavc57.102.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/1024000 buffer size: 0 vbv_delay: -1
[mp4 # 0x27b5a60] Starting second pass: moving the moov atom to the beginning of the file3.9x
frame= 9000 fps=117 q=-1.0 Lsize= 37827kB time=00:04:59.90 bitrate=1033.3kbits/s speed= 3.9x
video:37721kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.282333%
[libx264 # 0x27b2ca0] frame I:36 Avg QP:15.21 size: 50944
[libx264 # 0x27b2ca0] frame P:2723 Avg QP:20.12 size: 9593
[libx264 # 0x27b2ca0] frame B:6241 Avg QP:24.23 size: 1710
[libx264 # 0x27b2ca0] consecutive B-frames: 3.6% 6.9% 14.5% 75.0%
[libx264 # 0x27b2ca0] mb I I16..4: 17.3% 58.5% 24.2%
[libx264 # 0x27b2ca0] mb P I16..4: 0.5% 4.4% 0.9% P16..4: 31.1% 20.7% 12.1% 0.0% 0.0% skip:30.3%
[libx264 # 0x27b2ca0] mb B I16..4: 0.0% 0.3% 0.1% B16..8: 28.9% 5.5% 1.1% direct: 1.1% skip:63.1% L0:37.5% L1:52.6% BI: 9.9%
[libx264 # 0x27b2ca0] final ratefactor: 19.69
[libx264 # 0x27b2ca0] 8x8 transform intra:72.8% inter:68.3%
[libx264 # 0x27b2ca0] direct mvs spatial:99.9% temporal:0.1%
[libx264 # 0x27b2ca0] coded y,uvDC,uvAC intra: 74.5% 73.0% 30.4% inter: 13.0% 10.7% 0.2%
[libx264 # 0x27b2ca0] i16 v,h,dc,p: 49% 30% 3% 17%
[libx264 # 0x27b2ca0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 7% 14% 11% 7% 11% 8% 19% 8% 15%
[libx264 # 0x27b2ca0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 13% 5% 8% 14% 10% 17% 9% 16%
[libx264 # 0x27b2ca0] i8c dc,h,v,p: 42% 29% 15% 15%
[libx264 # 0x27b2ca0] Weighted P-Frames: Y:7.4% UV:2.9%
[libx264 # 0x27b2ca0] ref P L0: 59.2% 20.2% 11.5% 3.7% 4.3% 1.0% 0.1%
[libx264 # 0x27b2ca0] ref B L0: 87.5% 8.8% 2.7% 1.0%
[libx264 # 0x27b2ca0] ref B L1: 96.5% 3.5%
[libx264 # 0x27b2ca0] kb/s:1030.01
On ffmpeg version N-93862-gf49cec2 (Ubuntu 18.04), the command fails immediately.
# ffmpeg -ss 60 -i ~/test.mp4 -y -filter_complex "[0:v]scale=-2:'min(320,ih)'[vs0];[vs0]crop=in_w/9:in_h/2:0:0,boxblur=5:1:cr=3:ar=3[b0];[vs0]crop=in_w/9:in_h/2:in_w-out_w:0,boxblur=5:1:cr=3:ar=3[b1];[vs0]crop=(in_w-2*in_w/9):in_h/20:in_w/9:0,boxblur=5:1:cr=3:ar=3[b2];[vs0][b0]overlay=0:0[ovr0];[ovr0][b1]overlay=main_w-overlay_w:0[ovr1];[ovr1][b2]overlay=main_w/9:0[vs1]" -map [vs1] -an -ac 2 -b:a 128k -acodec aac -b:v 1024k -r 30 -vcodec libx264 -t 300 -y -preset slow -movflags faststart -pix_fmt yuv420p -f mp4 ~/out.mp4
ffmpeg version N-93862-gf49cec2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04)
configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-openssl --enable-nonfree
libavutil 56. 27.100 / 56. 27.100
libavcodec 58. 52.101 / 58. 52.101
libavformat 58. 27.103 / 58. 27.103
libavdevice 58. 7.100 / 58. 7.100
libavfilter 7. 53.100 / 7. 53.100
libswscale 5. 4.101 / 5. 4.101
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/root/test.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.76.100
Duration: 00:10:00.00, start: 0.000000, bitrate: 1036 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 768x480, 1033 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
[mov,mp4,m4a,3gp,3g2,mj2 # 0x56055a5902c0] Invalid stream specifier: vs0.
Last message repeated 1 times
Stream specifier 'vs0' in filtergraph description [0:v]scale=-2:'min(320,ih)'[vs0];[vs0]crop=in_w/9:in_h/2:0:0,boxblur=5:1:cr=3:ar=3[b0];[vs0]crop=in_w/9:in_h/2:in_w-out_w:0,boxblur=5:1:cr=3:ar=3[b1];[vs0]crop=(in_w-2*in_w/9):in_h/20:in_w/9:0,boxblur=5:1:cr=3:ar=3[b2];[vs0][b0]overlay=0:0[ovr0];[ovr0][b1]overlay=main_w-overlay_w:0[ovr1];[ovr1][b2]overlay=main_w/9:0[vs1] matches no streams.
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?