Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#9681 closed enhancement (fixed)

drawbox enhancement

Reported by: Jozef Chutka Owned by:
Priority: normal Component: avfilter
Version: unspecified Keywords: drawbox
Cc: Jozef Chutka Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I would like to propose the enhancement for drawbox:

  • add time related constants n (frame) and time (btw t is reserved for thickness)
  • add eval=frame so drawbox is able to recalculate based on changed n, time or dynamic input size ih, iw
  • add enable option so there is a way to restrict its availability/rendering

With these in place, one could draw in-video progress bars, but I believe these extensions are generic enough for solid use in different cases as well.

Currently there is an option to use [color+overlay](https://stackoverflow.com/questions/62989964/showing-in-video-visual-progress-bar-with-ffmpeg), however imagine drawing border progress bar (see attachment) which is 4x2 filters already, and I can imagine drawbox performs faster then either of color or overlay alone.

Thanks for all the hard work.

Attachments (1)

borderprogressbar.jpg (20.6 KB ) - added by Jozef Chutka 2 years ago.

Download all attachments as: .zip

Change History (4)

by Jozef Chutka, 2 years ago

Attachment: borderprogressbar.jpg added

comment:1 by Michael Koch, 2 years ago

It does already have the "enable" option. The problem is only that you don't see it in the documentation. You can use this command to check which filters have timeline support:
ffmpeg -filters

Michael

comment:2 by Elon Musk, 2 years ago

Resolution: fixed
Status: newclosed

Fixed in 13a153d801011c4ec82b90af1351e10dcf1754e1

Demo:

mpv av://lavfi:gradients=d=100,format=rgb0 -vf "lavfi=[sendcmd=0.0-100.0 \[expr\] drawbox@1 w (TI+0.001)*W,drawbox@1=x=0:y=ih-t:w=0:h=5:c=red:replace=1,sendcmd=0.0-100.0 \[expr\] drawbox@2 y (1-TI)*H,drawbox@2=x=0:y=h:w=5:h=0:c=red:replace=1]"

comment:3 by Jozef Chutka, 2 years ago

This is great, thanks for an express fix.

Potentially related, I am openning https://trac.ffmpeg.org/ticket/9686#ticket

I would also like to understand the syntax from Elon's demo, completely alien to me -vf "lavfi=[...]" ? Whats the benefit of having filter graph wrapped inside lavfi=[...]?

Note: See TracTickets for help on using tickets.