[FFmpeg-user] Problem with time-lapse

Edward Park kumowoon1025 at gmail.com
Thu Sep 10 02:19:48 EEST 2020


> ffmpeg -i /mnt/ramdisk3g/workdir/%d.jpg -r 120 -vcodec mpeg4 -qsale 1 -y
> -filter:v " setpts=0.23*PTS"'' /mnt/ramdisk/mp4/
> And the result is this
> https://drive.google.com/file/d/1acRm7vWwJAXz1jEU66nuD7Db9mrtPuz-/view?usp=sharing
> In workdir i have multiplied every image 6 times with python counter loop
> and total number of files are 1374 when there is only 229
> Iam pretty happy to results now. Not sure how that minterpolate works but i
> will try use that too.

Glad you got something that works for you, but tbh what I suggested was basically to do nothing, just make a super fast slideshow, essentially.

That example video wasn't even made using FFmpeg, I opened 110 frames from your sample in an image viewer and held down the arrow key to "animate" them, a book-corner doodle flipbook on a computer, if you will.

It's fine as long as it works, but I think you can still eliminate some steps.

For example you said you multiplied each image 6 times, I'm guessing that means you made 6 identical files, so the same frame is on screen 6 times, which makes the video 6× slower.

IIRC, images read in get timestamped as if 25fps by default, but you can change it, instead of actually duplicating the images (-framerate 25/6).

Then the "setpts=0.23*PTS" basically increases the speed by 1/0.23 ≈ 4.3×, around 109fps.

The final framerate is fixed at 120fps with "-r 120" (which I assume is necessary) which duplicates frames to fill 120 from the ~109fps that is available.

I just feel like this is too much stretching and shrinking the "tape" to get an effective 25/6/0.23 fps, or 12.61 seconds if you are adjusting by length. All you need to do is set the rate you want before the input.

https://media.kumowoon1025.com/videos/example/starvideo-deduplication-cf.mp4 <https://media.kumowoon1025.com/videos/example/starvideo-deduplication-cf.mp4>

The "-r" option will duplicate the frames as needed to reach the fps you set. The minterpolate filter will try to improve upon that by interpolating between frames to generate the "in-between" frames to fill in by analyzing the existing ones instead of simply duplicating them. There's not a lot of obvious motion here, so try blend as the mode (I think this may have been what you had in mind with tblend at the start)

https://media.kumowoon1025.com/videos/example/starvideo-minterpolate.mp4 <https://media.kumowoon1025.com/videos/example/starvideo-minterpolate.mp4>

Ted Park

More information about the ffmpeg-user mailing list