如何通过 FFMPEG 从一系列图像创建动画?

如何通过 FFMPEG 从一系列图像创建动画?

我用 FFMPEG 的一系列图像制作了一个视频

ffmpeg -r 10 -gamma 2.2 -i a%03d.exr -c:v libx264 -crf 0 -tune animation -vf fps=25 -pix_fmt yuv444p10le out.mp4

但是,与原始图像相比,我仍然看到色带和噪点。

我如何调整设置来提高视频质量?

-r 25 的示例命令

ffmpeg -y -r 25 -gamma 2.2 -i a%03d.exr -c:v libx264 -crf 0 -tune animation -vf fps=25 -pix_fmt yuv444p10le out.mp4
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-liblensfun --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, image2, from 'a%03d.exr':
  Duration: 00:00:04.40, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: exr, rgb48le, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (exr (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x562db33f2500] using SAR=1/1
[libx264 @ 0x562db33f2500] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x562db33f2500] profile High 4:4:4 Predictive, level 5.0, 4:4:4 10-bit
[libx264 @ 0x562db33f2500] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=6 deblock=1:1:1 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=0.40:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=34 lookahead_threads=5 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=5 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=0.0 qcomp=0.60 qpmin=0 qpmax=81 qpstep=4 ip_ratio=1.40 aq=1:0.60
Output #0, mp4, to 'out.mp4':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv444p10le, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.54.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame=  110 fps= 14 q=-1.0 Lsize=    7237kB time=00:00:04.28 bitrate=13851.3kbits/s speed=0.557x    
video:7235kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.025848%
[libx264 @ 0x562db33f2500] frame I:1     Avg QP: 3.68  size: 48031
[libx264 @ 0x562db33f2500] frame P:59    Avg QP:10.19  size: 88698
[libx264 @ 0x562db33f2500] frame B:50    Avg QP:13.43  size: 42536
[libx264 @ 0x562db33f2500] consecutive B-frames: 33.6% 18.2% 16.4% 10.9%  4.5% 16.4%
[libx264 @ 0x562db33f2500] mb I  I16..4: 78.3%  0.0% 21.7%
[libx264 @ 0x562db33f2500] mb P  I16..4: 12.4%  0.0%  9.7%  P16..4: 12.8% 10.0%  6.4%  0.0%  0.0%    skip:48.7%
[libx264 @ 0x562db33f2500] mb B  I16..4:  2.0%  0.0%  1.9%  B16..8: 16.7%  9.4%  4.3%  direct: 1.8%  skip:63.8%  L0:46.2% L1:40.2% BI:13.6%
[libx264 @ 0x562db33f2500] coded y,u,v intra: 31.3% 8.7% 11.0% inter: 9.3% 1.7% 2.0%
[libx264 @ 0x562db33f2500] i16 v,h,dc,p: 48% 16%  5% 31%
[libx264 @ 0x562db33f2500] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 26% 28%  5%  6%  4%  6%  4%  4%
[libx264 @ 0x562db33f2500] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x562db33f2500] ref P L0: 75.3% 12.2%  5.3%  3.2%  2.7%  1.3%
[libx264 @ 0x562db33f2500] ref B L0: 82.4% 10.9%  4.3%  1.8%  0.6%
[libx264 @ 0x562db33f2500] ref B L1: 99.2%  0.8%
[libx264 @ 0x562db33f2500] kb/s:13469.02

相关内容