1

I have an H264 NVENC Encoder setup which encodes a video stream. I want to decode frames of that stream using the WebCodecs API in Google Chrome.

My decoder configuration setup looks like this:

  let decoderConfig = {codec: "avc1.428020", width: 480, height: 270};
  decoderConfig.description = new Uint8Array(dataFromEncoder);
  decoder.configure(decoderConfig); 

Where dataFromEncoder is an the following array obtained from the NVENC NvEncGetSequenceParams function: [0, 0, 0, 1, 103, 100, 0, 50, 172, 43, 64, 240, 71, 245, 128, 136, 0, 0, 31, 64, 0, 21, 249, 4, 32, 0, 0, 0, 1, 104, 206, 60, 176]

When I run the setup I get the error: Failed to execute 'configure' on 'VideoDecoder': Failed to parse avcC.

From what I understand from the documentation the error refers to the dataFromEncoder being wrong in some way.

What am I missing? Am I using the correct NVENC function?

I have considered my codec string (avc1.428020), I am not sure if it corresponds to my encoder. The 428020 part is described in another stack overflow question and this doc, but I have yet to find the corresponding information in the NVENC H264 docs. Is this sub-string even relevant, and if so how do i get it from the NVENC encoder?

Pruza
  • 11
  • 3

0 Answers0