Opciones de manifiesto

En esta guía se describe la función de opciones de manifiesto admitidas de la API Video Stitcher. Esto te permite personalizar el manifiesto de vídeo combinado. Las opciones del manifiesto se configuran en la solicitud de creación de la sesión. Para obtener más información, consulta lo siguiente:

Antes de empezar

Familiarízate con los conceptos y la terminología introductorios de la API Video Stitcher. Para obtener más información, consulta el resumen técnico.

Introducción

De forma predeterminada, el archivo de manifiesto del vídeo combinado contendrá las mismas representaciones multimedia que el archivo de manifiesto del vídeo de origen. El manifiesto de origen puede contener varias representaciones multimedia que no todos los reproductores pueden reproducir. Por ejemplo, un vídeo codificado puede contener códecs de vídeo H.264 y H.265, pero un reproductor de un dispositivo solo puede reproducir H.264.

Si especifica qué códecs o bitrates quiere incluir en el manifiesto de vídeo, puede especificar qué representaciones de vídeo quiere generar en el manifiesto de vídeo combinado.

Opciones de manifiesto

El objeto ManifestOptions te ofrece algunas opciones para personalizar el manifiesto de vídeo combinado.

HLS

Puedes personalizar lo siguiente en los archivos de manifiesto de vídeo HLS combinados:

  • Filtrar por códecs
  • Incluir solo determinadas resoluciones de vídeo
  • Incluir solo determinadas velocidades de fotogramas
  • Incluir solo determinados bitrates
  • Ordenar las representaciones de vídeo

En las siguientes secciones, se presupone el siguiente manifiesto de vídeo de origen:

#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=440000,RESOLUTION=1920x1080,CODECS="avc1.42e00a,mp4a.40.2,FRAME-RATE=25.000"
h264/fhd/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=150000,RESOLUTION=640x360,CODECS="avc1.42e00a,mp4a.40.2,FRAME-RATE=25.000"
h264/sd/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=240000,RESOLUTION=1280x720,CODECS="avc1.42e00a,mp4a.40.2,FRAME-RATE=25.000"
h264/hd/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=400000,RESOLUTION=1920x1080,CODECS="hvc1.1.4.L126.B0,mp4a.40.2,FRAME-RATE=50.000"
h265/fhd/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=100000,RESOLUTION=640x360,CODECS="hvc1.1.4.L126.B0,mp4a.40.2,FRAME-RATE=50.000"
h265/sd/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=200000,RESOLUTION=1280x720,CODECS="hvc1.1.4.L126.B0,mp4a.40.2,FRAME-RATE=50.000"
h265/hd/index.m3u8

Filtrar por códecs

Para filtrar la representación de vídeo por códecs, define los códecs en el campo manifestOptions opcional al crear una sesión. Por ejemplo, para mostrar solo H.264 en el manifiesto combinado, define el códec en la matriz includeRenditions:

{
  "manifestOptions": {
    "includeRenditions": [
      {
        "codecs": "avc1.42e00a,mp4a.40.2",
      },
    ],
  },
}

En el archivo de manifiesto combinado se mostrará lo siguiente:

#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=440000,RESOLUTION=1920x1080,CODECS="avc1.42e00a,mp4a.40.2,FRAME-RATE=25.000"
h264/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=150000,RESOLUTION=640x360,CODECS="avc1.42e00a,mp4a.40.2,FRAME-RATE=25.000"
h264/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=240000,RESOLUTION=1280x720,CODECS="avc1.42e00a,mp4a.40.2,FRAME-RATE=25.000"
h264/index.m3u8

Incluir solo determinadas resoluciones de vídeo

Para filtrar la representación de vídeo por resolución de vídeo, define la resolución de vídeo en el campo manifestOptions opcional al crear una sesión. Por ejemplo, para mostrar solo las resoluciones de vídeo 1920x1080 y 640x360 en el manifiesto combinado, define las resoluciones de vídeo en la matriz includeRenditions:

{
  "manifestOptions": {
    "includeRenditions": [
      {
        "videoResolution": {
          "widthPixels": 1920,
          "heightPixels": 1080,
        },
      },
      {
        "videoResolution": {
          "widthPixels": 640,
          "heightPixels": 360,
        },
      },
    ],
  },
}

