I want to remove a portion of the video between say coordinates (x,y) and (m,n), where (x,y) are the upper left coordinates while (m,n) are the lower right ones. Is there a ffmpeg command I could use?

  • Do you want to overlay an opaque box on top? – Gyan Dec 5 '17 at 9:37
  • Basically yeah! – JSzy Dec 5 '17 at 16:24

You can use the drawbox filter to umm. draw a box on top of the video.

Basic syntax is

ffmpeg -i in.mp4 -vf "drawbox=X:Y:M-X:N-Y:c=black:t=fill" -c:a copy out.mp4

where X, Y are replaced with top-left co-ordinates of box. M-X and N-Y are width and height of the box. The value fill for thickness will make a solid box. This value was very recently changed, so if you have an older version of ffmpeg, use max instead.

  • Thanks! Can I simply replace fill with max or does max have a different syntax, sorry I'm very new to this. – JSzy Dec 6 '17 at 4:24
  • Yes, simply replace fill with max. – Gyan Dec 6 '17 at 6:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.