Search code examples
videofilterffmpeg

FFMPEG filter instances names don't work with "sendcmd"?


I have two drawbox filter instances that I need to animate separately.
I've used sendcmd for the one instance already, and it worked fine.

But when I've added the second one, I gave a name to both of them like this:

drawbox@one=0:0:iw:ih:red:fill,drawbox@two=0:0:iw:ih:black:fill

Then, I've tried to use sendcmd like this:

drawbox@one=0:0:iw:ih:red:fill,drawbox@two=0:0:iw:ih:black:fill,
sendcmd=c='0.0-5.0 [expr] drawbox@one w W*(T/5)
           0.0-5.0 [expr] drawbox@two h H*(T/5)'

But that didn't work, the rectangles stayed still.

What I am doing wrong?


Solution

  • It was actually a bug in the latest stable build (version 6.0, 2023-03-04) of FFMPEG!
    When I updated it to the latest "master" build, it started to work!

    P.S.: I've also made it work on that release version like this:

    drawbox=0:0:iw:ih:red:fill,drawbox=0:0:iw:ih:black:fill,
    sendcmd=c='0.0-5.0 [expr] Parsed_drawbox_0 w W*(T/5)
               0.0-5.0 [expr] Parsed_drawbox_1 h H*(T/5)'
    

    I found this syntax here - https://ffmpeg.org/pipermail/ffmpeg-user/2017-April/035975.html