0

in my firebase function I am trying to create a job using the Google Cloud Transcode API to transcode a video and specify a specific time range using the editList property in the job configuration. However, I encountered an error stating "[object Object] is not a valid input key." I have provided my job configuration below, when there is no editList it works alltight, but I want that only first 60s of my video transcoded, how can I achieve that?

const jobConfig = {
  editList: [
    {
      key: "inputs",
      inputs: [
        {
          key: "startTimeOffset",
          value: "0s"
        },
        {
          key: "endTimeOffset",
          value: "60s"
        }
      ]
    }
  ],
  elementaryStreams: [       
    {
      key: 'video-stream1',
      videoStream: {
        h265: {
         // heightPixels: 720,
          widthPixels: 1280,
          bitrateBps: 2500000,
          frameRate: 60,
        },
      },
    },
    {
      key: 'audio-stream0',
      audioStream: {
        codec: 'aac',
        bitrateBps: 64000,
      },
    },
  ],
  muxStreams: [       
    {
      key: 'hd',
      container: 'mp4',
      elementaryStreams: ['video-stream1', 'audio-stream0'],
    },
  ],
}

UPDATE: also tried with following editList

editList: [
    {
      key: "atom0",
      inputs: [
        "video-stream1",
        'audio-stream0'
      ],
      endTimeOffset: "60s",
      startTimeOffset: "0s"
    },
  ],

but got the following error:

Error: 13 INTERNAL: Request message serialization failure: .google.cloud.video.transcoder.v1.EditAtom.endTimeOffset: object expected
at callErrorFromStatus (/workspace/node_modules/@google-cloud/video-transcoder/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
EmreAkkoc
  • 623
  • 1
  • 11
  • 18

0 Answers0