【问题标题】:FFmpeg: Failed to create drawbox filter with max thicknessFFmpeg:无法创建最大厚度的drawbox过滤器
【发布时间】:2015-04-27 06:43:48
【问题描述】:

我已从 FFmpeg 版本 1.2 切换。到最后的 2.5 版本。在更改了所有不推荐使用的方法后,我遇到了 drawbox 过滤器的问题。在 1.2 版中,我可以使用以下设置定义一个填充框(请参阅FFmpeg Filter Documentation):

strFilterDesc += "drawbox=x=0:y="+height+":w="+width+":h=50:color=0xeeeeee@0.4:t=max,

当我启动应用程序时,我收到以下错误:

[Parsed_drawbox_2 @ 0x79e9a0] [Eval @ 0x7fffb57f8e70] Undefined constant or missing '(' in 'max'
[Parsed_drawbox_2 @ 0x75f0a0] Error when evaluating the expression 'max'.
[Parsed_drawtext_1 @ 0x759be0] Failed to configure input pad on Parsed_drawbox_2

有人可以提示我在这里做错了什么吗?即使使用文档示例,也会发生相同的错误。还有其他方法可以创建填充框吗?

编辑:

这是stfFilterDesc的内容:

drawtext=fontfile=./fonts/truetype/freefont/HelveticaNeue.ttf: text='foo': x=5: y=5: shadowx=0: shadowy=0: fontsize=12: fontcolor=0xeeeeee@1.0 : box=0: boxcolor=0xeeeeee@0.5, drawbox=x=0:y=490:w=960:h=50:color=0xeeeeee@0.4:t=max, drawtext=fontfile=./fonts/truetype/freefont /HelveticaNeue.ttf: text='foo': x=32:y=(h-text_h-25): fontsize=16: fontcolor=0x333333@1.0: box=0: boxcolor=0xeeeeee@0.4, drawtext=fontfile=. /fonts/truetype/freefont/HelveticaNeue.ttf: text='foo': x=32:y=(h-text_h-10): fontsize=14: fontcolor=0x333333@1.0: box=0: boxcolor=0xeeeeee@0.4

【问题讨论】:

  • 能否打印strFilterDesc 以便我们看到FFMPEG 的实际值?
  • 完整的描述如下:drawtext=fontfile=./fonts/truetype/freefont/HelveticaNeue.ttf: text='foo': x=5: y=5: shadowx=0: shadowy= 0: fontsize=12: fontcolor=0xeeeeee@1.0: box=0: boxcolor=0xeeeeee@0.5, drawbox=x=0:y=490:w=960:h=50:color=0xeeeeee@0.4:t=max, drawtext=fontfile=./fonts/truetype/freefont/HelveticaNeue.ttf: text='foo': x=32:y=(h-text_h-25): fontsize=16: fontcolor=0x333333@1.0: box=0: boxcolor=0xeeeeee@0.4, drawtext=fontfile=./fonts/truetype/freefont/HelveticaNeue.ttf: text='foo': x=32:y=(h-text_h-10): fontsize=14: fontcolor=0x333333@ 1.0: box=0: boxcolor=0xeeeeee@0.4
  • 尝试拆分你的请求,并一一迭代,看看哪一个在搞乱FFMPEG
  • 它的 t=max,因为 max 似乎是未知的
  • 这可能是 drawbox 或文档中的错误。报告为错误#4332: Expression 'max' no longer works with t option in drawbox。在它得到修复之前,您可以使用适当的数值。

标签: c++ ffmpeg


【解决方案1】:

您遇到了错误:#4332 – Expression 'max' no longer works with t option in drawbox

今天(2015 年 3 月 2 日)通过提交 047fd98 修复了这个问题:

commit 047fd986bf3641ad3dc137746097271c339ee5f0
Author: Michael Niedermayer
Date:   Mon Mar 2 02:32:55 2015 +0100

    avfilter/vf_drawbox: Fix handling of max values

    Fixes Ticket4332

    Signed-off-by: Michael Niedermayer

因此,您需要compileget a recent build 才能利用此错误修复。通过FFmpeg download 页面提供的各种静态构建会定期更新。

【讨论】:

    猜你喜欢
    • 2017-12-13
    • 2013-06-24
    • 1970-01-01
    • 2012-01-14
    • 1970-01-01
    • 1970-01-01
    • 2014-02-08
    • 2019-10-22
    • 1970-01-01
    相关资源
    最近更新 更多