Stay organized with collections
Save and categorize content based on your preferences.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[],[],null,["# Calculate frame rate\n\nThe Transcoder API calculates the frame rate for the output video given the\nframe rate of the input video and the output frame rate you specify. You specify\nthe output frame rate, in frames per second (FPS), using the\n[`frameRate`](/transcoder/docs/reference/rest/v1/JobConfig#H264CodecSettings.FIELDS.frame_rate)\nfield. The provided\n[`frameRate`](/transcoder/docs/reference/rest/v1/JobConfig#H264CodecSettings.FIELDS.frame_rate)\nmust always be less than or equal to 120 FPS.\n\nIf the provided\n[`frameRate`](/transcoder/docs/reference/rest/v1/JobConfig#H264CodecSettings.FIELDS.frame_rate)\nis a non-standard value, then it is rounded to the closest value with three\ndecimal places. For example, the value 23.12345 is rounded to 23.123 and results\nin a time base of 1000/23123.\n\nFrame rate conversion strategies\n--------------------------------\n\nIn cases where the output frame rate does not match the input frame rate, two\nframe rate conversion strategies are supported using the\n[`frameRateConversionStrategy`](/transcoder/docs/reference/rest/v1/JobConfig#H264CodecSettings.FIELDS.frame_rate_conversion_strategy)\nfield. Set the field to one of the following:\n\n- `DROP_DUPLICATE`: Drops or duplicates frames to match the specified output\n frame rate. To set an exact FPS value, set the `frameRateConversionStrategy`\n to this option. You must also disable optimization for the job (set\n [`optimization`](/transcoder/docs/reference/rest/v1/projects.locations.jobs#Job.FIELDS.optimization)\n to\n [`DISABLED`](/transcoder/docs/reference/rest/v1/projects.locations.jobs#optimizationstrategy)).\n\n With this option, you can set an exact output FPS value for any given input\n FPS value.\n- `DOWNSAMPLE`: The default frame rate conversion strategy if no strategy is\n specified. Keeps every *N* th frame. *N* is the downsample factor that is\n determined by the formula (input frame rate / target frame rate).\n\n For the `DOWNSAMPLE` option, the target video frame rate:\n - 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.\n - Is always larger than or equal to the actual output frame rate. The input frame rate is divisible by the actual output frame rate.\n\nFor the `DOWNSAMPLE` option, the following table shows the computed output video\nframe rate given the input frame rate (in the first column) and the target frame\nrate (in subsequent columns). All frame rates are given in FPS."]]