linux - FFmpeg Drawbox 错误?

标签 linux ffmpeg

使用 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 实例中抛出这个错误。
有任何想法吗?谢谢!
更新:尝试替换 thh但得到同样的错误

最佳答案

您正在使用任意、不受支持的变量。引用 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/

相关文章:

video - 如何使用 FFmpeg 直播本地视频

c - 如何在 gdb 或 linux 终端中更改系统调用

python - 在 linux 中使用 python 截取屏幕截图(VM guest )

ffmpeg - 在 Gstreamer 上显示来自 udp 端口​​的 RTP 流数据包时出错

ruby-on-rails-3 - 请求文件头信息

java - 如何从 FFmpegStream 获取视频大小

android - 加快视频处理时间 FFMPEG,同时将多个图像添加到视频

linux - 他们是一样的东西吗 : Linux's framebuffer and GPU's memory

mysql - 无法安装 sams 在 24 小时内自学示例数据库 linux

c - 如何使用信号函数调用其他函数?