(projectId, location, templateId)
| 16 | 'use strict'; |
| 17 | |
| 18 | function main(projectId, location, templateId) { |
| 19 | // [START transcoder_create_job_template] |
| 20 | /** |
| 21 | * TODO(developer): Uncomment these variables before running the sample. |
| 22 | */ |
| 23 | // projectId = 'my-project-id'; |
| 24 | // location = 'us-central1'; |
| 25 | // templateId = 'my-job-template'; |
| 26 | |
| 27 | // Imports the Transcoder library |
| 28 | const {TranscoderServiceClient} = |
| 29 | require('@google-cloud/video-transcoder').v1; |
| 30 | |
| 31 | // Instantiates a client |
| 32 | const transcoderServiceClient = new TranscoderServiceClient(); |
| 33 | |
| 34 | async function createJobTemplate() { |
| 35 | // Construct request |
| 36 | const request = { |
| 37 | parent: transcoderServiceClient.locationPath(projectId, location), |
| 38 | jobTemplateId: templateId, |
| 39 | jobTemplate: { |
| 40 | config: { |
| 41 | elementaryStreams: [ |
| 42 | { |
| 43 | key: 'video-stream0', |
| 44 | videoStream: { |
| 45 | h264: { |
| 46 | heightPixels: 360, |
| 47 | widthPixels: 640, |
| 48 | bitrateBps: 550000, |
| 49 | frameRate: 60, |
| 50 | }, |
| 51 | }, |
| 52 | }, |
| 53 | { |
| 54 | key: 'video-stream1', |
| 55 | videoStream: { |
| 56 | h264: { |
| 57 | heightPixels: 720, |
| 58 | widthPixels: 1280, |
| 59 | bitrateBps: 2500000, |
| 60 | frameRate: 60, |
| 61 | }, |
| 62 | }, |
| 63 | }, |
| 64 | { |
| 65 | key: 'audio-stream0', |
| 66 | audioStream: { |
| 67 | codec: 'aac', |
| 68 | bitrateBps: 64000, |
| 69 | }, |
| 70 | }, |
| 71 | ], |
| 72 | muxStreams: [ |
| 73 | { |
| 74 | key: 'sd', |
| 75 | container: 'mp4', |
no test coverage detected