ffmpeg- dynamic drawbox I'd like to apply a dynamic drawbox before a drawtext, for example, with a fixed Y , X and H but with a dynamic W.

This is a trivial example: 

/usr/bin/ffmpeg -y -loop 1 -t 5 -i img001.jpg -vf drawbox=x=0:y=0:w=t*300:h=100:color=red@0.5 -y out.mp4


I expect to see a rectangle with the base width that increase with the time; it does not work, the box width is alwais fixed.

Is it possible to create a dynamic drawbox? if not, is there an alternative?
Since drawbox doesn't support time reference, you need to use a workaround

ffmpeg -y -loop 1 -t 5 -i img001.jpg
  -filter_complex "color=red@0.5:s=Wx100[c];
                   [0][c]overlay='-W+300*t':0"
  -y out.mp4


A color source is created equal to the final size of the box you wanted to draw i.e. image width (W) x 100. Then it is overlaid on the image and animated so that it starts revealing at the rate of 300*t.