Change Video Frame Rate Without Re-encoding FFmpeg

Changing a video’s frame rate usually requires re-encoding, which takes time and causes quality loss. However, if you want to alter the playback speed or change the container-level frame rate metadata without modifying the raw video frames, FFmpeg can do this losslessly in seconds. This article explains the most efficient methods to change container-level frame rates and timestamps using FFmpeg’s stream copying features.

Method 1: Using the Timestamp Scaling Flag (-itsscale)

The easiest way to speed up or slow down a video at the container level is to scale the presentation timestamps (PTS) during the stream copy process. This changes the playback speed and the effective frame rate without altering the raw video packets.

To speed up a video (e.g., make it play twice as fast, doubling the frame rate):

ffmpeg -itsscale 0.5 -i input.mp4 -c:v copy -an output.mp4

To slow down a video (e.g., make it play at half speed, halving the frame rate):

ffmpeg -itsscale 2.0 -i input.mp4 -c:v copy -an output.mp4

Note: The -an flag is included because changing video timestamps without re-encoding will desynchronize the audio. It is usually best to strip the audio or process it separately.

Method 2: Demuxing to Raw Bitstream and Remuxing

For containers like MP4, the frame rate is strictly defined in the container headers. If you want to force the container to read the video frames at a completely different specific frame rate (for example, interpreting a 24 fps video as 60 fps), you can extract the video to a raw bitstream and then remux it with a new frame rate flag.

Step 1: Extract the video to a raw bitstream

ffmpeg -i input.mp4 -c:v copy -an -bsf:v h264_mp4toannexb raw.h264

(Use hevc_mp4toannexb if your source video is H.265/HEVC).

Step 2: Remux the raw stream with the new frame rate

ffmpeg -r 60 -i raw.h264 -c:v copy output.mp4

By passing the -r flag before the input raw file (-i raw.h264), FFmpeg forces the container to tag the video at 60 frames per second without touching the underlying compressed video data.

Method 3: Using Bitstream Filters (H.264/H.265 Metadata)

If your video is H.264 or H.265, you can use FFmpeg’s internal bitstream filters to modify the frame rate parameters (specifically the tick_rate and num_units_in_tick parameters in the VUI parameters) directly during a stream copy.

To change an H.264 video to a flat 30 fps container-level designation:

ffmpeg -i input.mp4 -c:v copy -bsf:v h264_metadata=tick_rate=30000/1001:num_units_in_tick=1000 output.mp4

This method rewrites the metadata header inside the video stream on the fly, allowing you to bypass the need to demux and remux raw streams.