Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F/add transcoder #21

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e4ade2f
feat: WIP Google Transcoder API
bschaatsbergen Jun 10, 2024
5d0782a
feat: add video codec presets
bschaatsbergen Jun 15, 2024
34f4fdd
feat: enrich spec with audio and text streams
bschaatsbergen Jun 18, 2024
f83d925
feat: enrich spec with muxstreams, manifests and output
bschaatsbergen Jun 18, 2024
aa30b8e
feat: enrich spec with adbreaks and pubsub destination
bschaatsbergen Jun 18, 2024
2381dcc
feat: finish the job config spec
bschaatsbergen Jun 20, 2024
b662c00
feat: finish the job config spec and add the job template spec
bschaatsbergen Jun 20, 2024
88460a4
chore: rename to `JobTemplate.yaml`
bschaatsbergen Jun 20, 2024
b7ca153
Merge remote-tracking branch 'upstream/main' into f/add-transcoder
bschaatsbergen Jun 29, 2024
fa5b71a
chore: add min version `ga`
bschaatsbergen Jun 29, 2024
03a8d7c
chore: remove nested objects without properties
bschaatsbergen Jun 29, 2024
c0e7981
chore: remove nested objects without properties
bschaatsbergen Jun 29, 2024
d35798e
chore: remove nested objects without properties
bschaatsbergen Jun 29, 2024
42d6a23
chore: add in-progress tests
bschaatsbergen Jun 29, 2024
8c3cc4e
chore: add `item_type` and `output` to `details`
bschaatsbergen Jun 29, 2024
8733679
chore: remove `optional`
bschaatsbergen Jun 29, 2024
f9b07b9
chore: set to `ga`
bschaatsbergen Jun 29, 2024
6b2e4f3
chore: add in-progress examples
bschaatsbergen Jun 29, 2024
fa9b0c1
chore: add go.tmpl file
bschaatsbergen Jun 29, 2024
023e814
Merge remote-tracking branch 'upstream/main' into f/add-transcoder
bschaatsbergen Jul 7, 2024
31ada17
chore: clean-up
bschaatsbergen Jul 7, 2024
9794b1f
chore: clean-up
bschaatsbergen Jul 7, 2024
c06c040
chore: set to `JobTemplate`
bschaatsbergen Jul 7, 2024
5f63f87
chore: fix dupe languageCode property
bschaatsbergen Jul 7, 2024
7acaa89
feat: add `transcoder`
bschaatsbergen Jul 7, 2024
0f6582f
chore: fix indent with dupe propertry
bschaatsbergen Jul 7, 2024
874f8a4
chore: fix issues in config spec
bschaatsbergen Jul 7, 2024
8271dc9
feat: update example config
bschaatsbergen Jul 7, 2024
b019d41
chore: rm newline
bschaatsbergen Jul 7, 2024
018501b
feat: add `Transcoder`
bschaatsbergen Jul 8, 2024
7ff71b4
chore: lower timeouts
bschaatsbergen Jul 8, 2024
73f2d9e
chore: rm jobid param
bschaatsbergen Jul 8, 2024
8594d4f
chore: remove async block
bschaatsbergen Jul 8, 2024
16e437e
chore: add `default_from_api` to enums
bschaatsbergen Jul 8, 2024
961bf69
chore: set `name` to default from API
bschaatsbergen Jul 8, 2024
483399d
chore: apply custom flatten suggestion
bschaatsbergen Jul 8, 2024
408efc6
Merge remote-tracking branch 'upstream/main' into f/add-transcoder
bschaatsbergen Jul 18, 2024
6534089
typo fixes
BBBmau Jul 22, 2024
c5d59a3
remove autogen_async: true
BBBmau Jul 26, 2024
fe86b3b
add job_template_id in tests
BBBmau Jul 26, 2024
497291e
chore: align template id and name
bschaatsbergen Aug 6, 2024
e49bd0f
chore: remove `job_template_name` as it conflicts with `job_template_id`
bschaatsbergen Aug 6, 2024
3bfcb6f
chore: set `name` as output only
bschaatsbergen Aug 6, 2024
329e699
bug: fix typo
bschaatsbergen Aug 6, 2024
95781a3
chore: inject example.mp4
bschaatsbergen Aug 7, 2024
4258e9e
chore: set output.uri
bschaatsbergen Aug 7, 2024
10b5fa2
output typo
BBBmau Aug 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,024 changes: 1,024 additions & 0 deletions mmv1/products/transcoder/Job.yaml

Large diffs are not rendered by default.

948 changes: 948 additions & 0 deletions mmv1/products/transcoder/JobTemplate.yaml

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions mmv1/products/transcoder/product.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2022 Google Inc.
# 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.

--- !ruby/object:Api::Product
name: Transcoder
display_name: Transcoder
versions:
- !ruby/object:Api::Product::Version
name: ga
base_url: https://transcoder.googleapis.com/v1/
scopes:
- https://www.googleapis.com/auth/cloud-platform
110 changes: 110 additions & 0 deletions mmv1/templates/terraform/examples/transcoder_job_basic.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
resource "google_storage_bucket" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['bucket_name'] %>"
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.<%= ctx[:primary_resource_id] %>.name
}

resource "google_transcoder_job" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['job_name'] %>"
template_id = google_transcoder_job_template.default.name
location = "us-central1"

labels = {
"label" = "key"
}
}

resource "google_transcoder_job_template" "default" {
job_template_id = "<%= ctx[:vars]['job_template_id'] %>"
location = "us-central1"
config {
inputs {
key = "input0"
uri = google_storage_bucket_object.example_mp4.self_link
}
output {
uri = "${google_storage_bucket.<%= ctx[:primary_resource_id] %>.self_link}/transcoded.mp4"
}
edit_list {
key = "atom0"
inputs = ["input0"]
start_time_offset = "0s"
}
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"]
}
}

labels = {
"label" = "key"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
resource "google_transcoder_job_template" "<%= ctx[:primary_resource_id] %>" {
job_template_id = "<%= ctx[:vars]['job_template_id'] %>"
location = "us-central1"

config {
inputs {
key = "input0"
}
edit_list {
key = "atom0"
inputs = ["input0"]
start_time_offset = "0s"
}
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"]
}
}

labels = {
"label" = "key"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,11 @@ var ServicesListBeta = mapOf(
"name" to "tpuv2",
"displayName" to "Tpuv2",
"path" to "./google-beta/services/tpuv2"
),
"transcoder" to mapOf(
"name" to "transcoder",
"displayName" to "Transcoder",
"path" to "./google-beta/services/transcoder"
),
"vertexai" to mapOf(
"name" to "vertexai",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,11 @@ var ServicesListGa = mapOf(
"displayName" to "Tpuv2",
"path" to "./google/services/tpuv2"
),
"transcoder" to mapOf(
"name" to "transcoder",
"displayName" to "Transcoder",
"path" to "./google/services/transcoder"
),
"vertexai" to mapOf(
"name" to "vertexai",
"displayName" to "Vertexai",
Expand Down
Binary file not shown.
Loading