How can I overlay PNG image sequence but start at particular frame using FFmpeg?

0

I've tried a million things here. This overlays the PNG at the right time, but the sequence itself doesn't start then, it is appearing in its finished state.

ffmpeg -i C:\projects\src\assets\video\base.mp4 -r 25 
-itsoffset 24.24 -i C:\projects\temp\q\s\xyz%03d.png -y 
-filter_complex [0:v]overlay=x=0:y=0:enable='between(t,438/25,606/25)'[out] 
-map [out] -map 0:a C:\projects\temp\q\composit.mp4

I need the image sequence xyz000 to start its sequence at frame 438 (438/25 == 24.24) and disable again at frame 606 (the length of the sequence).

I've tried multiple different things here but nothing seems to work.

Any ideas?

Shannon Hochkins

Posted 2018-07-01T04:08:29.193

Reputation: 101

Answers

1

Don't set input -r. It regenerates fresh timestamps at that rate. Whereas what itsoffset does is offset the native timestamps by some amount. Use -framerate instead.

ffmpeg -i C:\projects\src\assets\video\base.mp4 -framerate 25
-itsoffset 24.24 -i C:\projects\temp\q\s\xyz%03d.png -y
-filter_complex [0:v]overlay=x=0:y=0:enable='between(t,438/25,606/25)'[out]
-map [out] -map 0:a C:\projects\temp\q\composit.mp4

If you are using a sh-like shell, you'll need to escape commas i.e. (t,438/25,606/25) should be written as (t\,438/25\,606/25)

Gyan

Posted 2018-07-01T04:08:29.193

Reputation: 21 016