1

I am trying to overlay a transparent .mov video towards the end of another using ffmpeg, however when adding an enable condition to the overlay filter the mov video becomes static, like overlaying an image the last frame.

when doing this and overlaying from the start it works properly:

ffmpeg -i video.mp4 -i overlay.mov -filter_complex "[0][1]overlay=0:0" output.mp4

however if I add the condition to put it at the end the mov video becomes a static image of its last frame

ffmpeg -i video.mp4 -i overlay.mov -filter_complex "[0][1]overlay=0:0:enable='gt(t,57)" output.mp4

same if I use enable between.

Also I'd like to ask if there's a way to express the duration of the video in the enable parameter as I need to do the above automatically in software, right now I am probing the duration of the files in java and subtracting to determine the start duration, is there a way to do it directly in the command? (something like oh,ow etc. for size but for time).

Edit: it's actually like this with all videos not just with .mov's

Teddy Tsai
  • 414
  • 1
  • 13
  • *"if there's a way to express the duration of the video in the enable parameter as I need to do the above automatically in software"* No. You have to [use ffprobe to get the duration](https://superuser.com/a/945604) and perform the calculations in your script. – llogan Oct 28 '21 at 16:03
  • @llogan That's what I am using right now, just wondered if there was a better way to do it since ffprobe takes some time. Setpts does solve the problem, thanks a lot man! – Teddy Tsai Oct 29 '21 at 02:31
  • ffprobe is near instantaneous for me. – llogan Oct 29 '21 at 03:44

0 Answers0