Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En esta página, se explica cómo insertar de manera programática fotogramas clave para pausas publicitarias en un video transcodificado. La API de Transcoder no inserta ni reproduce anuncios, ni detiene la reproducción de contenido multimedia, los clientes del reproductor de video son responsables de administrar el fotograma clave.
En la siguiente configuración de REST/JSON, se insertan fotogramas clave de pausa publicitaria en los segundos 4, 7 y 11 en el cronograma del video resultante:
Puedes usar una herramienta como ffprobe para verificar que se hayan insertado los fotogramas clave. En el siguiente resultado, se muestra un ejemplo de video de salida sin fotogramas clave de pausa publicitaria insertadas:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[],[],null,["# Inserting ad breaks\n\nThis page explains how to programmatically insert keyframes for ad breaks in a\ntranscoded video. The Transcoder API does not insert or play ads, or\nstop media playback; video player clients are responsible for handling the\nkeyframe.\n\nUse the [`adBreaks`](/transcoder/docs/reference/rest/v1/JobConfig) array to\ninsert\n[ad break keyframes](/transcoder/docs/reference/rest/v1/JobConfig#adbreak)\nin the output video. You can add this configuration to a\n[job template](/transcoder/docs/how-to/job-templates) or include it in an\n[ad-hoc job configuration](/transcoder/docs/how-to/jobs#create_jobs_ad_hoc).\n\nThe following REST/JSON configuration inserts ad break keyframes at 4, 7, and 11\nseconds in the timeline of the output video: \n\n \"adBreaks\": [\n {\n \"startTimeOffset\": \"4s\"\n },\n {\n \"startTimeOffset\": \"7s\"\n },\n {\n \"startTimeOffset\": \"11s\"\n }\n ],\n\nYou can use a tool like\n[`ffprobe`](https://ffmpeg.org/ffprobe.html) to verify that the\nkeyframes were inserted. The following output shows a sample output video\n*without* ad break keyframes inserted: \n\n $ ffprobe -loglevel error -skip_frame nokey -select_streams v:0 -show_entries \\\n frame=pkt_pts_time -of csv=print_section=0 hd.mp4\n 0.000000\n 3.000000\n 6.000000\n 9.000000\n 12.000000\n ...\n\nThe following output shows the same output video timeline with ad break\nkeyframes inserted: \n\n $ ffprobe -loglevel error -skip_frame nokey -select_streams v:0 -show_entries \\\n frame=pkt_pts_time -of csv=print_section=0 hd.mp4\n 0.000000\n 3.000000\n 4.000000 \u003c\u003c\u003c Inserted keyframe here\n 6.000000\n 7.000000 \u003c\u003c\u003c Inserted keyframe here\n 9.000000\n 11.000000 \u003c\u003c\u003c Inserted keyframe here\n 12.000000\n ...\n\nYou can also check the output\n[manifest file](/transcoder/docs/reference/rest/v1/JobConfig#manifest) to\nverify that the ad break tags were inserted."]]