1
votes

I am using ffmpeg to create looping video, where looping is totally smooth, same as moving between all frames. I have 27 images, which one transforms in another, so frame 0 = frame 27 I use -vf minterpolate=fps=30 between images, so transition is very smooth. I have -framerate 10, so in theory interpolation filter creates 3 additional frames. So I remove 27'th frame and creating a video

ffmpeg -framerate 10 -start_number 0 -i ./motion/%d.png -vf "minterpolate=fps=30"

But when it looping, there no transition between 0 and last frame, and it is not smooth. How to create a smooth transition between loops? I tried to leave 27'th frame and when gluing video, delete last frame, which is repeating. but don't know how to cut only one frame, by time it failed.

Please help me get smooth loop with minterpolate filter.

2

2 Answers

1
votes

If I understand you correctly, there's no interpolation from last frame to first frame when it loops. The quick solution is to copy the first frame and rename it to make it the last frame. So if 1.png is the first image and 27.png is the last, then duplicate 1.png as 28.png. Now, run your current command. At the loop joint, you will have one extra frame of 1/28.png which repeats. This will increase video duration by 0.033 seconds. If you need to remove it, apply trim=end_frame=83 after the minterpolate.

0
votes

I unpacked interpolated the video back into frames and saw, that something is wrong in beginning, between first frames. Maybe minterpolate skip something, but I resolved it using trim=start_frame=81:end_frame=162, so I generated twice more images and cutting it after first loop. I know, it is overhead, and tried to just add 3-4 extra frames, but only this combination worked well.

@Mulvya, thanks for the answer, you helped me a lot