I noticed that ffmpeg doesn't always scale the duration of a clip to the desired value ( even accounting for milliseconds of precision loss.) For example, whenever I attempt to scale the duration of this tiny 67ms clip to 7 seconds:
ffmpeg -i input.avi -filter:v "setpts=(7/0.067)*PTS" -an output.avi
the resulting video is only 3.5 seconds in duration.
Not really sure why this is off by multiple seconds, but I suspect it has something to do with the input clip itself ( which is only 2 frames @ 29.97 fps ) So far, I've discovered that if I scale the duration to a much larger value first, then scale back from that to 7 seconds, it works fine:
ffmpeg -i input.avi -filter:v "setpts=(1000)*PTS" -an input_scaled_high.avi
ffmpeg -i input_scaled_high.avi -filter:v "setpts=(7/33.400033)*PTS" -an output.avi
But I'm hoping I don't need to resort to an intermediate file. Is it possible to solve this with a single ffmpeg call?
If it helps, here is the video file I'm working with: https://drive.google.com/drive/folders/1hI5Xo6kfAfMd8ZylM6XrPX5fuO88gncE?usp=sharing
Note: I should mention that I don't need sound at all in this experiment ( hence the -an
)