En esta página, se explica cómo crear un recurso de canal con dos flujos de entrada: en la que una de entrada puede ser la copia de seguridad de la otra.
Cuando la conmutación por error automática está habilitada, si se desconecta la transmisión de entrada principal debido a problemas de red, el canal cambia automáticamente a la copia de seguridad como fuente de entrada. Una vez que el flujo de entrada principal vuelve a estar en línea, el canal cambia automáticamente a la transmisión de entrada principal fuente. La función de conmutación por error automática es opcional.
Debes asegurarte de que la transmisión de entrada principal y la secundaria idéntico si deseas que la transmisión de entrada de respaldo reemplace por completo la entrada principal en tiempo real.
También puedes cambiar de forma manual la transmisión de entrada con un evento de canal.
Configura el proyecto de Google Cloud y la autenticación
Si no creaste un proyecto de Google Cloud ni credenciales, consulta Antes de comenzar.Crea el extremo de entrada principal
Para crear el extremo de entrada principal, usa el
projects.locations.inputs.create
.
REST
Antes de usar cualquiera de los datos de solicitud a continuación, realiza los siguientes reemplazos:
PROJECT_NUMBER
: Es el número de tu proyecto de Google Cloud, que se encuentra en el campo Número de proyecto de la página Configuración de IAM.LOCATION
: Es la ubicación en la que se creará la entrada. endpoint; usa una de las regiones admitidasMostrar ubicacionesus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-northeast1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west3
europe-west4
INPUT_ID
: Es un identificador definido por el usuario para la entrada nueva. extremo que se creará (al cual enviarás la transmisión de entrada). Este valor debe tener entre 1 y 63 caracteres, comenzar y terminar con[a-z0-9]
, y puede contener guiones (-) entre los caracteres. Por ejemplo,my-input
.
Para enviar tu solicitud, expande una de estas opciones:
Deberías recibir una respuesta JSON similar a la que se muestra a continuación:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime": CREATE_TIME, "target": "projects/PROJECT_NUMBER/locations/LOCATION/inputs/INPUT_ID", "verb": "create", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
C#
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la documentación de referencia de la API de C# de la API de Live Stream.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Go
Si quieres obtener información para instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream Go API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Java
Si quieres obtener información para instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream Java API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Node.js
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream Node.js API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
PHP
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream PHP API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Python
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream Python API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Ruby
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream Ruby API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Crea el extremo de entrada de la copia de seguridad
Para crear el extremo de entrada de la copia de seguridad, vuelve a usar el
projects.locations.inputs.create
. Asegúrate de usar un ID de entrada diferente del extremo de entrada principal.
REST
Antes de usar cualquiera de los datos de solicitud a continuación, realiza los siguientes reemplazos:
PROJECT_NUMBER
: Es tu proyecto de Google Cloud. número; se encuentra en el campo Número de proyecto de la Página Configuración de IAMLOCATION
: Es la ubicación en la que se creará el extremo de entrada. Usa una de las regiones compatibles.Mostrar ubicacionesus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-northeast1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west3
europe-west4
BACKUP_INPUT_ID
: un identificador definido por el usuario para extremo de entrada de copia de seguridad que se creará (y se usará si la transmisión de entrada principal se desconecta debido a problemas de red); este valor debe tener entre 1 y 63 caracteres, comenzar y terminar con[a-z0-9]
, y puede contener guiones (-) entre los caracteres
Para enviar tu solicitud, expande una de estas opciones:
Deberías recibir una respuesta JSON similar a la que se muestra a continuación:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime": CREATE_TIME, "target": "projects/PROJECT_NUMBER/locations/LOCATION/inputs/BACKUP_INPUT_ID", "verb": "create", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
C#
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream C# API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Go
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream Go API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Java
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream Java API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Node.js
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream Node.js API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
PHP
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la documentación de referencia de la API de PHP de la API de Live Stream.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Python
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream Python API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Ruby
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream Ruby API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Crea el canal
Para crear el canal, usa el método projects.locations.channels.create
. Para este ejemplo, automaticFailover
para el primer adjunto de entrada.
REST
Antes de usar cualquiera de los datos de solicitud a continuación, realiza los siguientes reemplazos:
PROJECT_NUMBER
: Es tu proyecto de Google Cloud. número; se encuentra en el campo Número de proyecto de la Página Configuración de IAMLOCATION
: Es la ubicación en la que se creará el canal. Usa una de las regiones compatibles.Cómo mostrar ubicacionesus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-northeast1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west3
europe-west4
CHANNEL_ID
: Es un identificador definido por el usuario para el canal que se creará. Este valor debe tener entre 1 y 63 caracteres, comenzar y terminar con[a-z0-9]
, y puede contener guiones (-) entre los caracteres.INPUT_ID
: Es el identificador definido por el usuario para el extremo de entrada principal.BACKUP_INPUT_ID
: Es el identificador definido por el usuario para la extremo de entrada de copia de seguridadBUCKET_NAME
: es el nombre de Cloud Storage. bucket que creaste
Para enviar tu solicitud, expande una de estas opciones:
Deberías recibir una respuesta JSON similar a la que se muestra a continuación:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime": CREATE_TIME, "target": "projects/PROJECT_NUMBER/locations/LOCATION/channels/CHANNEL_ID", "verb": "create", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
C#
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream C# API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Go
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la documentación de referencia de la API de Go de la API de Live Stream.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Java
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream Java API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Node.js
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream Node.js API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
PHP
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream PHP API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Python
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream Python API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Ruby
Para obtener información sobre cómo instalar y usar la biblioteca cliente de la API de Live Stream, consulta Bibliotecas cliente de la API de Live Stream. Para obtener más información, consulta la API de Live Stream Ruby API documentación de referencia.
Para autenticarte en la API de Live Stream, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.
Cambia la entrada manualmente
Para cambiar manualmente la entrada principal a la de copia de seguridad (por ejemplo, de my-primary-input
a my-backup-input
), crea un evento de canal.
Después de un cambio manual, puedes desconectar y volver a conectar my-primary-input
como desees. El canal no cambia a esta entrada cuando se vuelve a conectar, como lo haría con la configuración predeterminada de conmutación por error automática.
Para volver a my-primary-input
, realiza una de las siguientes acciones:
- Crear un nuevo
inputSwitch
evento en el queinputKey
se establece enmy-primary-input
. Este evento cambia a la entrada principal sin restablecer la configuración de conmutación por error automática. - Actualiza el canal para habilitar la conmutación por error automática. Consulta la Cambiar evento de entrada para obtener más información.