ffmpeg – Create time lapse video from other video

ffmpeg – Create time lapse video from other video

To take every 15th frame, use

ffmpeg -i in.mp4 -vf select=not(mod(n,15)),setpts=N/FRAME_RATE/TB out.mp4

Another method is to use the framestep filter

ffmpeg -i in.mp4 -vf framestep=15,setpts=N/FRAME_RATE/TB out.mp4

I had a H264 video from a camera and after lots of attempts found following command that produce 16x faster video with good result and 60 FPS (option -r) that is good for the YouTube timelapse

ffmpeg -i video.avi -r 60 -filter:v setpts=0.0625*PTS -vcodec libx264 -an timelapse.avi

You can check the result here https://www.youtube.com/watch?v=azhRqKQ7kCU

Since you are asking for 1/15 frame it will be 1/15 ~= 0.06667 with 30 FPS result video you will need command

ffmpeg -i video.avi -r 30 -filter:v setpts=0.06667*PTS -vcodec libx264 -an timelapse.avi

ffmpeg – Create time lapse video from other video

Leave a Reply

Your email address will not be published.