このページでは、ライブ ストリームで AI 生成の字幕と翻訳された字幕(つまり翻訳)を構成する方法について説明します。
AI 生成の字幕と翻訳は、HLS と DASH のライブ ストリームでサポートされています。
始める前に
このページでは、HLS ライブ ストリームのクイックスタート または MPEG-DASH ライブ ストリームのクイックスタート の始める前に の手順が完了していることを前提としています。
サポートされているロケーション
AI 生成の字幕の言語コードは、地域ごとにサポートされます。
ロケーションを表示
ロケーション
サポートされている言語コード
asia-northeast1
en-US
asia-south1
en-IN
en-GB
en-US
asia-southeast1
en-US
australia-southeast1
en-AU
europe-west1
da-DK
nl-NL
en-GB
en-US
fr-FR
de-DE
it-IT
es-ES
europe-west2
en-GB
europe-west3
da-DK
nl-NL
en-GB
en-US
fr-FR
de-DE
it-IT
es-ES
northamerica-northeast1
en-CA
fr-CA
us-central1
en-US
pt-BR
es-CO
es-MX
es-US
us-east1
en-US
pt-BR
es-CO
es-MX
es-US
us-west1
en-US
pt-BR
es-CO
es-MX
es-US
AI 生成の翻訳機能は、us-west1
と europe-west1
でのみサポートされています。
このページのすべての API リクエストには、us-west1
または europe-west1
のいずれかを使用します。
入力エンドポイントを作成するには、projects.locations.inputs.create
メソッドを使用します。
リクエストのデータを使用する前に、次のように置き換えます。
PROJECT_NUMBER
: Google Cloud プロジェクト番号。これは、IAM 設定 ページの [プロジェクト番号 ] フィールドにあります。
LOCATION
: 入力エンドポイントを作成するロケーション。サポートされているリージョン のいずれかを使用します。ロケーションを表示
us-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
INPUT_ID
: 作成する新しい入力エンドポイントのユーザー定義の識別子(入力ストリームの送信先)。この値は 1~63 文字で、先頭と末尾は [a-z0-9]
で、文字の間にダッシュ(-)を含めることができます。たとえば、my-input
です。
リクエストの本文(JSON):
リクエストを送信するには、次のいずれかのオプションを展開します。
curl(Linux、macOS、Cloud Shell)
リクエスト本文を request.json
という名前のファイルに保存します。ターミナルで次のコマンドを実行して、このファイルを現在のディレクトリに作成または上書きします。
cat > request.json << 'EOF'
{
"type": "RTMP_PUSH"
}
EOF
その後、次のコマンドを実行して REST リクエストを送信します。
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json; charset=utf-8" \ -d @request.json \ "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /inputs?inputId=INPUT_ID "
PowerShell(Windows)
リクエスト本文を request.json
という名前のファイルに保存します。ターミナルで次のコマンドを実行して、このファイルを現在のディレクトリに作成または上書きします。
@'
{
"type": "RTMP_PUSH"
}
'@ | Out-File -FilePath request.json -Encoding utf8
その後、次のコマンドを実行して REST リクエストを送信します。
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method POST ` -Headers $headers ` -ContentType: "application/json; charset=utf-8" ` -InFile request.json ` -Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /inputs?inputId=INPUT_ID " | Select-Object -Expand Content
次のような JSON レスポンスが返されます。
{
"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
}
返された OPERATION_ID をコピーして、次のセクションで使用します。
結果を確認する
projects.locations.operations.get
メソッドを使用して、入力エンドポイントが作成されているかどうかを確認します。レスポンスに "done: false"
が含まれている場合は、レスポンスに "done: true"
が含まれるまでコマンドを繰り返します。リージョンで最初に入力エンドポイントを作成するには、最大 10 分ほどかかることがあります。
リクエストのデータを使用する前に、次のように置き換えます。
PROJECT_NUMBER
: Google Cloud プロジェクト番号。これは、IAM 設定 ページの [プロジェクト番号 ] フィールドにあります。
LOCATION
: 入力エンドポイントが配置されているロケーション。サポートされているリージョン のいずれかを使用します。ロケーションを表示
us-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
OPERATION_ID
: オペレーションの ID。
リクエストを送信するには、次のいずれかのオプションを開きます。
curl(Linux、macOS、Cloud Shell)
次のコマンドを実行します。
curl -X GET \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /operations/OPERATION_ID "
PowerShell(Windows)
次のコマンドを実行します。
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method GET ` -Headers $headers ` -Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /operations/OPERATION_ID " | Select-Object -Expand Content
次のような JSON レスポンスが返されます。
{
"name": "projects/PROJECT_NUMBER /locations/LOCATION /operations/OPERATION_ID ",
"metadata": {
"@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata",
"createTime": CREATE_TIME ,
"endTime": END_TIME ,
"target": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID ",
"verb": "create",
"requestedCancellation": false,
"apiVersion": "v1"
},
"done": true,
"response": {
"@type": "type.googleapis.com/google.cloud.video.livestream.v1.Input",
"name": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID ",
"createTime": CREATE_TIME ,
"updateTime": UPDATE_TIME ,
"type": "RTMP_PUSH",
"uri": INPUT_STREAM_URI , # For example, "rtmp://1.2.3.4/live/b8ebdd94-c8d9-4d88-a16e-b963c43a953b",
"tier": "HD"
}
}
uri
フィールドを探して、返された INPUT_STREAM_URI をコピーし、後で入力ストリームを送信する セクションで使用します。
チャネルを作成します。
チャネルを作成するには、projects.locations.channels.create
ソッドを使用します。
チャネル構成では次の点に注意してください。
字幕には 1 つの ElementaryStream
(TextStream
)を使用します。
{
"key" : "webvtt_english_ai" ,
"textStream" : {
"codec" : "webvtt" ,
"displayName" : "English (AI captioned)" ,
"languageCode" : "en-US" ,
"mapping" : [
{
"inputTrack" : 1 // audio track number
}
]
}
}
TextStream
codec
フィールドは webvtt
に設定する必要があります。
TextStream
mapping
フィールドは inputTrack
を使用して、字幕を生成する入力音声トラックを指定します。マッピングに inputCeaChannel
フィールドを含めることはできません。このフィールドは、ユーザーが提供したクローズド キャプションでのみ使用されます。
languageCode
を音声トラックで話されている言語に設定します。
エレメンタル ストリームを使用して、キー vtt_english_ai
を含む MuxStream
を作成します。
{
"key" : "vtt_english_ai" ,
"container" : "vtt" ,
"elementaryStreams" : [
"webvtt_english_ai"
],
"segmentSettings" : {
"segmentDuration" : "2s"
}
}
この多重化ストリームは、HLS と DASH の両方のマニフェスト で参照されます。
{
"fileName" : "main.m3u8" ,
"type" : "HLS" ,
"muxStreams" : [
"mux_video_ts" ,
"vtt_english_ai"
],
"maxSegmentCount" : 5
}
リクエストのデータを使用する前に、次のように置き換えます。
PROJECT_NUMBER
: Google Cloud プロジェクト番号。これは、IAM 設定 ページの [プロジェクト番号 ] フィールドにあります。
LOCATION
: チャネルを作成するロケーション。サポートされているリージョン のいずれかを使用します。
ロケーションを表示
us-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
CHANNEL_ID
: 作成するチャネルのユーザー定義の識別子。この値は 1~63 文字で、先頭と末尾は [a-z0-9]
で、文字の間にダッシュ(-)を含めることができます。
INPUT_ID
: 入力エンドポイントのユーザー定義の識別子
BUCKET_NAME
: ライブ ストリームのマニフェスト ファイルとセグメント ファイルを保持するために作成した Cloud Storage バケットの名前
リクエストの本文(JSON):
{
"inputAttachments": [
{
"key": "my-input",
"input": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID "
}
],
"output": {
"uri": "gs://BUCKET_NAME "
},
"elementaryStreams": [
{
"key": "es_video",
"videoStream": {
"h264": {
"profile": "high",
"widthPixels": 1280,
"heightPixels": 720,
"bitrateBps": 3000000,
"frameRate": 30
}
}
},
{
"key": "es_audio",
"audioStream": {
"codec": "aac",
"channelCount": 2,
"bitrateBps": 160000
}
},
{
"key": "webvtt_english_ai",
"textStream": {
"codec": "webvtt",
"displayName": "English (AI captioned)",
"languageCode": "en-US",
"mapping": [
{
"inputTrack": 1
}
]
}
}
],
"muxStreams": [
{
"key": "mux_video_fmp4",
"container": "fmp4",
"elementaryStreams": [
"es_video"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_audio_fmp4",
"container": "fmp4",
"elementaryStreams": [
"es_audio"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_video_ts",
"container": "ts",
"elementaryStreams": [
"es_video",
"es_audio"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "vtt_english_ai",
"container": "vtt",
"elementaryStreams": [
"webvtt_english_ai"
],
"segmentSettings": {
"segmentDuration": "2s"
}
}
],
"manifests": [
{
"key": "manifest_dash",
"fileName": "main.mpd",
"type": "DASH",
"muxStreams": [
"mux_video_fmp4",
"mux_audio_fmp4",
"vtt_english_ai"
],
"maxSegmentCount": 5
},
{
"key": "manifest_hls",
"fileName": "main.m3u8",
"type": "HLS",
"muxStreams": [
"mux_video_ts",
"vtt_english_ai"
],
"maxSegmentCount": 5
}
]
}
リクエストを送信するには、次のいずれかのオプションを展開します。
curl(Linux、macOS、Cloud Shell)
リクエスト本文を request.json
という名前のファイルに保存します。ターミナルで次のコマンドを実行して、このファイルを現在のディレクトリに作成または上書きします。
cat > request.json << 'EOF'
{
"inputAttachments": [
{
"key": "my-input",
"input": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID "
}
],
"output": {
"uri": "gs://BUCKET_NAME "
},
"elementaryStreams": [
{
"key": "es_video",
"videoStream": {
"h264": {
"profile": "high",
"widthPixels": 1280,
"heightPixels": 720,
"bitrateBps": 3000000,
"frameRate": 30
}
}
},
{
"key": "es_audio",
"audioStream": {
"codec": "aac",
"channelCount": 2,
"bitrateBps": 160000
}
},
{
"key": "webvtt_english_ai",
"textStream": {
"codec": "webvtt",
"displayName": "English (AI captioned)",
"languageCode": "en-US",
"mapping": [
{
"inputTrack": 1
}
]
}
}
],
"muxStreams": [
{
"key": "mux_video_fmp4",
"container": "fmp4",
"elementaryStreams": [
"es_video"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_audio_fmp4",
"container": "fmp4",
"elementaryStreams": [
"es_audio"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_video_ts",
"container": "ts",
"elementaryStreams": [
"es_video",
"es_audio"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "vtt_english_ai",
"container": "vtt",
"elementaryStreams": [
"webvtt_english_ai"
],
"segmentSettings": {
"segmentDuration": "2s"
}
}
],
"manifests": [
{
"key": "manifest_dash",
"fileName": "main.mpd",
"type": "DASH",
"muxStreams": [
"mux_video_fmp4",
"mux_audio_fmp4",
"vtt_english_ai"
],
"maxSegmentCount": 5
},
{
"key": "manifest_hls",
"fileName": "main.m3u8",
"type": "HLS",
"muxStreams": [
"mux_video_ts",
"vtt_english_ai"
],
"maxSegmentCount": 5
}
]
}
EOF
その後、次のコマンドを実行して REST リクエストを送信します。
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json; charset=utf-8" \ -d @request.json \ "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels?channelId=CHANNEL_ID "
PowerShell(Windows)
リクエスト本文を request.json
という名前のファイルに保存します。ターミナルで次のコマンドを実行して、このファイルを現在のディレクトリに作成または上書きします。
@'
{
"inputAttachments": [
{
"key": "my-input",
"input": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID "
}
],
"output": {
"uri": "gs://BUCKET_NAME "
},
"elementaryStreams": [
{
"key": "es_video",
"videoStream": {
"h264": {
"profile": "high",
"widthPixels": 1280,
"heightPixels": 720,
"bitrateBps": 3000000,
"frameRate": 30
}
}
},
{
"key": "es_audio",
"audioStream": {
"codec": "aac",
"channelCount": 2,
"bitrateBps": 160000
}
},
{
"key": "webvtt_english_ai",
"textStream": {
"codec": "webvtt",
"displayName": "English (AI captioned)",
"languageCode": "en-US",
"mapping": [
{
"inputTrack": 1
}
]
}
}
],
"muxStreams": [
{
"key": "mux_video_fmp4",
"container": "fmp4",
"elementaryStreams": [
"es_video"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_audio_fmp4",
"container": "fmp4",
"elementaryStreams": [
"es_audio"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_video_ts",
"container": "ts",
"elementaryStreams": [
"es_video",
"es_audio"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "vtt_english_ai",
"container": "vtt",
"elementaryStreams": [
"webvtt_english_ai"
],
"segmentSettings": {
"segmentDuration": "2s"
}
}
],
"manifests": [
{
"key": "manifest_dash",
"fileName": "main.mpd",
"type": "DASH",
"muxStreams": [
"mux_video_fmp4",
"mux_audio_fmp4",
"vtt_english_ai"
],
"maxSegmentCount": 5
},
{
"key": "manifest_hls",
"fileName": "main.m3u8",
"type": "HLS",
"muxStreams": [
"mux_video_ts",
"vtt_english_ai"
],
"maxSegmentCount": 5
}
]
}
'@ | Out-File -FilePath request.json -Encoding utf8
その後、次のコマンドを実行して REST リクエストを送信します。
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method POST ` -Headers $headers ` -ContentType: "application/json; charset=utf-8" ` -InFile request.json ` -Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels?channelId=CHANNEL_ID " | Select-Object -Expand Content
次のような JSON レスポンスが返されます。
レスポンス
{
"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
}
チャネルを取得する
新しいオペレーション ID を使用して、オペレーションの結果を確認 できます。
チャネルを作成したら、projects.locations.channels.get
メソッドを使用してチャネルの状態をクエリします。
リクエストのデータを使用する前に、次のように置き換えます。
PROJECT_NUMBER
: Google Cloud プロジェクト番号。これは、IAM 設定 ページの [プロジェクト番号 ] フィールドにあります。
LOCATION
: チャネルがあるロケーション。サポートされているリージョン のいずれかを使用します。
ロケーションを表示
us-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
CHANNEL_ID
: チャネルのユーザー定義の識別子。
リクエストを送信するには、次のいずれかのオプションを開きます。
curl(Linux、macOS、Cloud Shell)
次のコマンドを実行します。
curl -X GET \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID "
PowerShell(Windows)
次のコマンドを実行します。
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method GET ` -Headers $headers ` -Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID " | Select-Object -Expand Content
次のような JSON レスポンスが返されます。
レスポンス
{
"name": "projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID ",
"createTime": CREATE_TIME ,
"updateTime": UPDATE_TIME ,
"inputAttachments": [
{
"key": "INPUT_ID ",
"input": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID "
}
],
"activeInput": "INPUT_ID ",
"output": {
"uri": "gs://BUCKET_NAME "
},
"elementaryStreams": [
{
"key": "es_video",
"videoStream": {
"h264": {
"profile": "high",
"widthPixels": 1280,
"heightPixels": 720,
"bitrateBps": 3000000,
"frameRate": 30
}
}
},
{
"key": "es_audio",
"audioStream": {
"codec": "aac",
"channelCount": 2,
"bitrateBps": 160000
}
},
{
"key": "webvtt_english_ai",
"textStream": {
"codec": "webvtt",
"displayName": "English (AI captioned)",
"languageCode": "en-US",
"mapping": [
{
"inputTrack": 1
}
]
}
}
],
"muxStreams": [
{
"key": "mux_video_fmp4",
"container": "fmp4",
"elementaryStreams": [
"es_video"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_audio_fmp4",
"container": "fmp4",
"elementaryStreams": [
"es_audio"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_video_ts",
"container": "ts",
"elementaryStreams": [
"es_video",
"es_audio"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "vtt_english_ai",
"container": "vtt",
"elementaryStreams": [
"webvtt_english_ai"
],
"segmentSettings": {
"segmentDuration": "2s"
}
}
],
"manifests": [
{
"key": "manifest_dash",
"fileName": "main.mpd",
"type": "DASH",
"muxStreams": [
"mux_video_fmp4",
"mux_audio_fmp4",
"vtt_english_ai"
],
"maxSegmentCount": 5
},
{
"key": "manifest_hls",
"fileName": "main.m3u8",
"type": "HLS",
"muxStreams": [
"mux_video_ts",
"vtt_english_ai"
],
"maxSegmentCount": 5
}
],
"streamingState": "STOPPED"
}
完全なレスポンスには、次のフィールドが含まれます。
{
...
"streamingState": "STOPPED"
...
}
このレスポンスは、チャネルを開始できるようになったことを示します。
チャネルを開始する
projects.locations.channels.start
メソッドを使用してチャネルを開始します。入力ストリームを受け入れるか、出力ストリームを生成する前に、チャネルを開始する必要があります。
リージョン内で最初のチャネルを開始するには 10 分ほどかかります。
リクエストのデータを使用する前に、次のように置き換えます。
PROJECT_NUMBER
: Google Cloud プロジェクト番号。これは、IAM 設定 ページの [プロジェクト番号 ] フィールドにあります。
LOCATION
: チャネルがあるロケーション。サポートされているリージョン のいずれかを使用します。
ロケーションを表示
us-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
CHANNEL_ID
: チャネルのユーザー定義の識別子。
リクエストを送信するには、次のいずれかのオプションを開きます。
curl(Linux、macOS、Cloud Shell)
次のコマンドを実行します。
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json; charset=utf-8" \ -d "" \ "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID :start"
PowerShell(Windows)
次のコマンドを実行します。
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method POST ` -Headers $headers ` -Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID :start" | Select-Object -Expand Content
次のような JSON レスポンスが返されます。
レスポンス
{
"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": "start",
"requestedCancellation": false,
"apiVersion": "v1"
},
"done": false
}
チャネルが開始されたかどうかを確認するには、以前と同様の方法でチャネル情報を取得 します。レスポンスには以下が含まれます。
{
...
"streamingState": "AWAITING_INPUT"
...
}
チャネルの準備が整ったので、入力エンドポイントに入力ストリームを送信して、ライブ ストリームを生成します。字幕付きの MP4(またはその他の TEST_VOD_FILE )をダウンロードし、ffmpeg
を使用して入力エンドポイントに送信できます。
新しいターミナル ウィンドウを開きます。[結果を確認する ] セクションの INPUT_STREAM_URI を使用して、次のコマンドを実行します。
ffmpeg -re -stream_loop -1 -i "TEST_VOD_FILE " \
-c:v copy -c:a aac -strict 2 -f "flv" "INPUT_STREAM_URI "
注: 入力エンドポイントが RTMP プロトコルを使用している場合は、flv
形式を使用します。SRT プロトコルには mpegts
を使用します。 出力マニフェストで字幕を確認する
次のコマンドを実行して、生成された HLS マニフェストのコンテンツを表示します。
gcloud storage cat gs://BUCKET_NAME /main.m3u8
AI 生成の webvtt 英語字幕は、次のように出力マニフェストに表示されます。
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="sub",LANGUAGE="en-US",NAME="English (AI captioned)",AUTOSELECT=YES,DEFAULT=YES,FORCED=NO,URI="vtt_english_ai/index-1.m3u8"
チャネルを停止する
チャネル構成を更新する前に、チャネルを停止する必要があります。
projects.locations.channels.stop
メソッドを使用してチャネルを停止します。
リクエストのデータを使用する前に、次のように置き換えます。
PROJECT_NUMBER
: Google Cloud プロジェクト番号。これは、IAM 設定 ページの [プロジェクト番号 ] フィールドにあります。
LOCATION
: チャネルがあるロケーション。サポートされているリージョン のいずれかを使用します。
ロケーションを表示
us-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
CHANNEL_ID
: チャネルのユーザー定義の識別子。
リクエストを送信するには、次のいずれかのオプションを開きます。
curl(Linux、macOS、Cloud Shell)
次のコマンドを実行します。
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json; charset=utf-8" \ -d "" \ "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID :stop"
PowerShell(Windows)
次のコマンドを実行します。
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method POST ` -Headers $headers ` -Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID :stop" | Select-Object -Expand Content
次のような JSON レスポンスが返されます。
レスポンス
{
"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": "stop",
"requestedCancellation": false,
"apiVersion": "v1"
},
"done": false
}
翻訳のチャンネル構成を更新する
翻訳された字幕(翻訳)を含めるようにチャンネル構成を更新します。
チャンネル構成に次の追加 があることに注意してください。
1 つの ElementaryStream
、TextStream
が、単一の翻訳言語の字幕に使用されます。
{
"key" : "webvtt_spanish_ai" ,
"textStream" : {
"codec" : "webvtt" ,
"displayName" : "Spanish (AI captioned)" ,
"languageCode" : "es-MX" ,
"mapping" : [
{
"inputTrack" : 1 , // audio track number
"fromLanguageCode" : "en-US" // original audio in English
}
]
}
}
languageCode
を選択した翻訳済み言語に設定します。
fromLanguageCode
を音声トラックの元のソース言語に設定します。
エレメンタル ストリームを使用して、キー vtt_spanish_ai
を含む MuxStream
を作成します。
{
"key" : "vtt_spanish_ai" ,
"container" : "vtt" ,
"elementaryStreams" : [
"webvtt_spanish_ai"
],
"segmentSettings" : {
"segmentDuration" : "2s"
}
}
この多重化ストリームは、HLS と DASH の両方のマニフェスト で参照されます。
{
"fileName" : "main.m3u8" ,
"type" : "HLS" ,
"muxStreams" : [
"mux_video_ts" ,
"vtt_english_ai" ,
"vtt_spanish_ai"
],
"maxSegmentCount" : 5
}
チャネルを更新するには、projects.locations.channels.patch
メソッドを使用します。
リクエストのデータを使用する前に、次のように置き換えます。
PROJECT_NUMBER
: Google Cloud プロジェクト番号。これは、IAM 設定 ページの [プロジェクト番号 ] フィールドにあります。
LOCATION
: チャネルを作成するロケーション。サポートされているリージョン のいずれかを使用します。
ロケーションを表示
us-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
CHANNEL_ID
: 作成するチャネルのユーザー定義の識別子。この値は 1~63 文字で、先頭と末尾は [a-z0-9]
で、文字の間にダッシュ(-)を含めることができます。
リクエストの本文(JSON):
{
"inputAttachments": [
{
"key": "my-input",
"input": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID "
}
],
"output": {
"uri": "gs://BUCKET_NAME "
},
"elementaryStreams": [
{
"key": "es_video",
"videoStream": {
"h264": {
"profile": "high",
"widthPixels": 1280,
"heightPixels": 720,
"bitrateBps": 3000000,
"frameRate": 30
}
}
},
{
"key": "es_audio",
"audioStream": {
"codec": "aac",
"channelCount": 2,
"bitrateBps": 160000
}
},
{
"key": "webvtt_english_ai",
"textStream": {
"codec": "webvtt",
"displayName": "English (AI captioned)",
"languageCode": "en-US",
"mapping": [
{
"inputTrack": 1
}
]
}
},
{
"key": "webvtt_spanish_ai",
"textStream": {
"codec": "webvtt",
"displayName": "Spanish (AI captioned)",
"languageCode": "es-MX",
"mapping": [
{
"inputTrack": 1,
"fromLanguageCode": "en-US"
}
]
}
}
],
"muxStreams": [
{
"key": "mux_video_fmp4",
"container": "fmp4",
"elementaryStreams": [
"es_video"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_audio_fmp4",
"container": "fmp4",
"elementaryStreams": [
"es_audio"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_video_ts",
"container": "ts",
"elementaryStreams": [
"es_video",
"es_audio"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "vtt_english_ai",
"container": "vtt",
"elementaryStreams": [
"webvtt_english_ai"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "vtt_spanish_ai",
"container": "vtt",
"elementaryStreams": [
"webvtt_spanish_ai"
],
"segmentSettings": {
"segmentDuration": "2s"
}
}
],
"manifests": [
{
"key": "manifest_dash",
"fileName": "main.mpd",
"type": "DASH",
"muxStreams": [
"mux_video_fmp4",
"mux_audio_fmp4",
"vtt_english_ai",
"vtt_spanish_ai"
],
"maxSegmentCount": 5
},
{
"key": "manifest_hls",
"fileName": "main.m3u8",
"type": "HLS",
"muxStreams": [
"mux_video_ts",
"vtt_english_ai",
"vtt_spanish_ai"
],
"maxSegmentCount": 5
}
]
}
リクエストを送信するには、次のいずれかのオプションを展開します。
curl(Linux、macOS、Cloud Shell)
リクエスト本文を request.json
という名前のファイルに保存します。ターミナルで次のコマンドを実行して、このファイルを現在のディレクトリに作成または上書きします。
cat > request.json << 'EOF'
{
"inputAttachments": [
{
"key": "my-input",
"input": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID "
}
],
"output": {
"uri": "gs://BUCKET_NAME "
},
"elementaryStreams": [
{
"key": "es_video",
"videoStream": {
"h264": {
"profile": "high",
"widthPixels": 1280,
"heightPixels": 720,
"bitrateBps": 3000000,
"frameRate": 30
}
}
},
{
"key": "es_audio",
"audioStream": {
"codec": "aac",
"channelCount": 2,
"bitrateBps": 160000
}
},
{
"key": "webvtt_english_ai",
"textStream": {
"codec": "webvtt",
"displayName": "English (AI captioned)",
"languageCode": "en-US",
"mapping": [
{
"inputTrack": 1
}
]
}
},
{
"key": "webvtt_spanish_ai",
"textStream": {
"codec": "webvtt",
"displayName": "Spanish (AI captioned)",
"languageCode": "es-MX",
"mapping": [
{
"inputTrack": 1,
"fromLanguageCode": "en-US"
}
]
}
}
],
"muxStreams": [
{
"key": "mux_video_fmp4",
"container": "fmp4",
"elementaryStreams": [
"es_video"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_audio_fmp4",
"container": "fmp4",
"elementaryStreams": [
"es_audio"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_video_ts",
"container": "ts",
"elementaryStreams": [
"es_video",
"es_audio"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "vtt_english_ai",
"container": "vtt",
"elementaryStreams": [
"webvtt_english_ai"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "vtt_spanish_ai",
"container": "vtt",
"elementaryStreams": [
"webvtt_spanish_ai"
],
"segmentSettings": {
"segmentDuration": "2s"
}
}
],
"manifests": [
{
"key": "manifest_dash",
"fileName": "main.mpd",
"type": "DASH",
"muxStreams": [
"mux_video_fmp4",
"mux_audio_fmp4",
"vtt_english_ai",
"vtt_spanish_ai"
],
"maxSegmentCount": 5
},
{
"key": "manifest_hls",
"fileName": "main.m3u8",
"type": "HLS",
"muxStreams": [
"mux_video_ts",
"vtt_english_ai",
"vtt_spanish_ai"
],
"maxSegmentCount": 5
}
]
}
EOF
その後、次のコマンドを実行して REST リクエストを送信します。
curl -X PATCH \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json; charset=utf-8" \ -d @request.json \ "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID ?updateMask=elementary_streams,mux_streams,manifests"
PowerShell(Windows)
リクエスト本文を request.json
という名前のファイルに保存します。ターミナルで次のコマンドを実行して、このファイルを現在のディレクトリに作成または上書きします。
@'
{
"inputAttachments": [
{
"key": "my-input",
"input": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID "
}
],
"output": {
"uri": "gs://BUCKET_NAME "
},
"elementaryStreams": [
{
"key": "es_video",
"videoStream": {
"h264": {
"profile": "high",
"widthPixels": 1280,
"heightPixels": 720,
"bitrateBps": 3000000,
"frameRate": 30
}
}
},
{
"key": "es_audio",
"audioStream": {
"codec": "aac",
"channelCount": 2,
"bitrateBps": 160000
}
},
{
"key": "webvtt_english_ai",
"textStream": {
"codec": "webvtt",
"displayName": "English (AI captioned)",
"languageCode": "en-US",
"mapping": [
{
"inputTrack": 1
}
]
}
},
{
"key": "webvtt_spanish_ai",
"textStream": {
"codec": "webvtt",
"displayName": "Spanish (AI captioned)",
"languageCode": "es-MX",
"mapping": [
{
"inputTrack": 1,
"fromLanguageCode": "en-US"
}
]
}
}
],
"muxStreams": [
{
"key": "mux_video_fmp4",
"container": "fmp4",
"elementaryStreams": [
"es_video"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_audio_fmp4",
"container": "fmp4",
"elementaryStreams": [
"es_audio"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "mux_video_ts",
"container": "ts",
"elementaryStreams": [
"es_video",
"es_audio"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "vtt_english_ai",
"container": "vtt",
"elementaryStreams": [
"webvtt_english_ai"
],
"segmentSettings": {
"segmentDuration": "2s"
}
},
{
"key": "vtt_spanish_ai",
"container": "vtt",
"elementaryStreams": [
"webvtt_spanish_ai"
],
"segmentSettings": {
"segmentDuration": "2s"
}
}
],
"manifests": [
{
"key": "manifest_dash",
"fileName": "main.mpd",
"type": "DASH",
"muxStreams": [
"mux_video_fmp4",
"mux_audio_fmp4",
"vtt_english_ai",
"vtt_spanish_ai"
],
"maxSegmentCount": 5
},
{
"key": "manifest_hls",
"fileName": "main.m3u8",
"type": "HLS",
"muxStreams": [
"mux_video_ts",
"vtt_english_ai",
"vtt_spanish_ai"
],
"maxSegmentCount": 5
}
]
}
'@ | Out-File -FilePath request.json -Encoding utf8
その後、次のコマンドを実行して REST リクエストを送信します。
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method PATCH ` -Headers $headers ` -ContentType: "application/json; charset=utf-8" ` -InFile request.json ` -Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID ?updateMask=elementary_streams,mux_streams,manifests" | Select-Object -Expand Content
次のような JSON レスポンスが返されます。
レスポンス
{
"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": "update",
"requestedCancellation": false,
"apiVersion": "v1"
},
"done": false
}
新しいオペレーション ID を使用して、オペレーションの結果を確認 できます。
前と同様に、チャネルを開始 して、入力ストリームを送信 します。
出力マニフェストで翻訳を確認する
次のコマンドを実行して、生成された HLS マニフェストのコンテンツを表示します。
gcloud storage cat gs://BUCKET_NAME /main.m3u8
AI によって生成された英語とスペイン語の WebVTT 字幕は、次のような出力マニフェストに表示されます。
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="sub",LANGUAGE="en-US",NAME="English (AI captioned)",AUTOSELECT=YES,DEFAULT=YES,FORCED=NO,URI="vtt_english_ai/index-1.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="sub",LANGUAGE="es-MX",NAME="Spanish (AI captioned)",AUTOSELECT=NO,DEFAULT=NO,FORCED=NO,URI="vtt_spanish_ai/index-1.m3u8"
配信用に AI 生成の文字起こしを設定する
配信用の AI 生成の字幕と翻訳を構成する前に、ライブ ストリームをリモート エンドポイントに配信する 方法をよく理解しておいてください。
AI 生成の字幕と翻訳をリモート エンドポイントに配信するには、AI 生成の字幕を含むチャンネルの作成 と翻訳用のチャンネルの更新 で以前に構成した webvtt
形式のテキスト ストリームを参照しないでください。配信用のテキスト ストリームは、codec
が cea608
または cea708
に設定された埋め込み字幕である必要があります。
チャネル構成では、次の点を考慮してください。
1 つの ElementaryStream
(TextStream
)が字幕に使用され、別の ElementaryStream
(TextStream
)が翻訳に使用されます。
{
"key" : "embedded_english_ai" ,
"textStream" : {
"codec" : "cea608" ,
"displayName" : "English (AI captioned)" ,
"languageCode" : "en-US" ,
"outputCeaChannel" : "CC1" , // closed caption channel that will contain AI-generated English captions
"mapping" : [
{
"inputTrack" : 1 // audio track number
}
]
}
}
{
"key" : "embedded_spanish_ai" ,
"textStream" : {
"codec" : "cea608" ,
"displayName" : "Spanish (AI captioned)" ,
"languageCode" : "es-MX" ,
"outputCeaChannel" : "CC2" , // closed caption channel that will contain AI-generated Spanish captions
"mapping" : [
{
"inputTrack" : 1 , // audio track number
"fromLanguageCode" : "en-US" // original audio in English
}
]
}
}
TextStream
codec
フィールドは cea608
または cea708
に設定する必要があります。
TextStream
mapping
フィールドは inputTrack
を使用して、字幕を生成する入力音声トラックを指定します。マッピングに inputCeaChannel
フィールドを含めることはできません。このフィールドは、ユーザーが提供したクローズド キャプションでのみ使用されます。
outputCeaChannel
を、AI 生成の文字起こしを含むクローズド キャプションのチャンネルに設定します。
languageCode
を音声トラックで話されている言語に設定します。
エレメンタリ ストリームは、DistributionStream
オブジェクトの elementaryStreams
フィールドに含まれます。
{
"distributionStreams" : [
{
"key" : "ds1" ,
"container" : "ts" , // to be used with an SRT distribution
"elementaryStreams" : [
"es_video" ,
"es_audio" ,
"embedded_english_ai" , // distribute both English
"embedded_spanish_ai" // and Spanish captions
]
},
{
"key" : "ds2" ,
"container" : "flv" , // to be used with an RTMP distribution
"elementaryStreams" : [
"es_video" ,
"es_audio" ,
"embedded_spanish_ai" // only distribute Spanish captions
]
}
]
}
リモート エンドポイントにライブ配信を配信するガイド に沿って、チャンネルの作成を完了します。
高度な構成
チャンネル レベルで AutoTranscriptionConfig
を設定して、AI 生成のテキスト ストリームをニーズに合わせてさらに調整します。
字幕の表示タイミング
デフォルトでは、AI 生成の字幕は音声や動画と非同期で表示されます。AutoTranscriptionConfig
の DisplayTiming
フィールドを SYNC
に設定して、同期的に表示します。
{
"autoTranscriptionConfig" : {
"displayTiming" : "SYNC"
}
}
字幕を同期して表示すると、音声とテキストの視聴レイテンシは短縮されますが、メディア全体のエンドツーエンドのレイテンシは長くなります。
品質プリセット
AutoTranscriptionConfig
の QualityPreset
フィールドを使用して、AI 生成テキスト ストリームの品質設定を構成します。
たとえば、次の設定を行うことで、テキスト ストリーム生成のレイテンシをさらに短縮できます。
{
"autoTranscriptionConfig" : {
"qualityPreset" : "LOW_LATENCY"
}
}
クリーンアップ
チャネルを停止する
projects.locations.channels.stop
メソッドを使用してチャネルを停止します。チャネルは削除する前に停止する必要があります。
リクエストのデータを使用する前に、次のように置き換えます。
PROJECT_NUMBER
: Google Cloud プロジェクト番号。これは、IAM 設定 ページの [プロジェクト番号 ] フィールドにあります。
LOCATION
: チャネルがあるロケーション。サポートされているリージョン のいずれかを使用します。
ロケーションを表示
us-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
CHANNEL_ID
: チャネルのユーザー定義の識別子。
リクエストを送信するには、次のいずれかのオプションを開きます。
curl(Linux、macOS、Cloud Shell)
次のコマンドを実行します。
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json; charset=utf-8" \ -d "" \ "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID :stop"
PowerShell(Windows)
次のコマンドを実行します。
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method POST ` -Headers $headers ` -Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID :stop" | Select-Object -Expand Content
次のような JSON レスポンスが返されます。
レスポンス
{
"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": "stop",
"requestedCancellation": false,
"apiVersion": "v1"
},
"done": false
}
ffmpeg
を使用して入力ストリームを送信した場合、チャネルを停止すると接続が自動的に切断されます。
チャネルを削除する
projects.locations.channels.delete
メソッドを使用してチャネルを削除します。チャネルで使用されている入力エンドポイントを削除する前に、そのチャネルを削除する必要があります。
リクエストのデータを使用する前に、次のように置き換えます。
PROJECT_NUMBER
: Google Cloud プロジェクト番号。これは、IAM 設定 ページの [プロジェクト番号 ] フィールドにあります。
LOCATION
: チャネルがあるロケーション。サポートされているリージョン のいずれかを使用します。
ロケーションを表示
us-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
CHANNEL_ID
: チャネルのユーザー定義の識別子。
リクエストを送信するには、次のいずれかのオプションを開きます。
curl(Linux、macOS、Cloud Shell)
次のコマンドを実行します。
curl -X DELETE \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID "
PowerShell(Windows)
次のコマンドを実行します。
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method DELETE ` -Headers $headers ` -Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID " | Select-Object -Expand Content
次のような JSON レスポンスが返されます。
レスポンス
{
"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": "delete",
"requestedCancellation": false,
"apiVersion": "v1"
},
"done": false
}
projects.locations.inputs.delete
メソッドを使用して、入力エンドポイントを削除します。
リクエストのデータを使用する前に、次のように置き換えます。
PROJECT_NUMBER
: Google Cloud プロジェクト番号。これは、IAM 設定 ページの [プロジェクト番号 ] フィールドにあります。
LOCATION
: 入力エンドポイントが配置されているロケーション。サポートされているリージョン のいずれかを使用します。ロケーションを表示
us-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
INPUT_ID
: 入力エンドポイントのユーザー定義の識別子
リクエストを送信するには、次のいずれかのオプションを開きます。
curl(Linux、macOS、Cloud Shell)
次のコマンドを実行します。
curl -X DELETE \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID "
PowerShell(Windows)
次のコマンドを実行します。
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method DELETE ` -Headers $headers ` -Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID " | Select-Object -Expand Content
次のような JSON レスポンスが返されます。
レスポンス
{
"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": "delete",
"requestedCancellation": false,
"apiVersion": "v1"
},
"done": false
}
Cloud Storage バケットを削除する
Google Cloud コンソールで、Cloud Storage の [ブラウザ] ページに移動します。
[Cloud Storage ブラウザ] ページに移動
作成したバケットの横にあるチェックボックスをオンにします。
[削除 ] をクリックします。
表示されるダイアログ ウィンドウで、[削除 ] をクリックしてバケットとそのコンテンツを削除します。