调整视频大小会降低视频质量 - FFMPEG

调整视频大小会降低视频质量 - FFMPEG

我已成功将视频调整为 720:576。但视频质量下降了。我不希望质量下降。我不希望有任何压缩。

原始视频大小:296 MB 调整大小后视频大小为:78.7 MB

请指教

命令:

ffmpeg -ss  4267.798935 -i D:/ffmpeg_test/Library/2020/11/21/SSLK006998.mp4 -to 651.919553 -filter_complex "[0:v]scale=720:576[v]" -map "[v]" -map 0:a -c:a copy D:/ffmpeg_output/Library/2020/11/21/SSLK006998_VideoAudioUntilMarked_InsrtSameVideo_7_3930_scaled_1.mp4

完整日志:

ffmpeg -ss  4267.798935 -i D:/ffmpeg_test/Library/2020/11/21/SSLK006998.mp4 -to 651.919553 -filter_complex "[0:v]scale=720:576[v]" -map "[v]" -map 0:a -c:a copy D:/ffmpeg_output/Library/2020/11/21/SSLK006998_VideoAudioUntilMarked_InsrtSameVideo_7_3930_scaled_1.mp4
ffmpeg version 2021-05-09-git-8649f5dca6-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      57.  0.100 / 57.  0.100
  libavcodec     59.  1.100 / 59.  1.100
  libavformat    59.  0.101 / 59.  0.101
  libavdevice    59.  0.100 / 59.  0.100
  libavfilter     8.  0.101 /  8.  0.101
  libswscale      6.  0.100 /  6.  0.100
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:/ffmpeg_test/Library/2020/11/21/SSLK006998.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2020-11-08T00:33:36.000000Z
  Duration: 01:56:06.44, start: 0.000000, bitrate: 3616 kb/s
  Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 3422 kb/s, 25 fps, 25 tbr, 25k tbn (default)
    Metadata:
      creation_time   : 2020-11-08T00:33:36.000000Z
      handler_name    : ?Mainconcept Video Media Handler
      vendor_id       : [0][0][0][0]
      encoder         : AVC Coding
  Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
      creation_time   : 2020-11-08T00:33:37.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 (h264) -> scale
  scale -> Stream #0:0 (libx264)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[libx264 @ 000002bf194f00c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000002bf194f00c0] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 000002bf194f00c0] 264 - core 163 r3059 b684ebe - 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=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 'D:/ffmpeg_output/Library/2020/11/21/SSLK006998_VideoAudioUntilMarked_InsrtSameVideo_7_3930_scaled_1.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    encoder         : Lavf59.0.101
  Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, top coded first (swapped)), 720x576, q=2-31, 25 fps, 12800 tbn (default)
    Metadata:
      encoder         : Lavc59.1.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
      creation_time   : 2020-11-08T00:33:37.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
      vendor_id       : [0][0][0][0]
frame=16298 fps=219 q=-1.0 Lsize=   80642kB time=00:10:51.92 bitrate=1013.3kbits/s speed=8.76x
video:65083kB audio:15089kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.585689%
[libx264 @ 000002bf194f00c0] frame I:83    Avg QP:19.19  size: 97799
[libx264 @ 000002bf194f00c0] frame P:5121  Avg QP:22.47  size:  9335
[libx264 @ 000002bf194f00c0] frame B:11094 Avg QP:26.92  size:   967
[libx264 @ 000002bf194f00c0] consecutive B-frames:  2.8%  6.7% 37.8% 52.7%
[libx264 @ 000002bf194f00c0] mb I  I16..4:  6.1% 38.7% 55.3%
[libx264 @ 000002bf194f00c0] mb P  I16..4:  0.8%  1.9%  0.6%  P16..4: 31.2% 13.0% 10.8%  0.0%  0.0%    skip:41.8%
[libx264 @ 000002bf194f00c0] mb B  I16..4:  0.0%  0.1%  0.0%  B16..8: 22.8%  2.4%  0.6%  direct: 0.9%  skip:73.3%  L0:30.6% L1:59.9% BI: 9.5%
[libx264 @ 000002bf194f00c0] 8x8 transform intra:53.2% inter:57.5%
[libx264 @ 000002bf194f00c0] coded y,uvDC,uvAC intra: 66.7% 79.9% 52.7% inter: 10.2% 9.8% 2.0%
[libx264 @ 000002bf194f00c0] i16 v,h,dc,p: 30% 39%  7% 23%
[libx264 @ 000002bf194f00c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 18% 17%  5%  7%  9%  7%  8%  7%
[libx264 @ 000002bf194f00c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 19% 10%  6%  8%  9%  7%  8%  7%
[libx264 @ 000002bf194f00c0] i8c dc,h,v,p: 40% 26% 25%  9%
[libx264 @ 000002bf194f00c0] Weighted P-Frames: Y:4.7% UV:4.3%
[libx264 @ 000002bf194f00c0] ref P L0: 68.7% 15.0% 12.8%  3.4%  0.0%
[libx264 @ 000002bf194f00c0] ref B L0: 91.5%  6.6%  1.8%
[libx264 @ 000002bf194f00c0] ref B L1: 96.5%  3.5%
[libx264 @ 000002bf194f00c0] kb/s:817.82

答案1

将视频尺寸从 1920x1080 减小到 720x576 会将像素数减少 5 倍。

为了做到这一点,如果不考虑压缩比等,您实际上就是丢弃了 80% 的图像数据。

您无法在保持图像质量的同时做到这一点。

相关内容