![无法解析选项值“bpyramid”](https://linux22.com/image/1574902/%E6%97%A0%E6%B3%95%E8%A7%A3%E6%9E%90%E9%80%89%E9%A1%B9%E5%80%BC%E2%80%9Cbpyramid%E2%80%9D.png)
ffmpeg -version
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-23)
configuration: --prefix=/opt/ffmpeg-4.1/ --extra-cflags=-I/opt/ffmpeg-4.1/include --extra-ldflags='-L/opt/ffmpeg-4.1/lib -ldl' --pkg-config-flags=--static --enable-gpl --enable-libx265 --extra-libs=-lpthread --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
ffmpeg -y -i /test-in.mp4 -codec:a aac -ac 2 -b:a 128k -threads 0 -codec:v libx264 -b:v 3000k -minrate 2400k -maxrate 4500k -bufsize 6000k -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 9 -trellis 1 -refs 3 -bf 3 -deinterlace -coder 1 -me_range 24 -g 25 -keyint_min 25 -r 25 -sc_threshold 0 -i_qfactor 0.71 -qmin 0 -qmax 40 -qdiff 4 -s 1280x720 -aspect 16:9 -psy 1 -fast-pskip 1 -flags2 +bpyramid+wpred+mixed_refs+dct8x8 -pix_fmt yuv420p -y /test-out.mp4
我收到错误
[aac @ 0x466dec0] [Eval @ 0x7fffbc209f40] Undefined constant or missing '(' in 'bpyramid'
[aac @ 0x466dec0] Unable to parse option value "bpyramid"
[aac @ 0x466dec0] Error setting option flags2 to value +bpyramid.
Error initializing output stream 0:1 -- Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
在 ffmpeg 版本 0.10.2 上它运行良好...我需要这个选项,最新的 ffmpeg 版本有什么问题?
答案1
在 2018 年,那些通用的 libavcodec 选项不应该被用来配置 libx264。
-flags2 +bpyramid+wpred+mixed_refs+dct8x8`
应替换为
-x264opts "b-pyramid=normal:weightb:mixed_refs:8x8dct"
请注意,以上所有内容均为默认设置,因此您可以完全跳过它们。
考虑使用预设。长期以来,我们都不推荐手动调整单个参数。