[FFmpeg-user] Compressed file is larger than original...

iburman at compuscience.com iburman at compuscience.com
Fri Jun 25 21:40:18 EEST 2021


I'm trying to reduce the size of an mp4 file to adjust it for streaming. The
video is about one minute long and I used the sample command shown in
https://trac.ffmpeg.org/wiki/Encode/YouTube.

 

The original file size is ~18MB while the compressed file ended up at 25MB.
While would the compressed file be larger?

 

Below is the ffmpeg output:

 

ffmpeg -i HBR_TT747.mp4 -c:v libx264 -preset slow -crf 18 -c:a copy -pix_fmt
yuv420p HBR_TT747_Compressed.mp4

ffmpeg version 2021-03-14-git-1d61a31497-essentials_build-www.gyan.dev
Copyright (c) 2000-2021 the FFmpeg developers

  built with gcc 10.2.0 (Rev6, 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-zlib
--enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth
--enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx
--enable-libass --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-libgme
--enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame
--enable-libtheora --enable-libvo-amrwbenc --enable-libgsm
--enable-libopencore-amrnb --enable-libopus --enable-libspeex
--enable-libvorbis --enable-librubberband

  libavutil      56. 68.100 / 56. 68.100

  libavcodec     58.131.100 / 58.131.100

  libavformat    58. 74.100 / 58. 74.100

  libavdevice    58. 12.100 / 58. 12.100

  libavfilter     7.109.100 /  7.109.100

  libswscale      5.  8.100 /  5.  8.100

  libswresample   3.  8.100 /  3.  8.100

  libpostproc    55.  8.100 / 55.  8.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'HBR_TT747.mp4':

  Metadata:

    major_brand     : isom

    minor_version   : 512

    compatible_brands: isomiso2avc1mp41

    encoder         : Lavf58.74.100

  Duration: 00:01:01.57, start: 0.000000, bitrate: 2497 kb/s

  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1920x1080 [SAR 1:1 DAR 16:9], 2376 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc
(default)

    Metadata:

      handler_name    : VideoHandler

      vendor_id       : [0][0][0][0]

  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo,
fltp, 107 kb/s (default)

    Metadata:

      handler_name    : SoundHandler

      vendor_id       : [0][0][0][0]

Stream mapping:

  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))

  Stream #0:1 -> #0:1 (copy)

Press [q] to stop, [?] for help

[libx264 @ 000002a5498aed40] using SAR=1/1

[libx264 @ 000002a5498aed40] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2

[libx264 @ 000002a5498aed40] profile High, level 5.0, 4:2:0, 8-bit

[libx264 @ 000002a5498aed40] 264 - core 161 r3048 b86ae3c - H.264/MPEG-4 AVC
codec - Copyleft 2003-2021 - 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=9
lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0
direct=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=18.0 qcomp=0.60 qpmin=0
qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00

Output #0, mp4, to 'HBR_TT747_Compressed.mp4':

  Metadata:

    major_brand     : isom

    minor_version   : 512

    compatible_brands: isomiso2avc1mp41

    encoder         : Lavf58.74.100

  Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p(progressive),
1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 60 fps, 15360 tbn (default)

    Metadata:

      handler_name    : VideoHandler

      vendor_id       : [0][0][0][0]

      encoder         : Lavc58.131.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, 107 kb/s (default)

    Metadata:

      handler_name    : SoundHandler

      vendor_id       : [0][0][0][0]

frame=    2 fps=0.0 q=0.0 size=       0kB time=00:00:00.10 bitrate=
3.6kbits/s dup=1 drop=0 speed=7.01x    

frame=   56 fps=0.0 q=0.0 size=       0kB time=00:00:01.02 bitrate=
0.4kbits/s dup=1 drop=0 speed=1.84x    

frame=  102 fps= 96 q=26.0 size=       0kB time=00:00:01.79 bitrate=
0.2kbits/s dup=1 drop=0 speed=1.69x    

frame=  143 fps= 92 q=26.0 size=     256kB time=00:00:02.45 bitrate=
855.0kbits/s dup=1 drop=0 speed=1.57x    

frame=  179 fps= 86 q=26.0 size=     512kB time=00:00:03.07
bitrate=1365.3kbits/s dup=1 drop=0 speed=1.47x    

frame=  211 fps= 81 q=26.0 size=     768kB time=00:00:03.58
bitrate=1755.4kbits/s dup=1 drop=0 speed=1.38x    

frame=  246 fps= 79 q=26.0 size=    1024kB time=00:00:04.20
bitrate=1995.8kbits/s dup=1 drop=0 speed=1.35x    

