[FFmpeg-trac] #6574(swscale:new): ffmpeg butchers video quality when downscaling

FFmpeg trac at avcodec.org
Tue Aug 8 13:23:23 EEST 2017


#6574: ffmpeg butchers video quality when downscaling
---------------------------------+------------------------------------
             Reporter:  birdie   |                     Type:  defect
               Status:  new      |                 Priority:  critical
            Component:  swscale  |                  Version:  3.2.4
             Keywords:           |               Blocked By:
             Blocking:           |  Reproduced by developer:  0
Analyzed by developer:  0        |
---------------------------------+------------------------------------
 Summary of the bug: even if I choose crf 0 (!) the resulting video is
 extremely blurry and there's a huge loss of details.

 How to reproduce:
 {{{

 ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
   built with gcc 4.5.4 (GCC)
   configuration: --disable-static --enable-nonfree --enable-avfilter
 --enable-shared --enable-gpl --enable-postproc --enable-pthreads --enable-
 libspeex --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-
 libopus --enable-libopenjpeg --disable-debug --disable-doc --enable-
 libpulse --extra-cflags='-march=native' --extra-ldflags='-Wl,-O1 -Wl
 ,--hash-style=gnu -Wl,--enable-new-dtags' --enable-version3 --enable-
 libvorbis --enable-libfdk-aac --enable-x11grab --enable-gnutls --enable-
 libfreetype --enable-libx265
   libavutil      55. 34.100 / 55. 34.100
   libavcodec     57. 64.101 / 57. 64.101
   libavformat    57. 56.100 / 57. 56.100
   libavdevice    57.  1.100 / 57.  1.100
   libavfilter     6. 65.100 /  6. 65.100
   libswscale      4.  2.100 /  4.  2.100
   libswresample   2.  3.100 /  2.  3.100
   libpostproc    54.  1.100 / 54.  1.100
 Input #0, matroska,webm, from 'source.mkv':
   Metadata:
     ENCODER         : Lavf57.56.100
   Duration: 00:00:14.43, start: 0.000000, bitrate: 5636 kb/s
     Chapter #0:0: start 0.000000, end 179.000000
     Chapter #0:1: start 179.000000, end 998.000000
     Chapter #0:2: start 998.000000, end 1598.000000
     Chapter #0:3: start 1598.000000, end 2043.000000
     Chapter #0:4: start 2043.000000, end 2614.000000
     Chapter #0:5: start 2614.000000, end 3387.000000
     Chapter #0:6: start 3387.000000, end 4007.000000
     Chapter #0:7: start 4007.000000, end 4729.000000
     Chapter #0:8: start 4729.000000, end 5163.504000
     Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x800 [SAR
 1:1 DAR 12:5], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
     Metadata:
       DURATION        : 00:00:14.431000000
 [libx264 @ 0x981b3a0] using SAR=171/160
 [libx264 @ 0x981b3a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
 AVX
 [libx264 @ 0x981b3a0] profile High 4:4:4 Predictive, level 3.1, 4:2:0
 8-bit
 [libx264 @ 0x981b3a0] 64 - core 148 - H.264/MPEG-4 AVC codec - Copyleft
 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=16
 deblock=1:-1:-1 analyse=0x1:0x131 me=umh subme=9 psy=0 mixed_ref=1
 me_range=24 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11
 fast_pskip=0 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=2 keyint=230 keyint_min=23
 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=0
 Output #0, matroska, to 'result.mkv':
   Metadata:
     encoder         : Lavf57.56.100
     Chapter #0:0: start 0.000000, end 179.000000
     Chapter #0:1: start 179.000000, end 998.000000
     Chapter #0:2: start 998.000000, end 1598.000000
     Chapter #0:3: start 1598.000000, end 2043.000000
     Chapter #0:4: start 2043.000000, end 2614.000000
     Chapter #0:5: start 2614.000000, end 3387.000000
     Chapter #0:6: start 3387.000000, end 4007.000000
     Chapter #0:7: start 4007.000000, end 4729.000000
     Chapter #0:8: start 4729.000000, end 5163.504000
     Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p,
 768x342 [SAR 171:160 DAR 12:5], q=-1--1, 23.98 fps, 1k tbn, 23.98 tbc
 (default)
     Metadata:
       DURATION        : 00:00:14.431000000
       encoder         : Lavc57.64.101 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
 Press [q] to stop, [?] for help
 frame=  343 fps= 26 q=-1.0 Lsize=   26724kB time=00:00:14.39
 bitrate=15213.7kbits/s speed=1.08x
 video:26720kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 0.015149%
 [libx264 @ 0x981b3a0] frame I:5     Avg QP: 0.00  size:149249
 [libx264 @ 0x981b3a0] frame P:338   Avg QP: 0.00  size: 78742
 [libx264 @ 0x981b3a0] mb I  I16..4: 21.5%  0.0% 78.5%
 [libx264 @ 0x981b3a0] mb P  I16..4:  8.6%  0.0%  3.6%  P16..4: 47.8% 14.8%
 21.6%  1.8%  1.7%    skip: 0.0%
 [libx264 @ 0x981b3a0] 8x8 transform intra:0.0% inter:65.1%
 [libx264 @ 0x981b3a0] coded y,uvDC,uvAC intra: 93.7% 99.5% 99.5% inter:
 99.6% 99.4% 99.4%
 [libx264 @ 0x981b3a0] i16 v,h,dc,p: 75% 23%  2%  0%
 [libx264 @ 0x981b3a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 60% 24%  4%  2%  3%
 3%  2%  1%  1%
 [libx264 @ 0x981b3a0] i8c dc,h,v,p:  8% 21% 69%  2%
 [libx264 @ 0x981b3a0] Weighted P-Frames: Y:0.9% UV:0.0%
 [libx264 @ 0x981b3a0] ref P L0: 73.9%  8.6% 11.4%  2.5%  1.5%  0.7%  0.4%
 0.2%  0.2%  0.2%  0.1%  0.1%  0.0%  0.1%  0.0%  0.0%
 [libx264 @ 0x981b3a0] kb/s:15080.62


 }}}

 I have tried -sws_flags lanczos to no avail. The source file can be
 downloaded from here:
 https://mega.nz/#!bp0jwCoJ!--QLIwVLvDnFfNWdVyYH6zkE0pUApN6tjhVNq0xylPc

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6574>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list