2

I'd like to overlay a png onto a video at a certain timestamp and have the video pause (loop) on that frame for X seconds with the overlay. What would be the best method to accomplish this?

1 Answer 1

2

Let's call the video frame rate F. And the start time of the overlay t

Use

ffmpeg -i in.mp4 -i ol.png -filter_complex
         "[0]trim=0:t,loop=X*F:1:t*F,setpts=N/FRAME_RATE/TB[fol];
          [0]trim=t,setpts=N/FRAME_RATE/TB[post]
          [fol][1]overlay[pre];[pre][post]concat" out.mp4

The loop filter accepts frame index numbers, so you have to convert your start time and loop time to frame counts and substitute with those values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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