in media/transcoder/createJobWithAnimatedOverlay.js [36:122]
async function createJobFromAnimatedOverlay() {
// 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: 0,
y: 0,
},
alpha: 1.0,
},
animations: [
{
animationFade: {
fadeType: 'FADE_IN',
xy: {
x: 0.5,
y: 0.5,
},
startTimeOffset: {
seconds: 5,
},
endTimeOffset: {
seconds: 10,
},
},
},
{
animationFade: {
fadeType: 'FADE_OUT',
xy: {
x: 0.5,
y: 0.5,
},
startTimeOffset: {
seconds: 12,
},
endTimeOffset: {
seconds: 15,
},
},
},
],
},
],
},
},
};
// Run request
const [response] = await transcoderServiceClient.createJob(request);
console.log(`Job: ${response.name}`);
}