Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
L'API Transcoder calcola la frequenza fotogrammi del video di output in base alla frequenza fotogrammi del video di input e a quella di output specificata. Specifica
la frequenza fotogrammi in uscita, in frame al secondo (FPS), utilizzando il
campo
frameRate. Il valore fornito per frameRate deve sempre essere inferiore o uguale a 120 FPS.
Se il valore fornito
frameRate
è un valore non standard, viene arrotondato al valore più vicino con tre cifre decimali. Ad esempio, il valore 23.12345 viene arrotondato a 23.123 e genera
una base di tempo di 1000/23123.
Strategie di conversione della frequenza fotogrammi
Se la frequenza frame in uscita non corrisponde a quella in entrata, sono supportate due strategie di conversione della frequenza frame utilizzando il campo frameRateConversionStrategy. Imposta il campo su uno dei seguenti valori:
DROP_DUPLICATE: elimina o duplica i frame in modo che corrispondano alla frequenza
di frame in uscita specificata. Per impostare un valore FPS esatto, imposta frameRateConversionStrategy su questa opzione. Devi anche disattivare l'ottimizzazione per il job (imposta
optimization
su
DISABLED).
Con questa opzione, puoi impostare un valore FPS di output esatto per qualsiasi valore FPS di input.
DOWNSAMPLE: la strategia di conversione della frequenza frame predefinita se non viene specificata alcuna strategia. Mantiene ogni Nesimo frame. N è il fattore di riduzione che viene determinato dalla formula (frequenza frame di input / frequenza frame target).
Per l'opzione DOWNSAMPLE, il frame rate video target:
Il valore predefinito è la frequenza fotogrammi di input se la frequenza fotogrammi target è superiore alla frequenza fotogrammi di input. L'API Transcoder non crea nuovi fotogrammi video.
È sempre maggiore o uguale alla frequenza fotogrammi di output effettiva. La frequenza frame di input è divisibile per la frequenza frame di output effettiva.
Per l'opzione DOWNSAMPLE, la tabella seguente mostra la frequenza frame video di output calcolata in base alla frequenza frame di input (nella prima colonna) e alla frequenza frame di destinazione (nelle colonne successive). Tutte le frequenze fotogrammi sono indicate in FPS.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 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."]]