使用 ffmpeg 版本 4.3.2。
命令:
ffmpeg -y
-i /usr/src/app/backgrounds/pink-blue.jpg
-i files/fuzzy-octopus-5/path/file.webm
-i files/fuzzy-octopus-5/path/file.webm
-i /usr/src/app/logo.png
-filter_complex "
[0]drawbox=x=-140:y=(((H-th)/2) - 205):w=840:h=490:color=white@0.2:t=fill,
drawbox=x=770:y=(((H-th)/2) - 205):w=840:h=490:color=white@0.2:t=fill[bg];
...
但是我收到以下错误?Error while processing the decoded data for stream #3:0
Failed to inject frame into filter network: Invalid argument
Error reinitializing filters!
[Parsed_drawbox_0 @ 0x564a87058e80] Failed to configure input pad on Parsed_drawbox_0
[Parsed_drawbox_0 @ 0x564a87058e80] Error when evaluating the expression '(((H-th)/2) - 205)'.
Last message repeated 5 times
[Parsed_drawbox_0 @ 0x564a87058e80] [Eval @ 0x7ffcf25dc650] Undefined constant or missing '(' in 'H-th)/2)-205)'
我有适量的括号,这绝对适用于我的本地机器(macOS)。它只会在我们部署的 AWS EC2 linux 实例中抛出这个错误。有任何想法吗?谢谢!
更新:尝试替换
th
与 h
但得到同样的错误
最佳答案
您正在使用任意、不受支持的变量。引用 drawbox documentation对于支持的变量列表(在“x、y、w 和 h 和 t 的参数是包含以下常量的表达式”部分下)。
我只能猜测您要做什么,但这是一个简化的有效示例:
ffmpeg -i input.mp4 -filter_complex "[0]drawbox=x=-140:y=(((ih-h)/2) - 205):w=840:h=490:color=white@0.2:t=fill" output.mp4
关于linux - FFmpeg Drawbox 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66576749/