async function createJobFromStaticOverlay()

in media/transcoder/createJobWithStaticOverlay.js [36:110]


  async function createJobFromStaticOverlay() {
    // 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: 'audio-stream0',
              audioStream: {
                codec: 'aac',
                bitrateBps: 64000,
              },
            },
          ],
          muxStreams: [
            {
              key: 'sd',
              container: 'mp4',
              elementaryStreams: ['video-stream0', 'audio-stream0'],
            },
          ],
          overlays: [
            {
              image: {
                uri: overlayImageUri,
                resolution: {
                  x: 1,
                  y: 0.5,
                },
                alpha: 1.0,
              },
              animations: [
                {
                  animationStatic: {
                    xy: {
                      x: 0,
                      y: 0,
                    },
                    startTimeOffset: {
                      seconds: 0,
                    },
                  },
                },
                {
                  animationEnd: {
                    startTimeOffset: {
                      seconds: 10,
                    },
                  },
                },
              ],
            },
          ],
        },
      },
    };

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