En el archivo de manifiesto combinado se mostrará lo siguiente:

#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=440000,RESOLUTION=1920x1080,CODECS="avc1.42e00a,mp4a.40.2,FRAME-RATE=25.000"
h264/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=150000,RESOLUTION=640x360,CODECS="avc1.42e00a,mp4a.40.2,FRAME-RATE=25.000"
h264/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=400000,RESOLUTION=1920x1080,CODECS="hvc1.1.4.L126.B0,mp4a.40.2,FRAME-RATE=50.000"
h265/fhd/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=100000,RESOLUTION=640x360,CODECS="hvc1.1.4.L126.B0,mp4a.40.2,FRAME-RATE=50.000"
h265/sd/index.m3u8

Incluir solo determinadas velocidades de fotogramas

Para filtrar las representaciones de vídeo por velocidad de fotogramas, defina la velocidad de fotogramas en el campo opcional manifestOptions al crear una sesión. Por ejemplo, para mostrar solo las velocidades de fotogramas 25.0 en el manifiesto combinado, define la velocidad de fotogramas en la matriz includeRenditions:

{
  "manifestOptions": {
    "includeRenditions": [
      {
        "frameRate": 25.0
      },
    ],
  },
}

En el archivo de manifiesto combinado se mostrará lo siguiente:

#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=440000,RESOLUTION=1920x1080,CODECS="avc1.42e00a,mp4a.40.2,FRAME-RATE=25.000"
h264/fhd/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=150000,RESOLUTION=640x360,CODECS="avc1.42e00a,mp4a.40.2,FRAME-RATE=25.000"
h264/sd/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=240000,RESOLUTION=1280x720,CODECS="avc1.42e00a,mp4a.40.2,FRAME-RATE=25.000"
h264/hd/index.m3u8

Incluir solo determinados bitrates

Para filtrar las representaciones de vídeo por tasa de bits, define las tasas de bits en el campo manifestOptions opcional al crear una sesión. Por ejemplo, para mostrar solo dos tasas de bits en el manifiesto combinado, define las tasas de bits en la matriz includeRenditions:

{
  "manifestOptions": {
    "includeRenditions": [
      {
        "bitrateBps": 150000,
      },
      {
        "bitrateBps": 440000,
      },
    ],
  },
}

En el archivo de manifiesto combinado se mostrará lo siguiente:

#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=440000,RESOLUTION=1920x1080,CODECS="avc1.42e00a,mp4a.40.2"
h264/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=150000,RESOLUTION=640x360,CODECS="avc1.42e00a,mp4a.40.2"
h264/index.m3u8

Ordenar por tasa de bits

Algunos reproductores pueden ser sensibles al orden de las representaciones de vídeo. Puedes definir el orden de las representaciones de vídeo como ascending o descending, como se muestra a continuación:

{
  "manifestOptions": {
    "bitrateOrder": "ascending",
  },
}

En el archivo de manifiesto combinado se mostrará lo siguiente:

#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=100000,RESOLUTION=640x360,CODECS="hvc1.1.4.L126.B0,mp4a.40.2,FRAME-RATE=50.000"
h265/sd/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=150000,RESOLUTION=640x360,CODECS="avc1.42e00a,mp4a.40.2,FRAME-RATE=25.000"
h264/sd/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=200000,RESOLUTION=1280x720,CODECS="hvc1.1.4.L126.B0,mp4a.40.2,FRAME-RATE=50.000"
h265/hd/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=240000,RESOLUTION=1280x720,CODECS="avc1.42e00a,mp4a.40.2,FRAME-RATE=25.000"
h264/hd/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=400000,RESOLUTION=1920x1080,CODECS="hvc1.1.4.L126.B0,mp4a.40.2,FRAME-RATE=50.000"
h265/fhd/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=440000,RESOLUTION=1920x1080,CODECS="avc1.42e00a,mp4a.40.2,FRAME-RATE=25.000"
h264/fhd/index.m3u8

DASH

