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

migrate code from googleapis/nodejs-video-transcoder #2987

Merged
merged 48 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8a91901
feat!: initial release of @google-cloud/video-transcoder (#1)
yoshi-automation Oct 29, 2020
bd85410
chore: release 1.0.0 (#3)
release-please[bot] Oct 29, 2020
fdd6026
chore: release 1.0.1 (#7)
release-please[bot] Nov 11, 2020
829bb2d
feat(samples): add Transcoder samples (#8)
irataxy Nov 18, 2020
b676f88
chore: release 1.1.0 (#10)
release-please[bot] Dec 2, 2020
befded9
chore: release 1.2.0 (#23)
release-please[bot] Jan 12, 2021
1547737
test: address flaky test (#33)
bcoe Feb 8, 2021
14fd613
build: increase timeout for flaky tests (#34)
sofisl Feb 12, 2021
a146568
feat(samples): add code samples and tests for overlay creation (#39)
irataxy Mar 12, 2021
63fb7be
chore: release 1.3.0 (#41)
release-please[bot] Mar 15, 2021
99b6f90
feat: add spritesheet samples and tests. Remove unneeded list jobs ca…
irataxy Mar 30, 2021
c20d44e
chore: release 1.4.0 (#45)
release-please[bot] Apr 5, 2021
eb470d3
chore: release 1.4.1 (#59)
release-please[bot] May 13, 2021
9ae3e36
chore: release 1.4.2 (#68)
release-please[bot] May 25, 2021
d7a9fb9
chore: release 1.4.3 (#75)
release-please[bot] Jul 7, 2021
4cba7d2
chore: release 1.4.4 (#84)
release-please[bot] Jul 14, 2021
9924996
chore: release 1.5.0 (#85)
release-please[bot] Jul 16, 2021
ddfc765
chore: release 1.6.0 (#97)
release-please[bot] Aug 11, 2021
da6ca41
chore: release 1.6.1 (#101)
release-please[bot] Aug 19, 2021
76a98ab
docs: update Transcoder API samples to v1 (#99)
irataxy Aug 20, 2021
c8a0723
chore: release 1.7.0 (#104)
release-please[bot] Aug 28, 2021
3e1a6ad
chore: release 1.7.1 (#110)
release-please[bot] Sep 9, 2021
412a196
chore: release 1.7.2 (#120)
release-please[bot] Oct 13, 2021
1f2a17b
test: make tests independently retriable (#127)
bcoe Nov 9, 2021
5d700d9
chore: release 1.8.0 (#129)
release-please[bot] Nov 11, 2021
e4e8c2e
fix: add backoff for test retries and get job state queries (#131)
irataxy Dec 2, 2021
929c973
chore: release 1.8.1 (#132)
release-please[bot] Dec 3, 2021
4c3725a
samples: add code sample and test for concatenating two input videos …
irataxy Dec 20, 2021
28588db
feat(samples): add samples and tests for adding captions to videos (#…
irataxy Jan 12, 2022
41f8ce3
chore(main): release 1.9.0 (#144)
release-please[bot] Feb 8, 2022
b10b920
feat(samples): delete old test jobs (#148)
irataxy Feb 8, 2022
7803c34
chore(main): release 1.10.0 (#155)
release-please[bot] Feb 8, 2022
56c42ea
build!: update library to use Node 12 (#175)
alexander-fenster May 17, 2022
c6d43c2
chore(main): release 2.0.0 (#176)
release-please[bot] May 18, 2022
092e52a
chore(deps): update dependency @google-cloud/storage to v6 (#178)
renovate-bot Jun 7, 2022
0d2d3f0
chore(main): release 2.0.1 (#179)
release-please[bot] Jun 7, 2022
c70f197
chore(main): release 2.1.0 (#185)
release-please[bot] Jun 16, 2022
a638c1e
chore(main): release 2.2.0 (#188)
release-please[bot] Jun 30, 2022
02e9ec6
docs: update list calls to Async (#186)
irataxy Jul 15, 2022
a487a5a
chore(main): release 2.2.1 (#194)
release-please[bot] Sep 8, 2022
4c1e265
chore(deps): update dependency uuid to v9 (#209)
renovate-bot Sep 8, 2022
a1c4681
chore(main): release 2.2.2 (#211)
release-please[bot] Sep 26, 2022
4c34d9d
chore(main): release 2.2.3 (#220)
release-please[bot] Nov 11, 2022
1347da1
Merge remote-tracking branch 'migration/main' into nodejs-video-trans…
irataxy Jan 14, 2023
d182ab9
add workflows
irataxy Jan 14, 2023
5d28912
remove test dependency on project number
irataxy Jan 14, 2023
f84507d
remove test dependency on project number
irataxy Jan 14, 2023
faa9b34
fix lint
irataxy Jan 14, 2023
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
71 changes: 71 additions & 0 deletions .github/workflows/media-transcoder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: media-transcoder
on:
push:
branches:
- main
paths:
- 'media/transcoder/**'
- '.github/workflows/media-transcoder.yaml'
pull_request:
paths:
- 'media/transcoder/**'
- '.github/workflows/media-transcoder.yaml'
pull_request_target:
types: [labeled]
paths:
- 'media/transcoder/**'
- '.github/workflows/media-transcoder.yaml'
schedule:
- cron: '0 0 * * 0'
jobs:
test:
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }}
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: 'write'
pull-requests: 'write'
id-token: 'write'
steps:
- uses: actions/[email protected]
with:
ref: ${{github.event.pull_request.head.sha}}
- uses: 'google-github-actions/[email protected]'
with:
workload_identity_provider: 'projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider'
service_account: '[email protected]'
create_credentials_file: 'true'
access_token_lifetime: 600s
- uses: actions/[email protected]
with:
node-version: 16
- run: npm install
working-directory: media/transcoder
- run: npm test
working-directory: media/transcoder
env:
MOCHA_REPORTER_SUITENAME: media_transcoder
MOCHA_REPORTER_OUTPUT: media_transcoder_sponge_log.xml
MOCHA_REPORTER: xunit
- if: ${{ github.event.action == 'labeled' && github.event.label.name == 'actions:force-run' }}
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
try {
await github.rest.issues.removeLabel({
name: 'actions:force-run',
owner: 'GoogleCloudPlatform',
repo: 'nodejs-docs-samples',
issue_number: context.payload.pull_request.number
});
} catch (e) {
if (!e.message.includes('Label does not exist')) {
throw e;
}
}
- if: ${{ github.event_name == 'schedule' && always() }}
run: |
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L
chmod +x ./flakybot
./flakybot --repo GoogleCloudPlatform/nodejs-docs-samples --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
1 change: 1 addition & 0 deletions .github/workflows/workflows.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"healthcare/hl7v2",
"iam",
"kms",
"media/transcoder",
"media/video-stitcher",
"mediatranslation",
"monitoring/opencensus",
Expand Down
104 changes: 104 additions & 0 deletions media/transcoder/createJobFromAdHoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/**
* Copyright 2020, 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.
*/

'use strict';

function main(projectId, location, inputUri, outputUri) {
// [START transcoder_create_job_from_ad_hoc]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// projectId = 'my-project-id';
// location = 'us-central1';
// inputUri = 'gs://my-bucket/my-video-file';
// outputUri = 'gs://my-bucket/my-output-folder/';

// Imports the Transcoder library
const {TranscoderServiceClient} =
require('@google-cloud/video-transcoder').v1;

// Instantiates a client
const transcoderServiceClient = new TranscoderServiceClient();

async function createJobFromAdHoc() {
// Construct request
const request = {
parent: transcoderServiceClient.locationPath(projectId, location),
job: {
inputUri: inputUri,
outputUri: outputUri,
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'],
},
],
},
},
};

// Run request
const [response] = await transcoderServiceClient.createJob(request);
console.log(`Job: ${response.name}`);
}

createJobFromAdHoc();
// [END transcoder_create_job_from_ad_hoc]
}

// node createJobFromAdHoc.js <projectId> <location> <inputUri> <outputUri>
process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
61 changes: 61 additions & 0 deletions media/transcoder/createJobFromPreset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* Copyright 2020, 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.
*/

'use strict';

function main(projectId, location, inputUri, outputUri, preset) {
// [START transcoder_create_job_from_preset]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// projectId = 'my-project-id';
// location = 'us-central1';
// inputUri = 'gs://my-bucket/my-video-file';
// outputUri = 'gs://my-bucket/my-output-folder/';
// preset = 'preset/web-hd';

// Imports the Transcoder library
const {TranscoderServiceClient} =
require('@google-cloud/video-transcoder').v1;

// Instantiates a client
const transcoderServiceClient = new TranscoderServiceClient();

async function createJobFromPreset() {
// Construct request
const request = {
parent: transcoderServiceClient.locationPath(projectId, location),
job: {
inputUri: inputUri,
outputUri: outputUri,
templateId: preset,
},
};

// Run request
const [response] = await transcoderServiceClient.createJob(request);
console.log(`Job: ${response.name}`);
}

createJobFromPreset();
// [END transcoder_create_job_from_preset]
}

// node createJobFromPreset.js <projectId> <location> <inputUri> <outputUri> <preset>
process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
61 changes: 61 additions & 0 deletions media/transcoder/createJobFromTemplate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* Copyright 2020, 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.
*/

'use strict';

function main(projectId, location, inputUri, outputUri, templateId) {
// [START transcoder_create_job_from_template]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// projectId = 'my-project-id';
// location = 'us-central1';
// inputUri = 'gs://my-bucket/my-video-file';
// outputUri = 'gs://my-bucket/my-output-folder/';
// templateId = 'my-job-template';

// Imports the Transcoder library
const {TranscoderServiceClient} =
require('@google-cloud/video-transcoder').v1;

// Instantiates a client
const transcoderServiceClient = new TranscoderServiceClient();

async function createJobFromTemplate() {
// Construct request
const request = {
parent: transcoderServiceClient.locationPath(projectId, location),
job: {
inputUri: inputUri,
outputUri: outputUri,
templateId: templateId,
},
};

// Run request
const [response] = await transcoderServiceClient.createJob(request);
console.log(`Job: ${response.name}`);
}

createJobFromTemplate();
// [END transcoder_create_job_from_template]
}

// node createJobFromTemplate.js <projectId> <location> <inputUri> <outputUri> <templateId>
process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Loading