Modify image speed

Problem

The projection or viewing speed of a video should be changed from 25 fps as digitised to 18 fps as shot.

Solution

ffmpeg \
    -i input_file \
    -filter:v "setpts=25/18*PTS" \
    -an \
    output_file

General command

ffmpeg \
    -i input_file \
    -filter:v "setpts=input_fps/output_fps*PTS" \
    -an \
    output_file

Command syntax

ffmpeg
starts the command
-i input_file
path, name and extension of the input file
-filter:v "setpts=input_fps/output_fps*PTS"
modifies the presentation time stamp (PTS)
-an
no audio stream (mnemonically «audio no»)
output_file
path, name and extension of the output file

Discussion

During film digitisation the speed of sound video is usually used, witch is 25 fps (frames per second) in «Europe». Yet silent and amateur films haven often been shot at a lower frame rate, like 16 or 18 fps.

The video filter is specified by -filter:v. We advise to avoid the alias -vfilter and its abbreviation -vf as well. The video filter setpts is used. 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 quotation marks are not mandatory.

The -an parameter prevents copying an empty soundtrack, as sometime scanners add one by default.


2016–07–03