Puedes personalizar lo siguiente en los manifiestos de vídeo DASH combinados:

  • Filtrar por códecs
  • Incluir solo determinadas resoluciones de vídeo
  • Incluir solo determinadas velocidades de fotogramas
  • Incluir solo determinados bitrates
  • Ordenar las representaciones de vídeo

En las siguientes secciones, se presupone el siguiente manifiesto de vídeo de origen:

<Period id="0" start="PT33160.000S">
  <AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720">
    <Representation mimeType="video/mp4" id="640x360-h264" codecs="avc1.64001E" width="640" height="360" startWithSAP="1" bandwidth="150000" frameRate="25/1">
      ...
    </Representation>
    <Representation mimeType="video/mp4" id="1280x720-h264" codecs="avc1.64001E" width="1280" height="720" startWithSAP="1" bandwidth="240000" frameRate="25/1">
      ...
    </Representation>
    <Representation mimeType="video/mp4" id="640x360-h265" codecs="hvc1.1.4.L126.B0" width="640" height="360" startWithSAP="1" bandwidth="100000" frameRate="50/1">
      ...
    </Representation>
    <Representation mimeType="video/mp4" id="1280x720-h265" codecs="hvc1.1.4.L126.B0" width="1280" height="720" startWithSAP="1" bandwidth="200000" frameRate="50/1">
      ...
    </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true">
    <Representation mimeType="audio/mp4" id="640x360-audio" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="48472">
      ...
    </Representation>
    <Representation mimeType="audio/mp4" id="1280x720-audio" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="48472">
      ...
    </Representation>
  </AdaptationSet>
</Period>

Filtrar por códecs

Para filtrar la representación de vídeo por códecs, define los códecs en el campo manifestOptions opcional al crear una sesión. Por ejemplo, para mostrar solo H.264 en el manifiesto combinado, define el códec en la matriz includeRenditions:

{
  "manifestOptions": {
    "includeRenditions": [
      {
        "codecs": "hvc1.1.4.L126.B0",
      },
    ],
  },
}

En el archivo de manifiesto combinado se mostrará lo siguiente:

<Period id="0" start="PT33160.000S">
  <AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720">
    <Representation mimeType="video/mp4" id="640x360-h265" codecs="hvc1.1.4.L126.B0" width="640" height="360" startWithSAP="1" bandwidth="100000" frameRate="50/1">
      ...
    </Representation>
    <Representation mimeType="video/mp4" id="1280x720-h265" codecs="hvc1.1.4.L126.B0" width="1280" height="720" startWithSAP="1" bandwidth="200000" frameRate="50/1">
      ...
    </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true">
    <Representation mimeType="audio/mp4" id="640x360-audio" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="48472">
      ...
    </Representation>
    <Representation mimeType="audio/mp4" id="1280x720-audio" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="48472">
      ...
    </Representation>
  </AdaptationSet>
</Period>

Incluir solo determinadas resoluciones de vídeo

Para filtrar la representación de vídeo por resolución de vídeo, define la resolución de vídeo en el campo manifestOptions opcional al crear una sesión. Por ejemplo, para mostrar solo las resoluciones de vídeo 640x360 en el manifiesto combinado, define la resolución de vídeo en la matriz includeRenditions:

{
  "manifestOptions": {
    "includeRenditions": [
      {
        "videoResolution": {
          "widthPixels": 640,
          "heightPixels": 360,
        },
      },
    ],
  },
}

En el archivo de manifiesto combinado se mostrará lo siguiente:

<Period id="0" start="PT33160.000S">
  <AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720">
    <Representation mimeType="video/mp4" id="640x360-h264" codecs="avc1.64001E" width="640" height="360" startWithSAP="1" bandwidth="150000" frameRate="25/1">
      ...
    </Representation>
    <Representation mimeType="video/mp4" id="640x360-h265" codecs="hvc1.1.4.L126.B0" width="640" height="360" startWithSAP="1" bandwidth="100000" frameRate="50/1">
      ...
    </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true">
    <Representation mimeType="audio/mp4" id="640x360-audio" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="48472">
      ...
    </Representation>
    <Representation mimeType="audio/mp4" id="1280x720-audio" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="48472">
      ...
    </Representation>
  </AdaptationSet>
</Period>

Incluir solo determinadas velocidades de fotogramas

