本頁面說明如何建立及管理 Transcoder API 工作。
工作是使用 Transcoder API 管理作業的基本單位。將工作提交至 Transcoder API 時,您必須指定處理工作的地理位置。您可以列出區域中的所有工作。
如要進一步瞭解如何跨地理區域處理工作和相關 Google Cloud 資源,請參閱「區域」。
設定 Google Cloud 專案和驗證
如果您尚未建立 Google Cloud 專案和憑證,請參閱「事前準備」。建立工作
您可以使用預設工作範本或自行建立的自訂工作範本來建立工作。如要瞭解如何建立工作範本,請參閱「建立及管理工作範本」。除了使用範本,您也可以建立工作,並直接在要求中傳送工作設定。
Transcoder API 支援兩種工作模式:互動式和批次。以下各節說明如何以互動模式啟動工作。如要以批次模式啟動工作,您必須設定額外欄位 (詳情請參閱批次工作)。
根據預設設定建立工作
如要建立工作,請使用 projects.locations.jobs.create 方法。工作會對以物件形式儲存在 Cloud Storage 中的媒體檔案進行轉碼。
REST
使用任何要求資料之前,請先修改下列項目的值:
PROJECT_ID:IAM 設定中列出的 Google Cloud 專案 ID。LOCATION:執行工作的位置。請使用支援的地區。顯示地區us-central1us-west1us-west2us-east1us-east4southamerica-east1northamerica-northeast1asia-east1asia-northeast1asia-northeast3asia-south1asia-southeast1australia-southeast1europe-west1europe-west2europe-west4me-west1me-central1me-central2
STORAGE_BUCKET_NAME:您建立的 Cloud Storage bucket 名稱。STORAGE_INPUT_VIDEO:Cloud Storage bucket 中要轉碼的影片名稱,例如my-vid.mp4。這個欄位應考量您在 bucket 中建立的所有資料夾 (例如input/my-vid.mp4)。STORAGE_OUTPUT_FOLDER:要儲存編碼影片輸出內容的 Cloud Storage 資料夾名稱。
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_NUMBER/locations/LOCATION/jobs/JOB_ID",
"config": {
"inputs": [
{
"key": "input0",
"uri": "gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO"
}
],
"editList": [
{
"key": "atom0",
"inputs": [
"input0"
],
"startTimeOffset": "0s"
}
],
"elementaryStreams": [
{
"videoStream": {
"h264": {
"widthPixels": 640,
"heightPixels": 360,
"frameRate": 30,
"bitrateBps": 550000,
"pixelFormat": "yuv420p",
"rateControlMode": "vbr",
"crfLevel": 21,
"gopDuration": "3s",
"vbvSizeBits": 550000,
"vbvFullnessBits": 495000,
"entropyCoder": "cabac",
"bFrameCount": 3,
"aqStrength": 1,
"profile": "high",
"preset": "veryfast"
}
},
"key": "video-stream0"
},
{
"videoStream": {
"h264": {
"widthPixels": 1280,
"heightPixels": 720,
"frameRate": 30,
"bitrateBps": 2500000,
"pixelFormat": "yuv420p",
"rateControlMode": "vbr",
"crfLevel": 21,
"gopDuration": "3s",
"vbvSizeBits": 2500000,
"vbvFullnessBits": 2250000,
"entropyCoder": "cabac",
"bFrameCount": 3,
"aqStrength": 1,
"profile": "high",
"preset": "veryfast"
}
},
"key": "video-stream1"
},
{
"audioStream": {
"codec": "aac",
"bitrateBps": 64000,
"channelCount": 2,
"channelLayout": [
"fl",
"fr"
],
"sampleRateHertz": 48000
},
"key": "audio-stream0"
}
],
"muxStreams": [
{
"key": "sd",
"fileName": "sd.mp4",
"container": "mp4",
"elementaryStreams": [
"video-stream0",
"audio-stream0"
]
},
{
"key": "hd",
"fileName": "hd.mp4",
"container": "mp4",
"elementaryStreams": [
"video-stream1",
"audio-stream0"
]
},
{
"key": "media-sd",
"fileName": "media-sd.ts",
"container": "ts",
"elementaryStreams": [
"video-stream0",
"audio-stream0"
]
},
{
"key": "media-hd",
"fileName": "media-hd.ts",
"container": "ts",
"elementaryStreams": [
"video-stream1",
"audio-stream0"
]
},
{
"key": "video-only-sd",
"fileName": "video-only-sd.m4s",
"container": "fmp4",
"elementaryStreams": [
"video-stream0"
]
},
{
"key": "video-only-hd",
"fileName": "video-only-hd.m4s",
"container": "fmp4",
"elementaryStreams": [
"video-stream1"
]
},
{
"key": "audio-only",
"fileName": "audio-only.m4s",
"container": "fmp4",
"elementaryStreams": [
"audio-stream0"
]
}
],
"manifests": [
{
"fileName": "manifest.m3u8",
"type": "HLS",
"muxStreams": [
"media-sd",
"media-hd"
]
},
{
"fileName": "manifest.mpd",
"type": "DASH",
"muxStreams": [
"video-only-sd",
"video-only-hd",
"audio-only"
]
}
],
"output": {
"uri": "gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/"
}
},
"state": "PENDING",
"createTime": CREATE_TIME,
"ttlAfterCompletionDays": 30
}
gcloud
使用下列任何指令資料前,請先替換以下項目:
LOCATION:執行工作的位置。請使用支援的地區。顯示地區us-central1us-west1us-west2us-east1us-east4southamerica-east1northamerica-northeast1asia-east1asia-northeast1asia-northeast3asia-south1asia-southeast1australia-southeast1europe-west1europe-west2europe-west4me-west1me-central1me-central2
STORAGE_BUCKET_NAME:您建立的 Cloud Storage bucket 名稱。STORAGE_INPUT_VIDEO:Cloud Storage bucket 中要轉碼的影片名稱,例如my-vid.mp4。這個欄位應考量您在 bucket 中建立的所有資料夾 (例如input/my-vid.mp4)。STORAGE_OUTPUT_FOLDER:要儲存編碼影片輸出內容的 Cloud Storage 資料夾名稱。
執行下列指令:
Linux、macOS 或 Cloud Shell
gcloud transcoder jobs create \ --input-uri="gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO" \ --location=LOCATION \ --output-uri="gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/" \ --template-id="preset/web-hd"
Windows (PowerShell)
gcloud transcoder jobs create ` --input-uri="gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO" ` --location=LOCATION ` --output-uri="gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/" ` --template-id="preset/web-hd"
Windows (cmd.exe)
gcloud transcoder jobs create ^ --input-uri="gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO" ^ --location=LOCATION ^ --output-uri="gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/" ^ --template-id="preset/web-hd"
您應該會收到類似以下的回應:
回應
{
"name": "projects/PROJECT_NUMBER/locations/LOCATION/jobs/JOB_ID",
"config": {
"inputs": [
{
"key": "input0",
"uri": "gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO"
}
],
"editList": [
{
"key": "atom0",
"inputs": [
"input0"
],
"startTimeOffset": "0s"
}
],
"elementaryStreams": [
{
"videoStream": {
"h264": {
"widthPixels": 640,
"heightPixels": 360,
"frameRate": 30,
"bitrateBps": 550000,
"pixelFormat": "yuv420p",
"rateControlMode": "vbr",
"crfLevel": 21,
"gopDuration": "3s",
"vbvSizeBits": 550000,
"vbvFullnessBits": 495000,
"entropyCoder": "cabac",
"bFrameCount": 3,
"aqStrength": 1,
"profile": "high",
"preset": "veryfast"
}
},
"key": "video-stream0"
},
{
"videoStream": {
"h264": {
"widthPixels": 1280,
"heightPixels": 720,
"frameRate": 30,
"bitrateBps": 2500000,
"pixelFormat": "yuv420p",
"rateControlMode": "vbr",
"crfLevel": 21,
"gopDuration": "3s",
"vbvSizeBits": 2500000,
"vbvFullnessBits": 2250000,
"entropyCoder": "cabac",
"bFrameCount": 3,
"aqStrength": 1,
"profile": "high",
"preset": "veryfast"
}
},
"key": "video-stream1"
},
{
"audioStream": {
"codec": "aac",
"bitrateBps": 64000,
"channelCount": 2,
"channelLayout": [
"fl",
"fr"
],
"sampleRateHertz": 48000
},
"key": "audio-stream0"
}
],
"muxStreams": [
{
"key": "sd",
"fileName": "sd.mp4",
"container": "mp4",
"elementaryStreams": [
"video-stream0",
"audio-stream0"
]
},
{
"key": "hd",
"fileName": "hd.mp4",
"container": "mp4",
"elementaryStreams": [
"video-stream1",
"audio-stream0"
]
},
{
"key": "media-sd",
"fileName": "media-sd.ts",
"container": "ts",
"elementaryStreams": [
"video-stream0",
"audio-stream0"
]
},
{
"key": "media-hd",
"fileName": "media-hd.ts",
"container": "ts",
"elementaryStreams": [
"video-stream1",
"audio-stream0"
]
},
{
"key": "video-only-sd",
"fileName": "video-only-sd.m4s",
"container": "fmp4",
"elementaryStreams": [
"video-stream0"
]
},
{
"key": "video-only-hd",
"fileName": "video-only-hd.m4s",
"container": "fmp4",
"elementaryStreams": [
"video-stream1"
]
},
{
"key": "audio-only",
"fileName": "audio-only.m4s",
"container": "fmp4",
"elementaryStreams": [
"audio-stream0"
]
}
],
"manifests": [
{
"fileName": "manifest.m3u8",
"type": "HLS",
"muxStreams": [
"media-sd",
"media-hd"
]
},
{
"fileName": "manifest.mpd",
"type": "DASH",
"muxStreams": [
"video-only-sd",
"video-only-hd",
"audio-only"
]
}
],
"output": {
"uri": "gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/"
}
},
"state": "PENDING",
"createTime": CREATE_TIME,
"ttlAfterCompletionDays": 30
}
C#
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 C# 設定說明操作。詳情請參閱 Transcoder API C# API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Go
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Go 設定說明操作。詳情請參閱 Transcoder API Go API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Java
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Java 設定說明操作。詳情請參閱 Transcoder API Java API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Node.js
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Node.js 設定說明操作。詳情請參閱 Transcoder API Node.js API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
PHP
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 PHP 設定說明操作。詳情請參閱 Transcoder API PHP API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Python
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Python 設定說明操作。詳情請參閱 Transcoder API Python API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Ruby
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Ruby 設定說明操作。詳情請參閱 Transcoder API Ruby API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
依據工作範本建立工作
如果您在某個位置建立了至少一個工作範本,則可在傳送要求以在該位置建立 Transcoder API 工作時,指定工作範本。
如要建立工作,請使用 projects.locations.jobs.create 方法。
REST
使用任何要求資料之前,請先修改下列項目的值:
PROJECT_ID:IAM 設定中列出的 Google Cloud 專案 ID。LOCATION:執行工作的位置。請使用支援的地區。顯示地區us-central1us-west1us-west2us-east1us-east4southamerica-east1northamerica-northeast1asia-east1asia-northeast1asia-northeast3asia-south1asia-southeast1australia-southeast1europe-west1europe-west2europe-west4me-west1me-central1me-central2
STORAGE_BUCKET_NAME:您建立的 Cloud Storage bucket 名稱。STORAGE_INPUT_VIDEO:Cloud Storage bucket 中要轉碼的影片名稱,例如my-vid.mp4。這個欄位應考量您在 bucket 中建立的所有資料夾 (例如input/my-vid.mp4)。STORAGE_OUTPUT_FOLDER:要儲存編碼影片輸出內容的 Cloud Storage 資料夾名稱。TEMPLATE_ID:您建立的工作範本 ID。如未指定自訂工作範本,Transcoder API 會使用preset/web-hd工作範本。
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_NUMBER/locations/LOCATION/jobs/JOB_ID",
"config": {
"inputs": [
{
"key": "input0",
"uri": "gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO"
}
],
"editList": [
{
"key": "atom0",
"inputs": [
"input0"
],
"startTimeOffset": "0s"
}
],
"elementaryStreams": [
{
"videoStream": {
"h264": {
"widthPixels": 640,
"heightPixels": 360,
"frameRate": 60,
"bitrateBps": 550000,
"pixelFormat": "yuv420p",
"rateControlMode": "vbr",
"crfLevel": 21,
"gopDuration": "3s",
"vbvSizeBits": 550000,
"vbvFullnessBits": 495000,
"entropyCoder": "cabac",
"profile": "high",
"preset": "veryfast"
}
},
"key": "video-stream0"
},
{
"videoStream": {
"h264": {
"widthPixels": 1280,
"heightPixels": 720,
"frameRate": 60,
"bitrateBps": 2500000,
"pixelFormat": "yuv420p",
"rateControlMode": "vbr",
"crfLevel": 21,
"gopDuration": "3s",
"vbvSizeBits": 2500000,
"vbvFullnessBits": 2250000,
"entropyCoder": "cabac",
"profile": "high",
"preset": "veryfast"
}
},
"key": "video-stream1"
},
{
"audioStream": {
"codec": "aac",
"bitrateBps": 64000,
"channelCount": 2,
"channelLayout": [
"fl",
"fr"
],
"sampleRateHertz": 48000
},
"key": "audio-stream0"
}
],
"muxStreams": [
{
"key": "sd",
"fileName": "sd.mp4",
"container": "mp4",
"elementaryStreams": [
"video-stream0",
"audio-stream0"
]
},
{
"key": "hd",
"fileName": "hd.mp4",
"container": "mp4",
"elementaryStreams": [
"video-stream1",
"audio-stream0"
]
}
],
"output": {
"uri": "gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/"
}
},
"state": "PENDING",
"createTime": CREATE_TIME,
"ttlAfterCompletionDays": 30
}
gcloud
- 對
gcloud指令進行下列替換: - STORAGE_BUCKET_NAME:您建立的 Cloud Storage bucket 名稱。
- STORAGE_INPUT_VIDEO:Cloud Storage bucket 中要轉碼的影片名稱,例如
my-vid.mp4。這個欄位應考量您在 bucket 中建立的所有資料夾 (例如input/my-vid.mp4)。 - LOCATION:工作執行位置。請使用支援的地區。顯示地區
us-central1us-west1us-west2us-east1us-east4southamerica-east1northamerica-northeast1asia-east1asia-northeast1asia-northeast3asia-south1asia-southeast1australia-southeast1europe-west1europe-west2europe-west4me-west1me-central1me-central2
- STORAGE_OUTPUT_FOLDER:要儲存編碼影片輸出內容的 Cloud Storage 資料夾名稱。
- TEMPLATE_ID:您建立的工作範本 ID。如未指定自訂工作範本,Transcoder API 會使用
preset/web-hd工作範本。 - 請執行下列指令:
畫面會顯示類似下列內容的回應:gcloud transcoder jobs create \ --input-uri="gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO" \ --location=LOCATION \ --output-uri="gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/" \ --template-id="TEMPLATE_ID"
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/jobs/JOB_ID", "config": { "inputs": [ { "key": "input0", "uri": "gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO" } ], "editList": [ { "key": "atom0", "inputs": [ "input0" ], "startTimeOffset": "0s" } ], "elementaryStreams": [ { "videoStream": { "h264": { "widthPixels": 640, "heightPixels": 360, "frameRate": 60, "bitrateBps": 550000, "pixelFormat": "yuv420p", "rateControlMode": "vbr", "crfLevel": 21, "gopDuration": "3s", "vbvSizeBits": 550000, "vbvFullnessBits": 495000, "entropyCoder": "cabac", "profile": "high", "preset": "veryfast" } }, "key": "video-stream0" }, { "videoStream": { "h264": { "widthPixels": 1280, "heightPixels": 720, "frameRate": 60, "bitrateBps": 2500000, "pixelFormat": "yuv420p", "rateControlMode": "vbr", "crfLevel": 21, "gopDuration": "3s", "vbvSizeBits": 2500000, "vbvFullnessBits": 2250000, "entropyCoder": "cabac", "profile": "high", "preset": "veryfast" } }, "key": "video-stream1" }, { "audioStream": { "codec": "aac", "bitrateBps": 64000, "channelCount": 2, "channelLayout": [ "fl", "fr" ], "sampleRateHertz": 48000 }, "key": "audio-stream0" } ], "muxStreams": [ { "key": "sd", "fileName": "sd.mp4", "container": "mp4", "elementaryStreams": [ "video-stream0", "audio-stream0" ] }, { "key": "hd", "fileName": "hd.mp4", "container": "mp4", "elementaryStreams": [ "video-stream1", "audio-stream0" ] } ], "output": { "uri": "gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/" } }, "state": "PENDING", "createTime": CREATE_TIME, "ttlAfterCompletionDays": 30 }
C#
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 C# 設定說明操作。詳情請參閱 Transcoder API C# API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Go
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Go 設定說明操作。詳情請參閱 Transcoder API Go API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Java
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Java 設定說明操作。詳情請參閱 Transcoder API Java API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Node.js
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Node.js 設定說明操作。詳情請參閱 Transcoder API Node.js API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
PHP
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 PHP 設定說明操作。詳情請參閱 Transcoder API PHP API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Python
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Python 設定說明操作。詳情請參閱 Transcoder API Python API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Ruby
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Ruby 設定說明操作。詳情請參閱 Transcoder API Ruby API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
回應與使用預設範本建立工作時傳回的回應類似。
使用臨時設定建立工作
您可以在建立工作的要求中,傳送工作的臨時設定。
如要建立工作,請使用 projects.locations.jobs.create 方法。
REST
使用任何要求資料之前,請先修改下列項目的值:
PROJECT_ID:IAM 設定中列出的 Google Cloud 專案 ID。LOCATION:執行工作的位置。請使用支援的地區。顯示地區us-central1us-west1us-west2us-east1us-east4southamerica-east1northamerica-northeast1asia-east1asia-northeast1asia-northeast3asia-south1asia-southeast1australia-southeast1europe-west1europe-west2europe-west4me-west1me-central1me-central2
STORAGE_BUCKET_NAME:您建立的 Cloud Storage bucket 名稱。STORAGE_INPUT_VIDEO:Cloud Storage bucket 中要轉碼的影片名稱,例如my-vid.mp4。這個欄位應考量您在 bucket 中建立的所有資料夾 (例如input/my-vid.mp4)。STORAGE_OUTPUT_FOLDER:要儲存編碼影片輸出內容的 Cloud Storage 資料夾名稱。
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_NUMBER/locations/LOCATION/jobs/JOB_ID",
"config": {
"inputs": [
{
"key": "input0",
"uri": "gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO"
}
],
"editList": [
{
"key": "atom0",
"inputs": [
"input0"
],
"startTimeOffset": "0s"
}
],
"elementaryStreams": [
{
"videoStream": {
"h264": {
"widthPixels": 640,
"heightPixels": 360,
"frameRate": 60,
"bitrateBps": 550000,
"pixelFormat": "yuv420p",
"rateControlMode": "vbr",
"crfLevel": 21,
"gopDuration": "3s",
"vbvSizeBits": 550000,
"vbvFullnessBits": 495000,
"entropyCoder": "cabac",
"profile": "high",
"preset": "veryfast"
}
},
"key": "video-stream0"
},
{
"videoStream": {
"h264": {
"widthPixels": 1280,
"heightPixels": 720,
"frameRate": 60,
"bitrateBps": 2500000,
"pixelFormat": "yuv420p",
"rateControlMode": "vbr",
"crfLevel": 21,
"gopDuration": "3s",
"vbvSizeBits": 2500000,
"vbvFullnessBits": 2250000,
"entropyCoder": "cabac",
"profile": "high",
"preset": "veryfast"
}
},
"key": "video-stream1"
},
{
"audioStream": {
"codec": "aac",
"bitrateBps": 64000,
"channelCount": 2,
"channelLayout": [
"fl",
"fr"
],
"sampleRateHertz": 48000
},
"key": "audio-stream0"
}
],
"muxStreams": [
{
"key": "sd",
"fileName": "sd.mp4",
"container": "mp4",
"elementaryStreams": [
"video-stream0",
"audio-stream0"
]
},
{
"key": "hd",
"fileName": "hd.mp4",
"container": "mp4",
"elementaryStreams": [
"video-stream1",
"audio-stream0"
]
}
],
"output": {
"uri": "gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/"
}
},
"state": "PENDING",
"createTime": CREATE_TIME,
"ttlAfterCompletionDays": 30
}
gcloud
使用下列任何指令資料前,請先替換以下項目:
LOCATION:執行工作的位置。請使用支援的地區。顯示地區us-central1us-west1us-west2us-east1us-east4southamerica-east1northamerica-northeast1asia-east1asia-northeast1asia-northeast3asia-south1asia-southeast1australia-southeast1europe-west1europe-west2europe-west4me-west1me-central1me-central2
STORAGE_BUCKET_NAME:您建立的 Cloud Storage bucket 名稱。STORAGE_INPUT_VIDEO:Cloud Storage bucket 中要轉碼的影片名稱,例如my-vid.mp4。這個欄位應考量您在 bucket 中建立的所有資料夾 (例如input/my-vid.mp4)。STORAGE_OUTPUT_FOLDER:要儲存編碼影片輸出內容的 Cloud Storage 資料夾名稱。
將下列內容儲存至名為 request.json 的檔案:
{ "config": { "elementaryStreams": [ { "key": "video-stream0", "videoStream": { "h264": { "heightPixels": 360, "widthPixels": 640, "bitrateBps": 550000, "frameRate": 60 } } }, { "key": "video-stream1", "videoStream": { "h264": { "heightPixels": 720, "widthPixels": 1280, "bitrateBps": 2500000, "frameRate": 60 } } }, { "key": "audio-stream0", "audioStream": { "codec": "aac", "bitrateBps": 64000 } } ], "muxStreams": [ { "key": "sd", "container": "mp4", "elementaryStreams": [ "video-stream0", "audio-stream0" ] }, { "key": "hd", "container": "mp4", "elementaryStreams": [ "video-stream1", "audio-stream0" ] } ] } }
執行下列指令:
Linux、macOS 或 Cloud Shell
gcloud transcoder jobs create \ --input-uri="gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO" \ --location=LOCATION \ --output-uri="gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/" \ --file="request.json"
Windows (PowerShell)
gcloud transcoder jobs create ` --input-uri="gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO" ` --location=LOCATION ` --output-uri="gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/" ` --file="request.json"
Windows (cmd.exe)
gcloud transcoder jobs create ^ --input-uri="gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO" ^ --location=LOCATION ^ --output-uri="gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/" ^ --file="request.json"
您應該會收到類似以下的回應:
回應
{
"name": "projects/PROJECT_NUMBER/locations/LOCATION/jobs/JOB_ID",
"config": {
"inputs": [
{
"key": "input0",
"uri": "gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO"
}
],
"editList": [
{
"key": "atom0",
"inputs": [
"input0"
],
"startTimeOffset": "0s"
}
],
"elementaryStreams": [
{
"videoStream": {
"h264": {
"widthPixels": 640,
"heightPixels": 360,
"frameRate": 60,
"bitrateBps": 550000,
"pixelFormat": "yuv420p",
"rateControlMode": "vbr",
"crfLevel": 21,
"gopDuration": "3s",
"vbvSizeBits": 550000,
"vbvFullnessBits": 495000,
"entropyCoder": "cabac",
"profile": "high",
"preset": "veryfast"
}
},
"key": "video-stream0"
},
{
"videoStream": {
"h264": {
"widthPixels": 1280,
"heightPixels": 720,
"frameRate": 60,
"bitrateBps": 2500000,
"pixelFormat": "yuv420p",
"rateControlMode": "vbr",
"crfLevel": 21,
"gopDuration": "3s",
"vbvSizeBits": 2500000,
"vbvFullnessBits": 2250000,
"entropyCoder": "cabac",
"profile": "high",
"preset": "veryfast"
}
},
"key": "video-stream1"
},
{
"audioStream": {
"codec": "aac",
"bitrateBps": 64000,
"channelCount": 2,
"channelLayout": [
"fl",
"fr"
],
"sampleRateHertz": 48000
},
"key": "audio-stream0"
}
],
"muxStreams": [
{
"key": "sd",
"fileName": "sd.mp4",
"container": "mp4",
"elementaryStreams": [
"video-stream0",
"audio-stream0"
]
},
{
"key": "hd",
"fileName": "hd.mp4",
"container": "mp4",
"elementaryStreams": [
"video-stream1",
"audio-stream0"
]
}
],
"output": {
"uri": "gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/"
}
},
"state": "PENDING",
"createTime": CREATE_TIME,
"ttlAfterCompletionDays": 30
}
C#
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 C# 設定說明操作。詳情請參閱 Transcoder API C# API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Go
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Go 設定說明操作。詳情請參閱 Transcoder API Go API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Java
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Java 設定說明操作。詳情請參閱 Transcoder API Java API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Node.js
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Node.js 設定說明操作。詳情請參閱 Transcoder API Node.js API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
PHP
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 PHP 設定說明操作。詳情請參閱 Transcoder API PHP API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Python
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Python 設定說明操作。詳情請參閱 Transcoder API Python API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Ruby
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Ruby 設定說明操作。詳情請參閱 Transcoder API Ruby API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
正在取得工作詳細資料
如要查看工作的詳細資料或狀態,請使用 projects.locations.jobs.get 方法。
REST
使用任何要求資料之前,請先修改下列項目的值:
JOB_ID:您建立的工作 ID。PROJECT_ID: Google Cloud 專案 ID。LOCATION:工作位置。請使用其中一個支援的地區。us-central1us-west1us-west2us-east1us-east4southamerica-east1northamerica-northeast1asia-east1asia-northeast1asia-northeast3asia-south1asia-southeast1australia-southeast1europe-west1europe-west2europe-west4me-west1me-central1me-central2
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_NUMBER/locations/LOCATION/jobs/JOB_ID",
"config": {
"inputs": [
{
"key": "input0",
"uri": "gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO"
}
],
"editList": [
{
"key": "atom0",
"inputs": [
"input0"
],
"startTimeOffset": "0s"
}
],
"elementaryStreams": [
{
"videoStream": {
"h264": {
"widthPixels": 640,
"heightPixels": 360,
"frameRate": 60,
"bitrateBps": 550000,
"pixelFormat": "yuv420p",
"rateControlMode": "vbr",
"crfLevel": 21,
"gopDuration": "3s",
"vbvSizeBits": 550000,
"vbvFullnessBits": 495000,
"entropyCoder": "cabac",
"profile": "high",
"preset": "veryfast"
}
},
"key": "video-stream0"
},
{
"videoStream": {
"h264": {
"widthPixels": 1280,
"heightPixels": 720,
"frameRate": 60,
"bitrateBps": 2500000,
"pixelFormat": "yuv420p",
"rateControlMode": "vbr",
"crfLevel": 21,
"gopDuration": "3s",
"vbvSizeBits": 2500000,
"vbvFullnessBits": 2250000,
"entropyCoder": "cabac",
"profile": "high",
"preset": "veryfast"
}
},
"key": "video-stream1"
},
{
"audioStream": {
"codec": "aac",
"bitrateBps": 64000,
"channelCount": 2,
"channelLayout": [
"fl",
"fr"
],
"sampleRateHertz": 48000
},
"key": "audio-stream0"
}
],
"muxStreams": [
{
"key": "sd",
"fileName": "sd.mp4",
"container": "mp4",
"elementaryStreams": [
"video-stream0",
"audio-stream0"
]
},
{
"key": "hd",
"fileName": "hd.mp4",
"container": "mp4",
"elementaryStreams": [
"video-stream1",
"audio-stream0"
]
}
],
"output": {
"uri": "gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/"
}
},
"state": "PENDING",
"createTime": CREATE_TIME,
"ttlAfterCompletionDays": 30
}
gcloud
- 對
gcloud指令進行下列替換: - JOB_ID:您建立的工作 ID。
- LOCATION:工作的位置。請使用支援的地區。顯示地區
us-central1us-west1us-west2us-east1us-east4southamerica-east1northamerica-northeast1asia-east1asia-northeast1asia-northeast3asia-south1asia-southeast1australia-southeast1europe-west1europe-west2europe-west4me-west1me-central1me-central2
- 執行下列指令:
畫面會顯示類似下列內容的回應:gcloud transcoder jobs describe JOB_ID --location=LOCATION
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/jobs/JOB_ID", "config": { "inputs": [ { "key": "input0", "uri": "gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO" } ], "editList": [ { "key": "atom0", "inputs": [ "input0" ], "startTimeOffset": "0s" } ], "elementaryStreams": [ { "videoStream": { "h264": { "widthPixels": 640, "heightPixels": 360, "frameRate": 60, "bitrateBps": 550000, "pixelFormat": "yuv420p", "rateControlMode": "vbr", "crfLevel": 21, "gopDuration": "3s", "vbvSizeBits": 550000, "vbvFullnessBits": 495000, "entropyCoder": "cabac", "profile": "high", "preset": "veryfast" } }, "key": "video-stream0" }, { "videoStream": { "h264": { "widthPixels": 1280, "heightPixels": 720, "frameRate": 60, "bitrateBps": 2500000, "pixelFormat": "yuv420p", "rateControlMode": "vbr", "crfLevel": 21, "gopDuration": "3s", "vbvSizeBits": 2500000, "vbvFullnessBits": 2250000, "entropyCoder": "cabac", "profile": "high", "preset": "veryfast" } }, "key": "video-stream1" }, { "audioStream": { "codec": "aac", "bitrateBps": 64000, "channelCount": 2, "channelLayout": [ "fl", "fr" ], "sampleRateHertz": 48000 }, "key": "audio-stream0" } ], "muxStreams": [ { "key": "sd", "fileName": "sd.mp4", "container": "mp4", "elementaryStreams": [ "video-stream0", "audio-stream0" ] }, { "key": "hd", "fileName": "hd.mp4", "container": "mp4", "elementaryStreams": [ "video-stream1", "audio-stream0" ] } ], "output": { "uri": "gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/" } }, "state": "PENDING", "createTime": CREATE_TIME, "ttlAfterCompletionDays": 30 }
C#
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 C# 設定說明操作。詳情請參閱 Transcoder API C# API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Go
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Go 設定說明操作。詳情請參閱 Transcoder API Go API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Java
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Java 設定說明操作。詳情請參閱 Transcoder API Java API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Node.js
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Node.js 設定說明操作。詳情請參閱 Transcoder API Node.js API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
PHP
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 PHP 設定說明操作。詳情請參閱 Transcoder API PHP API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Python
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Python 設定說明操作。詳情請參閱 Transcoder API Python API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Ruby
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Ruby 設定說明操作。詳情請參閱 Transcoder API Ruby API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
回應與建立工作時傳回的回應類似。
列出工作
如要查看您在某個位置建立的所有工作,請使用 projects.locations.jobs.list 方法。
REST
使用任何要求資料之前,請先修改下列項目的值:
PROJECT_ID: Google Cloud 專案 ID。LOCATION:工作的位置。請使用其中一個支援的地區。us-central1us-west1us-west2us-east1us-east4southamerica-east1northamerica-northeast1asia-east1asia-northeast1asia-northeast3asia-south1asia-southeast1australia-southeast1europe-west1europe-west2europe-west4me-west1me-central1me-central2
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"jobs": [
{
"name": "projects/PROJECT_NUMBER/locations/LOCATION/jobs/MY_JOB",
"config": {
....
},
"state": "PENDING",
"createTime": CREATE_TIME,
"ttlAfterCompletionDays": 30
},
{
"name": "projects/PROJECT_NUMBER/locations/LOCATION/jobs/MY_OTHER_JOB",
"config": {
....
},
"state": "SUCCEEDED",
"createTime": CREATE_TIME,
"startTime": START_TIME,
"endTime": END_TIME,
"ttlAfterCompletionDays": 30
}
]
}
gcloud
- 對
gcloud指令進行下列替換: - LOCATION::
工作的位置。請使用支援的地區。顯示地區
us-central1us-west1us-west2us-east1us-east4southamerica-east1northamerica-northeast1asia-east1asia-northeast1asia-northeast3asia-south1asia-southeast1australia-southeast1europe-west1europe-west2europe-west4me-west1me-central1me-central2
- 執行下列指令:
畫面會顯示類似下列內容的回應:gcloud transcoder jobs list --location=LOCATION
NAME STATE FAILURE_REASON projects/PROJECT_NUMBER/locations/LOCATION/jobs/JOB_ID SUCCEEDED projects/PROJECT_NUMBER/locations/LOCATION/jobs/abc123 SUCCEEDED
C#
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 C# 設定說明操作。詳情請參閱 Transcoder API C# API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Go
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Go 設定說明操作。詳情請參閱 Transcoder API Go API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Java
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Java 設定說明操作。詳情請參閱 Transcoder API Java API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Node.js
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Node.js 設定說明操作。詳情請參閱 Transcoder API Node.js API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
PHP
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 PHP 設定說明操作。詳情請參閱 Transcoder API PHP API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Python
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Python 設定說明操作。詳情請參閱 Transcoder API Python API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Ruby
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Ruby 設定說明操作。詳情請參閱 Transcoder API Ruby API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
額外結果
列出工作的回應可能包含 nextPageToken,您可以使用這個值擷取其他結果:
{
"jobs": [
...
],
"nextPageToken": "NEXT_PAGE_TOKEN"
}
在下列 curl 範例中,您可以傳送另一項要求,並加入 NEXT_PAGE_TOKEN 的值,列出其他工作,如下所示:
curl -X GET \ -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \ https://transcoder.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/jobs?pageToken=NEXT_PAGE_TOKEN
如要進一步瞭解如何使用這個權杖,請參閱相關用戶端程式庫。
篩選結果
您可以篩選 list jobs 方法的結果。例如,執行下列 curl 指令,列出所有執行中的工作:
curl -X GET \ -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \ 'https://transcoder.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/jobs?filter=-state="FAILED"+AND+-state="SUCCEEDED"'
這個指令會使用否定運算子,列出未失敗「且」未成功的任務。產生的清單會包含執行中或待處理的工作 (如要瞭解工作狀態,請參閱 ProcessingState)。
以下提供幾個篩選條件範例:
?filter=state="FAILED"+OR+state="SUCCEEDED":列出已完成的工作?filter=createTime+>+"2021-06-09T19:25:21.007649960Z":列出在特定時間戳記後建立的工作?filter=inputUri="gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO":列出具有特定輸入 URI 的工作?filter=config.output.uri="gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/":列出具有特定輸出 URI 的工作
詳情請參閱「AIP-160 - 篩選」。
刪除工作
如要刪除工作,請使用 projects.locations.jobs.delete 方法。
REST
使用任何要求資料之前,請先修改下列項目的值:
JOB_ID:您建立的工作 ID。PROJECT_ID: Google Cloud 專案 ID。LOCATION:工作位置。請使用其中一個支援的地區。us-central1us-west1us-west2us-east1us-east4southamerica-east1northamerica-northeast1asia-east1asia-northeast1asia-northeast3asia-south1asia-southeast1australia-southeast1europe-west1europe-west2europe-west4me-west1me-central1me-central2
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{}
gcloud
- 對
gcloud指令進行下列替換: - JOB_ID:您建立的工作 ID。
- LOCATION:工作的位置。請使用支援的地區。顯示地區
us-central1us-west1us-west2us-east1us-east4southamerica-east1northamerica-northeast1asia-east1asia-northeast1asia-northeast3asia-south1asia-southeast1australia-southeast1europe-west1europe-west2europe-west4me-west1me-central1me-central2
- 執行下列指令:
畫面會顯示類似下列內容的回應:gcloud transcoder jobs delete JOB_ID --location=LOCATION
Deleted job [projects/PROJECT_ID/locations/LOCATION/jobs/JOB_ID].
C#
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 C# 設定說明操作。詳情請參閱 Transcoder API C# API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Go
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Go 設定說明操作。詳情請參閱 Transcoder API Go API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Java
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Java 設定說明操作。詳情請參閱 Transcoder API Java API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Node.js
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Node.js 設定說明操作。詳情請參閱 Transcoder API Node.js API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
PHP
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 PHP 設定說明操作。詳情請參閱 Transcoder API PHP API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Python
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Python 設定說明操作。詳情請參閱 Transcoder API Python API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
Ruby
在試用這個範例之前,請先按照「使用用戶端程式庫的 Transcoder API 快速入門導覽課程」中的 Ruby 設定說明操作。詳情請參閱 Transcoder API Ruby API 參考文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。詳情請參閱「為本機開發環境設定驗證機制」。
後續步驟
瞭解如何建立及管理工作範本。