-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathmain.tf
124 lines (118 loc) · 3.24 KB
/
main.tf
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
resource "google_storage_bucket" "default" {
name = "transcoder-job-${local.name_suffix}"
location = "US"
force_destroy = true
uniform_bucket_level_access = true
public_access_prevention = "enforced"
}
resource "google_storage_bucket_object" "example_mp4" {
name = "example.mp4"
source = "./test-fixtures/example.mp4"
bucket = google_storage_bucket.default.name
}
resource "google_storage_bucket_object" "overlay_png" {
name = "overlay.png"
source = "./test-fixtures/overlay.png"
bucket = google_storage_bucket.default.name
}
resource "google_transcoder_job" "default" {
location = "us-central1"
config {
inputs {
key = "input0"
uri = "gs://${google_storage_bucket.default.name}/${google_storage_bucket_object.example_mp4.name}"
}
edit_list {
key = "atom0"
inputs = ["input0"]
start_time_offset = "0s"
}
ad_breaks {
start_time_offset = "3.500s"
}
overlays {
animations {
animation_fade {
fade_type = "FADE_IN"
start_time_offset = "1.500s"
end_time_offset = "3.500s"
xy {
x = 1
y = 0.5
}
}
}
image {
uri = "gs://${google_storage_bucket.default.name}/${google_storage_bucket_object.overlay_png.name}"
}
}
elementary_streams {
key = "video-stream0"
video_stream {
h264 {
width_pixels = 640
height_pixels = 360
bitrate_bps = 550000
frame_rate = 60
pixel_format = "yuv420p"
rate_control_mode = "vbr"
crf_level = 21
gop_duration = "3s"
vbv_size_bits = 550000
vbv_fullness_bits = 495000
entropy_coder = "cabac"
profile = "high"
preset = "veryfast"
}
}
}
elementary_streams {
key = "video-stream1"
video_stream {
h264 {
width_pixels = 1280
height_pixels = 720
bitrate_bps = 550000
frame_rate = 60
pixel_format = "yuv420p"
rate_control_mode = "vbr"
crf_level = 21
gop_duration = "3s"
vbv_size_bits = 2500000
vbv_fullness_bits = 2250000
entropy_coder = "cabac"
profile = "high"
preset = "veryfast"
}
}
}
elementary_streams {
key = "audio-stream0"
audio_stream {
codec = "aac"
bitrate_bps = 64000
channel_count = 2
channel_layout = ["fl", "fr"]
sample_rate_hertz = 48000
}
}
mux_streams {
key = "sd"
file_name = "sd.mp4"
container = "mp4"
elementary_streams = ["video-stream0", "audio-stream0"]
}
mux_streams {
key = "hd"
file_name = "hd.mp4"
container = "mp4"
elementary_streams = ["video-stream1", "audio-stream0"]
}
output {
uri = "gs://${google_storage_bucket.default.name}/outputs/"
}
}
labels = {
"label" = "key"
}
}