frame=  282 fps= 78 q=26.0 size=    1280kB time=00:00:04.80
bitrate=2184.5kbits/s dup=1 drop=0 speed=1.33x    

frame=  319 fps= 78 q=26.0 size=    1536kB time=00:00:05.41
bitrate=2321.9kbits/s dup=1 drop=0 speed=1.32x    

frame=  354 fps= 76 q=26.0 size=    1792kB time=00:00:05.99
bitrate=2448.6kbits/s dup=1 drop=0 speed=1.29x    

frame=  386 fps= 75 q=26.0 size=    2048kB time=00:00:06.52
bitrate=2570.0kbits/s dup=1 drop=0 speed=1.27x    

frame=  422 fps= 74 q=26.0 size=    2304kB time=00:00:07.12
bitrate=2649.0kbits/s dup=1 drop=0 speed=1.25x    

frame=  459 fps= 74 q=26.0 size=    2560kB time=00:00:07.74
bitrate=2708.0kbits/s dup=1 drop=0 speed=1.25x    

frame=  495 fps= 73 q=26.0 size=    2816kB time=00:00:08.32
bitrate=2772.6kbits/s dup=1 drop=0 speed=1.23x    

frame=  532 fps= 73 q=26.0 size=    3072kB time=00:00:08.96
bitrate=2808.6kbits/s dup=1 drop=0 speed=1.23x    

frame=  571 fps= 73 q=26.0 size=    3328kB time=00:00:09.62
bitrate=2833.6kbits/s dup=1 drop=0 speed=1.23x    

frame=  609 fps= 73 q=26.0 size=    3584kB time=00:00:10.24
bitrate=2867.1kbits/s dup=1 drop=0 speed=1.23x    

frame=  653 fps= 73 q=26.0 size=    3840kB time=00:00:10.98
bitrate=2863.1kbits/s dup=1 drop=0 speed=1.23x    

frame=  693 fps= 73 q=26.0 size=    4352kB time=00:00:11.64
bitrate=3060.7kbits/s dup=1 drop=0 speed=1.23x    

frame=  730 fps= 73 q=26.0 size=    4608kB time=00:00:12.26
bitrate=3077.2kbits/s dup=1 drop=0 speed=1.23x    

frame=  765 fps= 73 q=26.0 size=    4864kB time=00:00:12.84
bitrate=3102.5kbits/s dup=1 drop=0 speed=1.22x    

frame=  797 fps= 73 q=26.0 size=    5120kB time=00:00:13.38
bitrate=3133.8kbits/s dup=1 drop=0 speed=1.22x    

frame=  831 fps= 72 q=26.0 size=    5632kB time=00:00:13.93
bitrate=3310.1kbits/s dup=1 drop=0 speed=1.21x    

frame=  874 fps= 73 q=26.0 size=    5632kB time=00:00:14.66
bitrate=3146.3kbits/s dup=1 drop=0 speed=1.22x    

frame=  900 fps= 72 q=26.0 size=    5888kB time=00:00:15.09
bitrate=3196.3kbits/s dup=1 drop=0 speed=1.21x    

frame=  963 fps= 74 q=24.0 size=    5888kB time=00:00:16.14
bitrate=2987.5kbits/s dup=1 drop=0 speed=1.23x    

frame= 1001 fps= 74 q=26.0 size=    6144kB time=00:00:16.78
bitrate=2998.6kbits/s dup=1 drop=0 speed=1.23x    

frame= 1028 fps= 73 q=26.0 size=    6400kB time=00:00:17.23
bitrate=3042.3kbits/s dup=1 drop=0 speed=1.22x    

frame= 1060 fps= 72 q=26.0 size=    6912kB time=00:00:17.76
bitrate=3187.1kbits/s dup=1 drop=0 speed=1.21x    

frame= 1088 fps= 71 q=26.0 size=    7168kB time=00:00:18.23
bitrate=3220.2kbits/s dup=1 drop=0 speed= 1.2x    

frame= 1124 fps= 71 q=26.0 size=    7424kB time=00:00:18.83
bitrate=3229.3kbits/s dup=1 drop=0 speed= 1.2x    

frame= 1153 fps= 71 q=26.0 size=    7936kB time=00:00:19.31
bitrate=3366.0kbits/s dup=1 drop=0 speed=1.19x    

frame= 1184 fps= 71 q=26.0 size=    8192kB time=00:00:19.82
bitrate=3384.9kbits/s dup=1 drop=0 speed=1.18x    

