Convert a video to a time lapse video

Sometimes you want to have a video playback shortend to reduce the time a view needs to see the full length of the video. For this we need to speed up the video playback. This is typically done by dropping frames during the playback to reduce the amount of time.
ffmpeg is using exactly this feature to make your video a time lapse video.

Time lapse your video by 2x factor to a still video with ffmpeg

To halfen the playback time and therefore to double the lime lapse speed the following command will help you. Also the following command is removing your audio channel.

ffmpeg -i input.mp4 -filter:v "setpts=0.5*PTS" -an output.mp4
  • -filter:v “setpts=0.5*PTS”
    tells the ffmpeg video filter to use the half amount of the presentation timestamps, resulting in a half length video and thus into a doubled speed of playback of the resulting video
  • -an
    tell the ffmpeg to remove the audio channel, and thus resulting in a silent movie

ffmpeg time lapse video with bigger factor as 2x

Due to internal limitations you can only work in the double or half range. So your setpts can only be inbetween 0.5 to 2. To do a 4x timelapse would require you to run the filter twice. Which would result into following command:

ffmpeg -i input.mp4 -filter:v "setpts=0.5*PTS,setpts=0.5*PTS" -an output.mp4

In this command you see the both setpts=0.5PTS separated by a comma. This tells ffmpeg to run the video filter twice, which results into a 0.25*PTS value, which itself is a quarter of the input video length or a speed up of the video by 4x factor.

Time lapse your video and audio channel by 2x factor

You may have the requirement to time lapse the video and the audio by 2x factor. This would result into a more complex command with a complex ffmpeg filter usage

ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mp4

With these examples you shall be able to handle most of your cases required for a time lapse of your input video