[FFmpeg-user] Strange results with -preset

Cecil Westerhof Cecil at decebal.nl
Sun Jan 28 19:38:48 EET 2018


I need to upload a set of videos, but before I do that I need to
shrink them. But I get a very strange result. Of-course the preset
veryfast is faster as faster, fast, medium, slow, slower and veryslow.
But the strange thing is that it also create a smaller version of the
file. My original file is 733.8 MB. It is a mts file I also convert to
mp4. The results:
|-----------+-------+------|
| preset    |  size | time |
|-----------+-------+------|
| veryslow  |  83.8 |   52 |
| slower    |  94.6 |   27 |
| slow      | 100.2 |   15 |
| medium    | 109.0 |   13 |
| fast      | 117.7 |    9 |
| faster    | 106.2 |    7 |
| veryfast  |  83.2 |    5 |
| superfast | 177.4 |    4 |
| ultrafast | 328.5 |    3 |
|-----------+-------+------|

So it looks like I should always use superfast. (But probably a good
idea to test it with a few other videos.)

Anyone an idea what could be happening here?

The conversion is done with:
    nice -n 20 ionice -t -c3 \
      ffmpeg -y              \
        -i 000006.mts        \
        -vcodec libx264      \
        -crf 26              \
        -acodec copy         \
        -preset ultrafast    \
        -vf drawtext="box=1:\
                      boxborderw=6:\
                      boxcolor=black at 0.2:\
                      fontcolor=white at 0.4:\
                      fontfile=FreeSerifBold.ttf:\
                      fontsize=32:
                      text='${_copyright}':\
                      x=((main_w- text_w) / 2):\
                      y=main_h - (text_h * 2)" \
        000006Shrinked.mp4

The log starts with:
ffmpeg version 3.2.10-1~deb9u1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18) 20170516
  configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, mpegts, from '00006.MTS':
  Duration: 00:07:58.40, start: 1.040000, bitrate: 12271 kb/s
  Program 1 
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p(top first), 1440x1080 [SAR 4:3 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 256 kb/s
    Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
[Parsed_drawtext_0 @ 0x557648e381e0] Using "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
[libx264 @ 0x557648e2bf80] using SAR=4/3
[libx264 @ 0x557648e2bf80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA4 FMA3 LZCNT BMI1
[libx264 @ 0x557648e2bf80] profile Constrained Baseline, level 4.0
[libx264 @ 0x557648e2bf80] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - 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=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 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=26.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
[mp4 @ 0x557648de4080] track 1: codec frame size is not set
Output #0, mp4, to '00006Shrinked.mp4':
  Metadata:
    encoder         : Lavf57.56.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.64.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: ac3 ([165][0][0][0] / 0x00A5), 48000 Hz, stereo, 256 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof


More information about the ffmpeg-user mailing list