Ffmpeg drawbox on a specific frame

I have thousands of rectangles to add to the video. I am using this command now:

ffmpeg.exe -i small.ts -vf drawbox=10:10:50:50:red,drawbox=100:100:200:200:green small_with_box.ts

However, I do not want to add fields to the entire frame, but for now. Does anyone know how I can do this?

+2
source share
1 answer

The filter drawboxhas timeline editing support. You can see which filters support timeline editing:

$ ffmpeg -filters
Filters:
  T. = Timeline support
  .S = Slice threading
  A = Audio input/output
  V = Video input/output
  N = Dynamic number and/or type of input/output
  | = Source or sink filter
 .. deshake          V->V       Stabilize shaky video.
 T. drawbox          V->V       Draw a colored box on the input video.
 T. drawgrid         V->V       Draw a colored grid on the input video.

You can see that drawboxthey drawgridhave timeline support, but deshakecurrently does not.

. 28-32, 60 . . .

ffmpeg -i small.ts -vf "drawbox=enable='between(n,28,32)' : x=10 : y=10 : w=50 \
: h=50 : color=red,drawbox=enable='gte(t,60)' : x=100 : y=100 : w=200 : \
h=200 : color=green" -codec:a copy small_with_box.ts
+8

All Articles