frame= 1226 fps= 71 q=26.0 size=    8448kB time=00:00:20.53
bitrate=3370.9kbits/s dup=1 drop=0 speed=1.19x    

frame= 1250 fps= 70 q=26.0 size=    8448kB time=00:00:20.93
bitrate=3305.7kbits/s dup=1 drop=0 speed=1.17x    

frame= 1314 fps= 72 q=26.0 size=    8448kB time=00:00:21.99
bitrate=3147.1kbits/s dup=1 drop=0 speed= 1.2x    

frame= 1358 fps= 72 q=26.0 size=    8704kB time=00:00:22.73
bitrate=3136.1kbits/s dup=1 drop=0 speed= 1.2x    

frame= 1387 fps= 71 q=26.0 size=    8960kB time=00:00:23.20
bitrate=3163.0kbits/s dup=1 drop=0 speed=1.19x    

frame= 1419 fps= 71 q=26.0 size=    9472kB time=00:00:23.71
bitrate=3271.5kbits/s dup=1 drop=0 speed=1.19x    

frame= 1447 fps= 71 q=26.0 size=    9728kB time=00:00:24.18
bitrate=3294.8kbits/s dup=1 drop=0 speed=1.18x    

frame= 1479 fps= 70 q=26.0 size=    9984kB time=00:00:24.72
bitrate=3308.6kbits/s dup=1 drop=0 speed=1.17x    

frame= 1515 fps= 70 q=26.0 size=   10240kB time=00:00:25.31
bitrate=3313.3kbits/s dup=1 drop=0 speed=1.17x    

frame= 1558 fps= 71 q=26.0 size=   10496kB time=00:00:26.06
bitrate=3298.9kbits/s dup=1 drop=0 speed=1.18x    

frame= 1590 fps= 70 q=26.0 size=   11008kB time=00:00:26.59
bitrate=3390.4kbits/s dup=1 drop=0 speed=1.18x    

frame= 1632 fps= 70 q=26.0 size=   11264kB time=00:00:27.30
bitrate=3379.8kbits/s dup=1 drop=0 speed=1.18x    

frame= 1672 fps= 70 q=26.0 size=   11520kB time=00:00:27.96
bitrate=3374.9kbits/s dup=1 drop=0 speed=1.18x    

frame= 1717 fps= 71 q=26.0 size=   11776kB time=00:00:28.68
bitrate=3362.7kbits/s dup=1 drop=0 speed=1.18x    

frame= 1755 fps= 71 q=26.0 size=   12032kB time=00:00:29.32
bitrate=3361.6kbits/s dup=1 drop=0 speed=1.18x    

frame= 1798 fps= 71 q=26.0 size=   12288kB time=00:00:30.06
bitrate=3347.8kbits/s dup=1 drop=0 speed=1.19x    

frame= 1846 fps= 71 q=26.0 size=   12288kB time=00:00:30.85
bitrate=3262.2kbits/s dup=1 drop=0 speed=1.19x    

frame= 1866 fps= 71 q=26.0 size=   12288kB time=00:00:31.19
bitrate=3226.5kbits/s dup=1 drop=0 speed=1.18x    

frame= 1928 fps= 72 q=26.0 size=   12544kB time=00:00:32.23
bitrate=3188.1kbits/s dup=1 drop=0 speed= 1.2x    

frame= 1969 fps= 72 q=26.0 size=   12800kB time=00:00:32.91
bitrate=3185.8kbits/s dup=1 drop=0 speed= 1.2x    

frame= 1997 fps= 71 q=26.0 size=   13056kB time=00:00:33.38
bitrate=3203.8kbits/s dup=1 drop=0 speed= 1.2x    

frame= 2033 fps= 71 q=26.0 size=   13568kB time=00:00:33.98
bitrate=3270.9kbits/s dup=1 drop=0 speed=1.19x    

frame= 2066 fps= 71 q=26.0 size=   13824kB time=00:00:34.53
bitrate=3279.1kbits/s dup=1 drop=0 speed=1.19x    

frame= 2105 fps= 71 q=26.0 size=   14080kB time=00:00:35.17
bitrate=3279.0kbits/s dup=1 drop=0 speed=1.19x    

frame= 2146 fps= 71 q=26.0 size=   14336kB time=00:00:35.85
bitrate=3275.1kbits/s dup=1 drop=0 speed=1.19x    

frame= 2187 fps= 71 q=26.0 size=   14592kB time=00:00:36.54
bitrate=3271.3kbits/s dup=1 drop=0 speed=1.19x    

