Framerate conversion

Input duration

  • 1500 frames
  • = 60 second(s)
  • = 1 minute(s)

Conversion 'conform': 25 → 24fps

  • The total # of frames 1500 stays the same.
  • Frames are played at 24 instead of 25 (slower).
  • The video speed will slow down by 4%
  • As a result, the audio will sound lower
  • To correct the audio: pitch up by 4.167% (0.707 semitones)
  • Video conversion:
    ffmpeg -i [input] -r 24 -filter:v "setpts=1.0417*PTS" -y [output]
  • Audio conversion:
    sox [input] [output] tempo 0.96
    ffmpeg -i [input] -filter:a "atempo=0.96" -vn [output]
  • Duration of output = 62.500 sec (1500 frames)

Conversion 'interpolate': 25 → 24fps

  • The total duration 60 sec stays the same.
  • Frames are recalculated/interpolated based on the original frames
  • # frames of output = 1440 frames
  • Naive conversion: drop a frame every 25 frames
  • Video conversion:
    ffmpeg -i [input] -r 24 -y [output]
  • Audio conversion: nothing to do, sound stays as-is

Explanation

  • Calculate # frames from time duration and vice versa. e.g. 93 sec @ 24fps = 2232 frames
  • Calculate how audio and video should be manipulated to change from one framerate to another, using soxand/orffmpeg
  • When is this necessary? If you have a video that was recorded in 25fps(PAL) or 30fps(NTSC), and you want to show it on a cinema screen: you have to convert the framerate to 24 fps.