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

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


#6574: ffmpeg butchers video quality when downscaling
----------------------------------+-----------------------------------
             Reporter:  birdie    |                    Owner:
                 Type:  defect    |                   Status:  new
             Priority:  critical  |                Component:  swscale
              Version:  3.2.4     |               Resolution:
             Keywords:            |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+-----------------------------------

Comment (by birdie):

 I've tried ffmpeg from git - the result is the same:

 {{{
 ffmpeg -i source.mkv -vf scale=768x342 -sws_flags spline -c:v libx264
 -preset veryslow -x264opts keyint=230:min-keyint=23:bframes=16 -crf 0
 -tune film result.mkv

 ffmpeg version N-86925-g4ff94558f2 Copyright (c) 2000-2017 the FFmpeg
 developers
   built with gcc 6.4.0 (Debian 6.4.0-2) 20170724
   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-libass --enable-libfreetype --enable-libfribidi --enable-
 libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-
 libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-
 libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc
 --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264
 --enable-libx265 --enable-libxvid --enable-libzimg
   libavutil      55. 69.100 / 55. 69.100
   libavcodec     57.102.100 / 57.102.100
   libavformat    57. 76.100 / 57. 76.100
   libavdevice    57.  7.100 / 57.  7.100
   libavfilter     6. 96.100 /  6. 96.100
   libswscale      4.  7.101 /  4.  7.101
   libswresample   2.  8.100 /  2.  8.100
   libpostproc    54.  6.100 / 54.  6.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
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
 Press [q] to stop, [?] for help
 [libx264 @ 0x4817540] using SAR=171/160
 [libx264 @ 0x4817540] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
 AVX
 [libx264 @ 0x4817540] profile High 4:4:4 Predictive, level 3.1, 4:2:0
 8-bit
 [libx264 @ 0x4817540] 264 - core 152 r19 ba24899 - H.264/MPEG-4 AVC codec
 - Copyleft 2003-2017 - 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.76.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.102.100 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
 frame=  343 fps= 30 q=-1.0 Lsize=   27649kB time=00:00:14.39
 bitrate=15740.4kbits/s speed=1.24x
 video:27645kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 0.014695%
 [libx264 @ 0x4817540] frame I:5     Avg QP: 0.00  size:152679
 [libx264 @ 0x4817540] frame P:338   Avg QP: 0.00  size: 81494
 [libx264 @ 0x4817540] mb I  I16..4: 22.0%  0.0% 78.0%
 [libx264 @ 0x4817540] mb P  I16..4:  6.6%  0.0%  3.6%  P16..4: 49.6% 15.2%
 21.5%  1.8%  1.6%    skip: 0.0%
 [libx264 @ 0x4817540] 8x8 transform intra:0.0% inter:66.4%
 [libx264 @ 0x4817540] coded y,uvDC,uvAC intra: 92.9% 99.8% 99.8% inter:
 99.7% 99.7% 99.6%
 [libx264 @ 0x4817540] i16 v,h,dc,p: 67% 31%  2%  0%
 [libx264 @ 0x4817540] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 59% 24%  4%  2%  3%
 3%  2%  1%  1%
 [libx264 @ 0x4817540] i8c dc,h,v,p:  9% 26% 63%  2%
 [libx264 @ 0x4817540] Weighted P-Frames: Y:0.9% UV:0.0%
 [libx264 @ 0x4817540] ref P L0: 74.9%  8.6% 10.8%  2.3%  1.4%  0.6%  0.4%
 0.2%  0.2%  0.2%  0.1%  0.1%  0.0%  0.0%  0.0%  0.0%
 [libx264 @ 0x4817540] kb/s:15602.79
 }}}

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


More information about the FFmpeg-trac mailing list