命令行输出 :
D:\ffmpeg>ffmpeg -h encoder=libx264 ffmpeg version n4.4-19-g8d172d9409 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 10-win32 (GCC) 20210408 configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --enable-shared --disable-static --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libvmaf --enable-vulkan --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --enable-libglslang --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 Encoder libx264 [libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10]: General capabilities: delay threads Threading capabilities: other Supported pixel formats: yuv420p yuvj420p yuv422p yuvj422p yuv444p yuvj444p nv12 nv16 nv21 yuv420p10le yuv422p10le yuv444p10le nv20le gray gray10le libx264 AVOptions: -preset <string> E..V....... Set the encoding preset (cf. x264 --fullhelp) (default "medium") -tune <string> E..V....... Tune the encoding params (cf. x264 --fullhelp) -profile <string> E..V....... Set profile restrictions (cf. x264 --fullhelp) -fastfirstpass <boolean> E..V....... Use fast settings when encoding first pass (default true) -level <string> E..V....... Specify level (as defined by Annex A) -passlogfile <string> E..V....... Filename for 2 pass stats -wpredp <string> E..V....... Weighted prediction for P-frames -a53cc <boolean> E..V....... Use A53 Closed Captions (if available) (default true) -x264opts <string> E..V....... x264 options -crf <float> E..V....... Select the quality for constant quality mode (from -1 to FLT_MAX) (default -1) -crf_max <float> E..V....... In CRF mode, prevents VBV from lowering quality beyond this point. (from -1 to FLT_MAX) (default -1) -qp <int> E..V....... Constant quantization parameter rate control method (from -1 to INT_MAX) (default -1) -aq-mode <int> E..V....... AQ method (from -1 to INT_MAX) (default -1) none 0 E..V....... variance 1 E..V....... Variance AQ (complexity mask) autovariance 2 E..V....... Auto-variance AQ autovariance-biased 3 E..V....... Auto-variance AQ with bias to dark scenes -aq-strength <float> E..V....... AQ strength. Reduces blocking and blurring in flat and textured areas. (from -1 to FLT_MAX) (default -1) -psy <boolean> E..V....... Use psychovisual optimizations. (default auto) -psy-rd <string> E..V....... Strength of psychovisual optimization, in <psy-rd>:<psy-trellis> format. -rc-lookahead <int> E..V....... Number of frames to look ahead for frametype and ratecontrol (from -1 to INT_MAX) (default -1) -weightb <boolean> E..V....... Weighted prediction for B-frames. (default auto) -weightp <int> E..V....... Weighted prediction analysis method. (from -1 to INT_MAX) (default -1) none 0 E..V....... simple 1 E..V....... smart 2 E..V....... -ssim <boolean> E..V....... Calculate and print SSIM stats. (default auto) -intra-refresh <boolean> E..V....... Use Periodic Intra Refresh instead of IDR frames. (default auto) -bluray-compat <boolean> E..V....... Bluray compatibility workarounds. (default auto) -b-bias <int> E..V....... Influences how often B-frames are used (from INT_MIN to INT_MAX) (default INT_MIN) -b-pyramid <int> E..V....... Keep some B-frames as references. (from -1 to INT_MAX) (default -1) none 0 E..V....... strict 1 E..V....... Strictly hierarchical pyramid normal 2 E..V....... Non-strict (not Blu-ray compatible) -mixed-refs <boolean> E..V....... One reference per partition, as opposed to one reference per macroblock (default auto) -8x8dct <boolean> E..V....... High profile 8x8 transform. (default auto) -fast-pskip <boolean> E..V....... (default auto) -aud <boolean> E..V....... Use access unit delimiters. (default auto) -mbtree <boolean> E..V....... Use macroblock tree ratecontrol. (default auto) -deblock <string> E..V....... Loop filter parameters, in <alpha:beta> form. -cplxblur <float> E..V....... Reduce fluctuations in QP (before curve compression) (from -1 to FLT_MAX) (default -1) -partitions <string> E..V....... A comma-separated list of partitions to consider. Possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all -direct-pred <int> E..V....... Direct MV prediction mode (from -1 to INT_MAX) (default -1) none 0 E..V....... spatial 1 E..V....... temporal 2 E..V....... auto 3 E..V....... -slice-max-size <int> E..V....... Limit the size of each slice in bytes (from -1 to INT_MAX) (default -1) -stats <string> E..V....... Filename for 2 pass stats -nal-hrd <int> E..V....... Signal HRD information (requires vbv-bufsize; cbr not allowed in .mp4) (from -1 to INT_MAX) (default -1) none 0 E..V....... vbr 1 E..V....... cbr 2 E..V....... -avcintra-class <int> E..V....... AVC-Intra class 50/100/200 (from -1 to 200) (default -1) -me_method <int> E..V....... Set motion estimation method (from -1 to 4) (default -1) dia 0 E..V....... hex 1 E..V....... umh 2 E..V....... esa 3 E..V....... tesa 4 E..V....... -motion-est <int> E..V....... Set motion estimation method (from -1 to 4) (default -1) dia 0 E..V....... hex 1 E..V....... umh 2 E..V....... esa 3 E..V....... tesa 4 E..V....... -forced-idr <boolean> E..V....... If forcing keyframes, force them as IDR frames. (default false) -coder <int> E..V....... Coder type (from -1 to 1) (default default) default -1 E..V....... cavlc 0 E..V....... cabac 1 E..V....... vlc 0 E..V....... ac 1 E..V....... -b_strategy <int> E..V....... Strategy to choose between I/P/B-frames (from -1 to 2) (default -1) -chromaoffset <int> E..V....... QP difference between chroma and luma (from INT_MIN to INT_MAX) (default 0) -sc_threshold <int> E..V....... Scene change threshold (from INT_MIN to INT_MAX) (default -1) -noise_reduction <int> E..V....... Noise reduction (from INT_MIN to INT_MAX) (default -1) -x264-params <dictionary> E..V....... Override the x264 configuration using a :-separated list of key=value parameters D:\ffmpeg>
五、查询命令设置项以及具体参数
想要对一个视频进行编码操作 , 查询编码器 , 如只知道 264 , 不知道具体的编码器名称 , 先使用如下名称 , 查询到具体的编码器名称 ;
ffmpeg -encoders | findstr 264
查询结果是 V..... libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264) , 编码器的名称是 libx264 ;
D:\ffmpeg>ffmpeg -encoders | findstr 264 ffmpeg version n4.4-19-g8d172d9409 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 10-win32 (GCC) 20210408 configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --enable-shared --disable-static --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libvmaf --enable-vulkan --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --enable-libglslang --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 V..... libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264) V..... libx264rgb libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264) V....D h264_amf AMD AMF H.264 Encoder (codec h264) V....D h264_mf H264 via MediaFoundation (codec h264) V....D h264_nvenc NVIDIA NVENC H.264 encoder (codec h264) V..... h264_qsv H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration) (codec h264) V..... nvenc NVIDIA NVENC H.264 encoder (codec h264) V..... nvenc_h264 NVIDIA NVENC H.264 encoder (codec h264) D:\ffmpeg>
然后查询如果编码器设置为 libx264 都需要设置哪些参数 ;
使用
ffmpeg -h encoder=libx264
命令即可查询 libx264 编码器的详细参数设置 ;