frame= 2221 fps= 71 q=26.0 size=   14848kB time=00:00:37.11
bitrate=3277.0kbits/s dup=1 drop=0 speed=1.19x    

frame= 2255 fps= 71 q=26.0 size=   15360kB time=00:00:37.65
bitrate=3342.1kbits/s dup=1 drop=0 speed=1.19x    

frame= 2289 fps= 71 q=26.0 size=   15616kB time=00:00:38.24
bitrate=3344.6kbits/s dup=1 drop=0 speed=1.19x    

frame= 2326 fps= 71 q=26.0 size=   15872kB time=00:00:38.87
bitrate=3345.0kbits/s dup=1 drop=0 speed=1.19x    

frame= 2369 fps= 71 q=26.0 size=   16128kB time=00:00:39.55
bitrate=3340.3kbits/s dup=1 drop=0 speed=1.19x    

frame= 2407 fps= 71 q=26.0 size=   16128kB time=00:00:40.21
bitrate=3285.4kbits/s dup=1 drop=0 speed=1.19x    

frame= 2451 fps= 72 q=26.0 size=   16128kB time=00:00:40.94
bitrate=3226.4kbits/s dup=1 drop=0 speed= 1.2x    

frame= 2500 fps= 72 q=26.0 size=   16384kB time=00:00:41.73
bitrate=3215.7kbits/s dup=1 drop=0 speed= 1.2x    

frame= 2546 fps= 72 q=26.0 size=   16640kB time=00:00:42.50
bitrate=3206.9kbits/s dup=1 drop=0 speed=1.21x    

frame= 2587 fps= 72 q=26.0 size=   16896kB time=00:00:43.21
bitrate=3203.2kbits/s dup=1 drop=0 speed=1.21x    

frame= 2632 fps= 72 q=26.0 size=   17408kB time=00:00:43.93
bitrate=3245.8kbits/s dup=1 drop=0 speed=1.21x    

frame= 2670 fps= 72 q=26.0 size=   17664kB time=00:00:44.59
bitrate=3244.7kbits/s dup=1 drop=0 speed=1.21x    

frame= 2706 fps= 72 q=26.0 size=   17920kB time=00:00:45.17
bitrate=3249.7kbits/s dup=1 drop=0 speed=1.21x    

frame= 2745 fps= 72 q=26.0 size=   18432kB time=00:00:45.85
bitrate=3292.8kbits/s dup=1 drop=0 speed=1.21x    

frame= 2788 fps= 73 q=26.0 size=   18688kB time=00:00:46.53
bitrate=3289.6kbits/s dup=1 drop=0 speed=1.21x    

frame= 2821 fps= 72 q=26.0 size=   18944kB time=00:00:47.11
bitrate=3293.9kbits/s dup=1 drop=0 speed=1.21x    

frame= 2853 fps= 72 q=26.0 size=   19200kB time=00:00:47.64
bitrate=3301.0kbits/s dup=1 drop=0 speed=1.21x    

frame= 2889 fps= 72 q=26.0 size=   19456kB time=00:00:48.24
bitrate=3303.6kbits/s dup=1 drop=0 speed=1.21x    

frame= 2922 fps= 72 q=26.0 size=   19968kB time=00:00:48.77
bitrate=3353.9kbits/s dup=1 drop=0 speed= 1.2x    

frame= 2955 fps= 72 q=26.0 size=   20224kB time=00:00:49.34
bitrate=3357.3kbits/s dup=1 drop=0 speed= 1.2x    

frame= 2987 fps= 72 q=26.0 size=   20480kB time=00:00:49.88
bitrate=3363.4kbits/s dup=1 drop=0 speed= 1.2x    

frame= 3011 fps= 72 q=26.0 size=   20480kB time=00:00:50.28
bitrate=3336.3kbits/s dup=1 drop=0 speed= 1.2x    

frame= 3089 fps= 73 q=26.0 size=   20480kB time=00:00:51.55
bitrate=3254.2kbits/s dup=1 drop=0 speed=1.21x    

frame= 3133 fps= 73 q=26.0 size=   20736kB time=00:00:52.32
bitrate=3246.5kbits/s dup=1 drop=0 speed=1.22x    

frame= 3183 fps= 73 q=26.0 size=   20992kB time=00:00:53.15
bitrate=3235.2kbits/s dup=1 drop=0 speed=1.22x    

frame= 3232 fps= 73 q=26.0 size=   21248kB time=00:00:53.96
bitrate=3225.5kbits/s dup=1 drop=0 speed=1.22x    

