Categories: Development

Speed up and slow down video with FFmpeg

How to speed up or slow down video using FFmpeg.

-filter:v "setpts="

Is the method to achieve this.

The documentation states that for fast motion:

-filter:v setpts=0.5*PTS

Slow motion:

-filter:v setpts=2.0*PTS

In this case it will be 2 times slower and for the speed up it is now 50% faster.

ffmpeg -i input.mp4 -filter:v "setpts=0.5*PTS" faster.mp4

The filter PTS drops frames to achieve speed change and this change only applies to video not the audio.

To change the speed of audio atempo is the filter to use:

-filter:a "atempo=2.0"

atempo has a limit of 0.5 to 2.0 getting around this is done by:

-filter:a "atempo=2.0,atempo=2.0"

 

 

Share
Tags: FFmpegHow to

Recent Posts

Kennington reservoir drained drone images

A drained and empty Kennington reservoir images from a drone in early July 2024. The…

2 years ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

2 years ago

Early September spring shots

Some early September spring shots from a bushwalk, It is still too early for wildflowers.

3 years ago

Cloning an NVMe to SK Hynix Platinum P41 NVMe

I recently needed to clone over a smaller NVMe to a 2TB SK Hynix Platinum…

3 years ago

Using Laravel’s deleteDirectory to delete folders and their contents

If you ever needed a simple solution in Laravel to delete an entire directory and…

3 years ago

How to allow only 1 user to register in a Laravel application

How to enforce only one user to register or be registered in a Laravel web…

3 years ago