Modify image and sound speed


The projection or viewing speed of an audio-visual file should be changed from 24 fps (which is the cinema standard) to 25 fps (which is the “European” television standard).


ffmpeg \
    -i input_file \
    -r 25 \
    -filter_complex \
        "[0:v]setpts=24/25*PTS[v]; \
        [0:a]atempo=25/24[a]" \
    -map "[v]" \
    -map "[a]" \

General command

ffmpeg \
    -i input_file \
    -r output_fps \
    -filter_complex \
        "[0:v]setpts=input_fps/output_fps*PTS[v]; \
        [0:a]atempo=output_fps/input_fps[a]" \
    -map "[v]" \
    -map "[a]" \

Command syntax

starts the command
-i input_file
path, name and extension of the input file
-r output_fps
sets the frame rate of the output file
-filter_complex "[0:v]setpts=input_fps/output_fps*PTS[v]; [0:a]atempo=output_fps/input_fps[a]"
A complex filter is needed (see the discussion below).
-map "[v]"
maps the video stream and
-map "[a]"
maps the audio stream together into:
path, name and extension of the output file


A complex filter is needed here, in order to handle video stream and the audio stream separately. Please note that, sadly, the parameter’s order for the image and for the sound are a little… confusing.

  • The video filter setpts modifies the PTS (presentation time stamp) of the video stream. The numerator input_fps sets the input speed and the denominator output_fps sets the output speed; both values are given in frames per second.
  • The sound filter atempo modifies the speed of the audio stream while keeping the same sound pitch. The numerator output_fps sets the output speed and the denominator input_fps sets the input speed; both values are given in frames per second.

The quotation marks allow to insert a space between the filters for readability. Complex filters start with a named input and end with a named output, where a is an audio stream and v a video stream. Except for the starting names, which are given, all the other names can be chosen freely. Different complex filters are divided by a semicolon.

As usual in the IT world, the numbering of the channels starts at 0 and not at 1 (“zero-based numbering”).