Para filtrar las representaciones de vídeo por velocidad de fotogramas, defina la velocidad de fotogramas en el campo opcional manifestOptions al crear una sesión. Por ejemplo, para mostrar solo la frecuencia de fotogramas 25.0 en el manifiesto combinado, defina la frecuencia de fotogramas en la matriz includeRenditions:

{
  "manifestOptions": {
    "includeRenditions": [
      {
        "frameRate": 25.0
      },
    ],
  },
}

En el archivo de manifiesto combinado se mostrará lo siguiente:

<Period id="0" start="PT33160.000S">
  <AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720">
    <Representation mimeType="video/mp4" id="640x360-h264" codecs="avc1.64001E" width="640" height="360" startWithSAP="1" bandwidth="150000" frameRate="25/1">
      ...
    </Representation>
    <Representation mimeType="video/mp4" id="1280x720-h264" codecs="avc1.64001E" width="1280" height="720" startWithSAP="1" bandwidth="240000" frameRate="25/1">
      ...
    </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true">
    <Representation mimeType="audio/mp4" id="640x360-audio" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="48472">
      ...
    </Representation>
    <Representation mimeType="audio/mp4" id="1280x720-audio" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="48472">
      ...
    </Representation>
  </AdaptationSet>
</Period>

Incluir determinadas tasas de bits

Para filtrar las representaciones de vídeo por tasa de bits, define las tasas de bits en el campo manifestOptions opcional al crear una sesión. Por ejemplo, para mostrar solo dos tasas de bits en el manifiesto combinado, define las tasas de bits en la matriz includeRenditions:

{
  "manifestOptions": {
    "includeRenditions": [
      {
        "bitrateBps": 150000,
      },
      {
        "bitrateBps": 240000,
      },
    ],
  },
}

En el archivo de manifiesto combinado se mostrará lo siguiente:

<Period id="0" start="PT33160.000S">
  <AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720">
    <Representation mimeType="video/mp4" id="640x360-h264" codecs="avc1.64001E" width="640" height="360" startWithSAP="1" bandwidth="150000" frameRate="25/1">
      ...
    </Representation>
    <Representation mimeType="video/mp4" id="1280x720-h264" codecs="avc1.64001E" width="1280" height="720" startWithSAP="1" bandwidth="240000" frameRate="25/1">
      ...
    </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true">
    <Representation mimeType="audio/mp4" id="640x360-audio" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="48472">
      ...
    </Representation>
    <Representation mimeType="audio/mp4" id="1280x720-audio" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="48472">
      ...
    </Representation>
  </AdaptationSet>
</Period>

Ordenar por tasa de bits

Algunos reproductores pueden ser sensibles al orden de las representaciones de vídeo. Puedes definir el orden de las representaciones de vídeo como ascending o descending, como se muestra a continuación:

{
  "manifestOptions": {
    "bitrateOrder": "descending",
  },
}

En el archivo de manifiesto combinado se mostrará lo siguiente:

<Period id="0" start="PT33160.000S">
  <AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720">
    <Representation mimeType="video/mp4" id="1280x720-h264" codecs="avc1.64001E" width="1280" height="720" startWithSAP="1" bandwidth="240000" frameRate="25/1">
      ...
    </Representation>
    <Representation mimeType="video/mp4" id="1280x720-h265" codecs="hvc1.1.4.L126.B0" width="1280" height="720" startWithSAP="1" bandwidth="200000" frameRate="50/1">
      ...
    </Representation>
    <Representation mimeType="video/mp4" id="640x360-h264" codecs="avc1.64001E" width="640" height="360" startWithSAP="1" bandwidth="150000" frameRate="25/1">
      ...
    </Representation>
    <Representation mimeType="video/mp4" id="640x360-h265" codecs="hvc1.1.4.L126.B0" width="640" height="360" startWithSAP="1" bandwidth="100000" frameRate="50/1">
      ...
    </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true">
    <Representation mimeType="audio/mp4" id="640x360-audio" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="48472">
      ...
    </Representation>
    <Representation mimeType="audio/mp4" id="1280x720-audio" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="48472">
      ...
    </Representation>
  </AdaptationSet>
</Period>