Questa pagina descrive come configurare le impostazioni durante la creazione di un endpoint di input o di un canale per le funzionalità dei live streaming, come più tracce audio, sottotitoli codificati e spritesheet.
Configurazione tramite la creazione dell'endpoint di input
Durante la creazione dell'endpoint di input, puoi specificare le configurazioni per le seguenti funzionalità:
Lista consentita IP
Puoi limitare l'accesso agli endpoint di input specificando gli intervalli IP da cui deve provenire lo stream di input, ad esempio l'indirizzo IP del codificatore. La pipeline video accetta solo il traffico proveniente da indirizzi IP compresi in questi intervalli. Gli intervalli IP devono essere in formato blocco CIDR.
Configura il campo securityRules
nella risorsa Input
:
{
"type": "RTMP_PUSH",
"securityRules": {
"ipRanges": ["1.2.3.4/32"]
}
}
Configurazione tramite la creazione del canale
Durante la creazione del canale, puoi specificare le configurazioni per le seguenti funzionalità:
Più stream a velocità in bit
Puoi creare configurazioni avanzate del canale che supportano più velocità in bit, risoluzioni e frequenze frame. La seguente configurazione include due muxStream
nell'output, uno a 360p con una frequenza frame di 30 FPS (mux_video_360p30
) e un altro a 720p con una frequenza frame di 60 FPS (mux_video_720p60
). Questa configurazione supporta anche più bitrate audio.
Per ulteriori informazioni, consulta la sezione Velocità in bit consigliate.
{
"inputAttachments":[
{
"key":"input-primary",
"input": "projects/PROJECT_NUMBER/locations/LOCATION/inputs/INPUT_ID"
}
],
"output":{
"uri": "gs://BUCKET_NAME"
},
"elementaryStreams": [
{
"key": "es_video_720p60",
"videoStream": {
"h264": {
"profile": "high",
"heightPixels": 720,
"widthPixels": 1280,
"bitrateBps": 5500000,
"frameRate": 60
}
}
},
{
"key": "es_video_360p30",
"videoStream": {
"h264": {
"profile": "high",
"heightPixels": 360,
"widthPixels": 640,
"bitrateBps": 400000,
"frameRate": 30
}
}
},
{
"key": "es_audio_160k",
"audioStream": {
"codec": "aac",
"channelCount": 2,
"bitrateBps": 160000
}
},
{
"key": "es_audio_64k",
"audioStream": {
"codec": "aac",
"channelCount": 2,
"bitrateBps": 64000
}
}
],
"muxStreams": [
{
"key": "mux_video_720p60",
"elementaryStreams": [
"es_video_720p60"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_video_360p30",
"elementaryStreams": [
"es_video_360p30"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_audio_160k",
"elementaryStreams": [
"es_audio_160k"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_audio_64k",
"elementaryStreams": [
"es_audio_64k"
],
"segmentSettings": {
"segmentDuration": "2s"
}
}
],
"manifests": [
{
"key": "manifest_dash",
"fileName": "main.mpd",
"type": "DASH",
"muxStreams": [
"mux_video_720p60",
"mux_video_360p30",
"mux_audio_160k",
"mux_audio_64k"
],
"maxSegmentCount": 5
},
{
"key": "manifest_hls",
"fileName": "main.m3u8",
"type": "HLS",
"muxStreams": [
"mux_video_720p60",
"mux_video_360p30",
"mux_audio_160k",
"mux_audio_64k"
],
"maxSegmentCount": 5
}
]
}
Più tracce audio
Se lo stream di input contiene più tracce audio, utilizza l'oggetto
AudioMapping
per selezionare la traccia per ogni
AudioStream
.
{
"inputAttachments": [
{
"key": "MY-INPUT",
"input": "/projects/PROJECT-ID/locations/LOCATION/inputs/MY-INPUT",
}
],
"output": {
"uri": "gs://BUCKET_NAME/outputs/"
},
"elementaryStreams": [
{
"key": "es_video",
"videoStream": {
"h264": {
"heightPixels": 720,
"widthPixels": 1280,
"bitrateBps": 3000000,
"frameRate": 30
}
}
},
{
"key": "es_first_audio",
"audioStream": {
"codec": "aac",
"bitrateBps": 160000,
"mapping": [
{
"inputKey": "MY-INPUT",
"inputTrack": 1
}
]
}
},
{
"key": "es_second_audio",
"audioStream": {
"codec": "aac",
"bitrateBps": 160000,
"mapping": [
{
"inputKey": "MY-INPUT",
"inputTrack": 2
}
]
}
}
],
"muxStreams": [
{
"key": "mux_video",
"elementaryStreams": ["es_video"],
},
{
"key": "mux_first_audio",
"elementaryStreams": ["es_first_audio"],
},
{
"key": "mux_second_audio",
"elementaryStreams": ["es_second_audio"],
}
],
"manifests": [
{
"key": "manifest_dash",
"type": "DASH",
"muxStreams": [
"mux_video",
"mux_first_audio",
"mux_second_audio",
]
}
]
}
Tieni presente che Shaka Player non supporta le seguenti funzionalità per gli stream HLS con più tracce audio:
Intercala la riproduzione della traccia audio con i segmenti TS.
Selezioni di tracce audio secondarie e alternative con segmenti fMP4.
Passare i sottotitoli CEA 608/708
Se gli stream di input contengono sottotitoli codificati CEA 608/708, puoi inoltrarli agli stream di output. Aggiungi il seguente textStream
al
elementaryStreams
quando crei un Channel
. Questo textStream
incorpora i sottotitoli codificati CEA 608/708 in tutti gli stream e le versioni video di output.
{
"key": "captions",
"textStream": {
"codec": "cea608"
}
}
Spritesheet
Per generare uno sprite sheet, configura il campo spriteSheets
nella risorsa Channel
.
{
"spriteSheets": [
{
"format": "jpeg",
"filePrefix": "sprite",
"interval": "2s",
"spriteWidthPixels": 320,
"spriteHeightPixels": 240,
"columnCount": 3,
"rowCount": 3,
"quality": 80
}
]
}