使用 Transcoder API 將影片轉碼
本頁說明如何使用 Transcoder API 的預設設定,透過 curl
、Windows PowerShell 或用戶端程式庫建立基本影片轉碼工作。
您也可以直接在 Google Cloud 主控台 使用下列任一程式設計語言,完成本快速入門導覽課程:
事前準備
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
Install the Google Cloud CLI.
-
如果您使用外部識別資訊提供者 (IdP),請先 使用聯合身分登入 gcloud CLI。
-
如要初始化 gcloud CLI,請執行下列指令:
gcloud init
-
Create or select a Google Cloud project.
-
Create a Google Cloud project:
gcloud projects create PROJECT_ID
Replace
PROJECT_ID
with a name for the Google Cloud project you are creating. -
Select the Google Cloud project that you created:
gcloud config set project PROJECT_ID
Replace
PROJECT_ID
with your Google Cloud project name.
-
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Transcoder API:
gcloud services enable transcoder.googleapis.com
-
Create local authentication credentials for your user account:
gcloud auth application-default login
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
-
Grant roles to your user account. Run the following command once for each of the following IAM roles:
roles/transcoder.admin, roles/storage.admin
gcloud projects add-iam-policy-binding PROJECT_ID --member="user:USER_IDENTIFIER" --role=ROLE
Replace the following:
PROJECT_ID
: your project ID.USER_IDENTIFIER
: the identifier for your user account—for example,myemail@example.com
.ROLE
: the IAM role that you grant to your user account.
-
Install the Google Cloud CLI.
-
如果您使用外部識別資訊提供者 (IdP),請先 使用聯合身分登入 gcloud CLI。
-
如要初始化 gcloud CLI,請執行下列指令:
gcloud init
-
Create or select a Google Cloud project.
-
Create a Google Cloud project:
gcloud projects create PROJECT_ID
Replace
PROJECT_ID
with a name for the Google Cloud project you are creating. -
Select the Google Cloud project that you created:
gcloud config set project PROJECT_ID
Replace
PROJECT_ID
with your Google Cloud project name.
-
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Transcoder API:
gcloud services enable transcoder.googleapis.com
-
Create local authentication credentials for your user account:
gcloud auth application-default login
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
-
Grant roles to your user account. Run the following command once for each of the following IAM roles:
roles/transcoder.admin, roles/storage.admin
gcloud projects add-iam-policy-binding PROJECT_ID --member="user:USER_IDENTIFIER" --role=ROLE
Replace the following:
PROJECT_ID
: your project ID.USER_IDENTIFIER
: the identifier for your user account—for example,myemail@example.com
.ROLE
: the IAM role that you grant to your user account.
-
Create a Cloud Storage bucket and configure it as follows:
-
Set the storage class to
S
(標準)。 -
將儲存空間位置設定為下列項目:
US
(美國)。 -
將
BUCKET_NAME
替換成 不重複的值區名稱。請勿在值區名稱中加入任何機密資訊,因為值區命名空間屬於全域性質,而且會公開顯示。 - 按一下「建立資料夾」,然後輸入名稱,建立要儲存編碼影片輸出內容的資料夾。
gcloud storage buckets create gs://BUCKET_NAME --default-storage-class STANDARD --location US
-
Set the storage class to
- 前往 Google Cloud 控制台的 Cloud Storage 瀏覽器頁面。
前往 Cloud Storage 瀏覽器頁面 - 按一下值區名稱即可開啟。
- 按一下「上傳檔案」。
- 從本機電腦選取要上傳的影片檔案。
PROJECT_ID
:IAM 設定中列出的 Google Cloud 專案 ID。LOCATION
:工作執行的位置。使用支援的地區。顯示地區us-central1
us-west1
us-west2
us-east1
us-east4
southamerica-east1
northamerica-northeast1
asia-east1
asia-northeast1
asia-northeast3
asia-south1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west4
me-west1
me-central1
me-central2
STORAGE_BUCKET_NAME
:您建立的 Cloud Storage bucket 名稱。STORAGE_INPUT_VIDEO
:Cloud Storage 值區中要轉碼的影片名稱,例如my-vid.mp4
。這個欄位應考量您在值區中建立的任何資料夾 (例如input/my-vid.mp4
)。STORAGE_OUTPUT_FOLDER
:您要儲存編碼影片輸出的 Cloud Storage 資料夾名稱。- 對
gcloud
指令進行下列替換: - STORAGE_BUCKET_NAME:您建立的 Cloud Storage bucket 名稱。
- STORAGE_INPUT_VIDEO:Cloud Storage 值區中要轉碼的影片名稱,例如
my-vid.mp4
。這個欄位應考量您在 bucket 中建立的任何資料夾 (例如input/my-vid.mp4
)。 - LOCATION:工作執行的位置。使用支援的地區。
顯示地區
us-central1
us-west1
us-west2
us-east1
us-east4
southamerica-east1
northamerica-northeast1
asia-east1
asia-northeast1
asia-northeast3
asia-south1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west4
me-west1
me-central1
me-central2
- STORAGE_OUTPUT_FOLDER:您要儲存編碼影片輸出的 Cloud Storage 資料夾名稱。
- 請執行下列指令:
畫面會顯示類似以下的回應:gcloud transcoder jobs create \ --input-uri="gs://STORAGE_BUCKET_NAME/STORAGE_INPUT_VIDEO" \ --location=LOCATION \ --output-uri="gs://STORAGE_BUCKET_NAME/STORAGE_OUTPUT_FOLDER/"
{ "config": { ... }, "createTime": CREATE_TIME, "name": "projects/PROJECT_NUMBER/locations/LOCATION/jobs/JOB_ID", "state": "PENDING", "ttlAfterCompletionDays": 30 }
JOB_ID
:您建立的工作 ID。PROJECT_ID
:您的 Google Cloud 專案 ID。LOCATION
:工作地點。使用支援的地區。顯示地區us-central1
us-west1
us-west2
us-east1
us-east4
southamerica-east1
northamerica-northeast1
asia-east1
asia-northeast1
asia-northeast3
asia-south1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west4
me-west1
me-central1
me-central2
- 對
gcloud
指令進行下列替換: - JOB_ID:您建立的工作 ID。
- LOCATION:工作地點。使用支援的地區。
顯示地區
us-central1
us-west1
us-west2
us-east1
us-east4
southamerica-east1
northamerica-northeast1
asia-east1
asia-northeast1
asia-northeast3
asia-south1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west4
me-west1
me-central1
me-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": 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 }
- 將您建立的 Cloud Storage bucket 設為可公開讀取。
- 如要在 Cloud Storage bucket 上啟用跨源資源共享 (CORS),請按照下列步驟操作:
- 建立包含下列內容的 JSON 檔案:
[ { "origin": ["https://shaka-player-demo.appspot.com/"], "responseHeader": ["Content-Type", "Range"], "method": ["GET", "HEAD"], "maxAgeSeconds": 3600 } ]
-
執行下列指令,並將 JSON_FILE_NAME 替換為您在上一個步驟中建立的 JSON 檔案名稱:
gcloud storage buckets update gs://STORAGE_BUCKET_NAME --cors-file=JSON_FILE_NAME.json
- 建立包含下列內容的 JSON 檔案:
- 從 Cloud Storage 值區中,挑選轉碼作業產生的其中一個 MP4 或資訊清單檔案。在該檔案的「Public access」(公開存取權) 資料欄中,按一下「Copy URL」(複製網址)。
- 前往 Shaka Player (這是一個線上即時串流播放器)。
- 按一下頂端導覽列中的「Custom Content」(自訂內容)。
- 按一下「+」按鈕。
將檔案的公開網址貼到「Manifest URL」(資訊清單網址) 方塊中。
在「Name」(名稱) 方塊中輸入名稱。
按一下「Save」(儲存)。
按一下「Play」(播放)。
前往 Google Cloud 控制台的 Cloud Storage 瀏覽器頁面。
找出您建立的值區,並選取旁邊的核取方塊。
點選「刪除」。
在出現的彈出式視窗中,按一下「刪除」,即可永久刪除值區及其內容。
JOB_ID
:您建立的工作 ID。PROJECT_ID
:您的 Google Cloud 專案 ID。LOCATION
:工作地點。使用支援的地區。顯示地區us-central1
us-west1
us-west2
us-east1
us-east4
southamerica-east1
northamerica-northeast1
asia-east1
asia-northeast1
asia-northeast3
asia-south1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west4
me-west1
me-central1
me-central2
- 對
gcloud
指令進行下列替換: - JOB_ID:您建立的工作 ID。
- LOCATION:工作地點。使用支援的地區。
顯示地區
us-central1
us-west1
us-west2
us-east1
us-east4
southamerica-east1
northamerica-northeast1
asia-east1
asia-northeast1
asia-northeast3
asia-south1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west4
me-west1
me-central1
me-central2
- 執行下列指令:
畫面會顯示類似以下的回應:gcloud transcoder jobs delete JOB_ID --location=LOCATION
Deleted job [projects/PROJECT_ID/locations/LOCATION/jobs/JOB_ID].
-
Optional: Revoke the authentication credentials that you created, and delete the local credential file.
gcloud auth application-default revoke
-
Optional: Revoke credentials from the gcloud CLI.
gcloud auth revoke
建立 Cloud Storage 值區
使用 Transcoder API 將影片轉碼
如要進行下列步驟,請準備本機電腦中至少 5 秒的影片 (範例影片)。請參閱支援的輸入和輸出格式清單。
將影片上傳至 Cloud Storage bucket
影片現在已儲存到 Cloud Storage 值區。
建立轉碼工作
根據預設,Transcoder API 會使用 H.264 編碼,以及 MP4、HLS 和 MPEG-DASH 封裝,將影片轉碼。接著,這項解決方案會為每部輸入的影片提供下列輸出版本:高畫質 (1280 x 720 像素) 和標準畫質 (640 x 360 像素)。
如要建立工作,請使用 projects.locations.jobs.create
方法。下列程式碼範例會使用預設建立基本轉碼工作。
REST
使用任何要求資料之前,請先替換以下項目:
如要傳送要求,請展開以下其中一個選項:
這個 REST 範例使用選用的 fields
查詢參數,只在回應中顯示建立的資源名稱。
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/jobs/JOB_ID" }
gcloud
C#
在試用這個範例之前,請先按照C#使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API C# API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Go
在試用這個範例之前,請先按照Go使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Go API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Java
在試用這個範例之前,請先按照Java使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Java API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Node.js
在試用這個範例之前,請先按照Node.js使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Node.js API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
PHP
在試用這個範例之前,請先按照PHP使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API PHP API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Python
在試用這個範例之前,請先按照Python使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Python API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Ruby
在試用這個範例之前,請先按照Ruby使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Ruby API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
複製傳回的 JOB_ID。您需要這項資訊才能取得工作狀態。
查看轉碼作業狀態
如要查看工作狀態,請使用 projects.locations.jobs.get
方法。下列程式碼範例會取得工作詳細資料,然後顯示工作狀態。
REST
使用任何要求資料之前,請先替換以下項目:
如要傳送要求,請������以下���中一個選項:
您應該會收到如下的 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
C#
在試用這個範例之前,請先按照C#使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API C# API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Go
在試用這個範例之前,請先按照Go使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Go API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Java
在試用這個範例之前,請先按照Java使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Java API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Node.js
在試用這個範例之前,請先按照Node.js使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Node.js API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
PHP
在試用這個範例之前,請先按照PHP使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API PHP API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Python
在試用這個範例之前,請先按照Python使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Python API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Ruby
在試用這個範例之前,請先按照Ruby使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Ruby API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
如果 state
為 SUCCEEDED
,表示工作已完成,您現在��以在 Cloud Storage bucket 的編碼檔案清單中找到影片輸出內容。
播放影片
如要在 Shaka Player 中播放產生的媒體檔案,請完成下列步驟:
清除所用資源
如要避免系統向您的 Google Cloud 帳戶收取本頁面所用資源的費用,請刪除含有這些資源的 Google Cloud 專案。
刪除值區
刪除工作
REST
使用任何要求資料之前,請先替換以下項目:
如要傳送要求,請展開以下其中一個選項:
您應該會收到如下的 JSON 回應:
{}
gcloud
C#
在試用這個範例之前,請先按照C#使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API C# API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Go
在試用這個範例之前,請先按照Go使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Go API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Java
在試用這個範例之前,請先按照Java使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Java API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Node.js
在試用這個範例之前,請先按照Node.js使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Node.js API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
PHP
在試用這個範例之前,請先按照PHP使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API PHP API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Python
在試用這個範例之前,請先按照Python使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Python API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。
Ruby
在試用這個範例之前,請先按照Ruby使用用戶端程式庫的 Transcoder API 快速入門中的設定說明操作。詳情請參閱 Transcoder API Ruby API 參考說明文件。
如要向 Transcoder API 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。