0
votes

I've switched from FFmpeg version 1.2. to the last 2.5 release. After changing all deprecated methods I ran into a problem with a drawbox filter. In version 1.2 I could define a filled box with the following settings (see FFmpeg Filter Documentation):

strFilterDesc += "drawbox=x=0:y="+height+":w="+width+":h=50:[email protected]:t=max,

When I start the application, I receive the following errors:

[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

Can someone give me a hint what I'm doing wrong here? Even with the example of the documentation the same error occurs. Is there an other way to create a filled box?

Edit:

Here's the content of stfFilterDesc:

drawtext=fontfile=./fonts/truetype/freefont/HelveticaNeue.ttf: text='foo': x=5: y=5: shadowx=0: shadowy=0: fontsize=12: [email protected]: box=0: [email protected], drawbox=x=0:y=490:w=960:h=50:[email protected]:t=max, drawtext=fontfile=./fonts/truetype/freefont/HelveticaNeue.ttf: text='foo': x=32:y=(h-text_h-25): fontsize=16: [email protected]: box=0: [email protected], drawtext=fontfile=./fonts/truetype/freefont/HelveticaNeue.ttf: text='foo': x=32:y=(h-text_h-10): fontsize=14: [email protected]: box=0: [email protected]

1
Could you print the strFilterDesc so we see the actual value given to FFMPEG ? - Thomas Ayoub
The full desc looks like: drawtext=fontfile=./fonts/truetype/freefont/HelveticaNeue.ttf: text='foo': x=5: y=5: shadowx=0: shadowy=0: fontsize=12: [email protected]: box=0: [email protected], drawbox=x=0:y=490:w=960:h=50:[email protected]:t=max, drawtext=fontfile=./fonts/truetype/freefont/HelveticaNeue.ttf: text='foo': x=32:y=(h-text_h-25): fontsize=16: [email protected]: box=0: [email protected], drawtext=fontfile=./fonts/truetype/freefont/HelveticaNeue.ttf: text='foo': x=32:y=(h-text_h-10): fontsize=14: [email protected]: box=0: [email protected] - FredFloete
Try to split your request and iterate one by one to see which one is messing with FFMPEG - Thomas Ayoub
Its the t=max, because max seems to be unknown - FredFloete
This is likely either a bug in drawbox or in the documentation. Reported as bug #4332: Expression 'max' no longer works with t option in drawbox. Until it gets fixed you can use an appropriate numerical value. - llogan

1 Answers

1
votes

You encountered a bug: #4332 – Expression 'max' no longer works with t option in drawbox.

This was fixed today (2015 March 2) with commit 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

So you will need to compile or get a recent build to take advantage of this bug fix. The various static builds available via the FFmpeg download page are updated regularly.