frame= 3279 fps= 74 q=26.0 size=   21248kB time=00:00:54.75
bitrate=3178.9kbits/s dup=1 drop=0 speed=1.23x    

frame= 3333 fps= 74 q=26.0 size=   21504kB time=00:00:55.65
bitrate=3165.4kbits/s dup=1 drop=0 speed=1.23x    

frame= 3386 fps= 74 q=26.0 size=   21760kB time=00:00:56.50
bitrate=3154.8kbits/s dup=1 drop=0 speed=1.24x    

frame= 3432 fps= 74 q=26.0 size=   22016kB time=00:00:57.27
bitrate=3149.1kbits/s dup=1 drop=0 speed=1.24x    

frame= 3479 fps= 75 q=26.0 size=   22272kB time=00:00:58.08
bitrate=3141.2kbits/s dup=1 drop=0 speed=1.24x    

frame= 3515 fps= 74 q=26.0 size=   22528kB time=00:00:58.68
bitrate=3145.0kbits/s dup=1 drop=0 speed=1.24x    

frame= 3550 fps= 74 q=26.0 size=   22784kB time=00:00:59.25
bitrate=3149.8kbits/s dup=1 drop=0 speed=1.24x    

frame= 3575 fps= 74 q=26.0 size=   23296kB time=00:00:59.68
bitrate=3197.6kbits/s dup=1 drop=0 speed=1.24x    

frame= 3611 fps= 74 q=26.0 size=   23552kB time=00:01:00.28
bitrate=3200.7kbits/s dup=1 drop=0 speed=1.23x    

frame= 3647 fps= 74 q=26.0 size=   23808kB time=00:01:00.87
bitrate=3203.7kbits/s dup=1 drop=0 speed=1.23x    

frame= 3683 fps= 74 q=26.0 size=   24320kB time=00:01:01.47
bitrate=3240.8kbits/s dup=1 drop=0 speed=1.23x    

frame= 3694 fps= 72 q=-1.0 Lsize=   25219kB time=00:01:01.56
bitrate=3356.0kbits/s dup=1 drop=0 speed=1.21x    

video:24304kB audio:806kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.437677%

[libx264 @ 000002a5498aed40] frame I:26    Avg QP:11.94  size: 52173

[libx264 @ 000002a5498aed40] frame P:972   Avg QP:15.69  size: 18451

[libx264 @ 000002a5498aed40] frame B:2696  Avg QP:17.66  size:  2076

[libx264 @ 000002a5498aed40] consecutive B-frames:  1.4%  2.8%  3.6% 92.3%

[libx264 @ 000002a5498aed40] mb I  I16..4: 48.2% 44.9%  6.9%

[libx264 @ 000002a5498aed40] mb P  I16..4:  5.5%  6.1%  0.6%  P16..4: 24.5%
5.0%  2.4%  0.0%  0.0%    skip:55.9%

[libx264 @ 000002a5498aed40] mb B  I16..4:  0.2%  0.1%  0.0%  B16..8:  9.6%
0.5%  0.1%  direct: 2.0%  skip:87.5%  L0:47.9% L1:49.3% BI: 2.8%

[libx264 @ 000002a5498aed40] 8x8 transform intra:48.4% inter:65.1%

[libx264 @ 000002a5498aed40] direct mvs  spatial:99.8% temporal:0.2%

[libx264 @ 000002a5498aed40] coded y,uvDC,uvAC intra: 18.0% 49.8% 16.3%
inter: 1.9% 6.9% 0.2%

[libx264 @ 000002a5498aed40] i16 v,h,dc,p: 51% 20%  7% 22%

[libx264 @ 000002a5498aed40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 13% 49%  2%
2%  3%  3%  3%  3%

[libx264 @ 000002a5498aed40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 42% 13%  3%
4%  4%  4%  4%  4%

[libx264 @ 000002a5498aed40] i8c dc,h,v,p: 53% 21% 21%  5%

[libx264 @ 000002a5498aed40] Weighted P-Frames: Y:2.1% UV:0.5%

[libx264 @ 000002a5498aed40] ref P L0: 69.2%  7.8% 14.1%  5.1%  3.8%  0.0%

[libx264 @ 000002a5498aed40] ref B L0: 87.8%  9.5%  1.9%  0.8%

[libx264 @ 000002a5498aed40] ref B L1: 98.4%  1.6%

[libx264 @ 000002a5498aed40] kb/s:3233.74



More information about the ffmpeg-user mailing list