Calculate frame rate

The Transcoder API calculates the frame rate for the output video given the frame rate of the input video and the output frame rate you specify. You specify the output frame rate, in frames per second (FPS), using the frameRate field. The provided frameRate must always be less than or equal to 120 FPS.

If the provided frameRate is a non-standard value, then it is rounded to the closest value with three decimal places. For example, the value 23.12345 is rounded to 23.123 and results in a time base of 1000/23123.

Frame rate conversion strategies

In cases where the output frame rate does not match the input frame rate, two frame rate conversion strategies are supported using the frameRateConversionStrategy field. Set the field to one of the following:

  • DROP_DUPLICATE: Drops or duplicates frames to match the specified output frame rate. To set an exact FPS value, set the frameRateConversionStrategy to this option. You must also disable optimization for the job (set optimization to DISABLED).

    With this option, you can set an exact output FPS value for any given input FPS value.

  • DOWNSAMPLE: The default frame rate conversion strategy if no strategy is specified. Keeps every Nth frame. N is the downsample factor that is determined by the formula (input frame rate / target frame rate).

    For the DOWNSAMPLE option, the target video frame rate:

    • Defaults to the input frame rate if the target frame rate is larger than the input frame rate; the Transcoder API does not create new video frames.
    • Is always larger than or equal to the actual output frame rate. The input frame rate is divisible by the actual output frame rate.

For the DOWNSAMPLE option, the following table shows the computed output video frame rate given the input frame rate (in the first column) and the target frame rate (in subsequent columns). All frame rates are given in FPS.

Input (30) (60) (25) (50)
240 Fail Fail Fail Fail
120 30 60 20 40
100 25 50 25 50
50 25 50 25 50
60 30 60 20 30
59.94 29.97 59.94 19.98 29.97
48 24 48 24 48
30 30 30 15 30
25 25 25 25 25
24 24 24 24 24
23.976 23.976 23.976 23.976 23.976
15 15 15 15 15
12 12 12 12 12
10 10 10 10 10