-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathtranscode-example.yaml
88 lines (86 loc) · 2.87 KB
/
transcode-example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This is an example how to transcode video using Transcoder API.
#
# You need to set up an input bucket and an output bucket, and then grant
# service-[PROJECT_NUMBER}@gcp-sa-transcoder.iam.gserviceaccount.com
# roles/storage.objectViewer on the input and output bucket, and also
# roles/storage.objectCreator on the output bucket.
pipeline:
- type: processor.genericjson
- type: processor.transcode
output: transcode_job
config:
mode: create
location: europe-west4
job:
inputUri: gs://transcoder-input-bucket/test1.mp4
outputUri: gs://transcoder-output-bucket/
ttlAfterCompletionDays: 30
labels:
sample: label
config:
inputs:
- key: input0
uri: ""
editList:
- key: atom0
inputs: ["input0"]
startTimeOffset: "0s"
elementaryStreams:
- videoStream:
h264:
widthPixels: 320
heightPixels: 200
frameRate: 30
bitrateBps: 550000
pixelFormat: yuv420p
rateControlMode: vbr
crfLevel: 21
gopDuration: "3s"
profile: high
preset: veryfast
key: video-stream0
- audioStream:
codec: mp3
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
manifests: []
# You have the service submit a message to Pub/Sub once the processing is completed.
# pubsubDestination:
# topic: "projects/my-project/topics/pubsub-topic"
output:
uri: ""
- type: processor.transcode
output: "transcode_result"
config:
mode: get
location: europe-west4
job:
name: "{{ transcode_job.name }}"
- type: output.logger
config:
message: "Transcode job: {{ transcode_result|json_encode }}"