FFmpeg 抽屉错误?

FFmpeg Drawbox Errors?

使用 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 实例中引发此错误。

有什么想法吗?谢谢!

更新:尝试用 h 替换 th 但出现相同的错误

您正在使用不受支持的任意变量。请参阅 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