0

I am trying to decode this video with WebCodecs in Google Chrome: https://www.photopea.com/test_video.mp4 . My code used to work in the past with this video, but it stopped to work with Chrome 115.

I am providing this configuration:

decoder.configure( {
    "codec": "avc1.640034",  // I use this for every AVC-encoded file
    "description": file.slice(577, 577+52)
} );

It prints the error

Failed to execute 'configure' on 'VideoDecoder': Failed to parse avcC.

Are you able to decode any frame of this file with VideoDecoder? How do you do it?

Ivan Kuckir
  • 2,327
  • 3
  • 27
  • 46
  • 1
    what even is `decoder`? – Jaromanda X Jul 31 '23 at 10:58
  • It is a usual WebCodecs terminology: var decoder = new VideoDecoder(...); My question is not about Javascript, but about a specific web API, and the format of video files. https://developer.chrome.com/en/articles/webcodecs/ – Ivan Kuckir Jul 31 '23 at 11:00
  • 1
    perhaps if you showed code that demonstrates your issue, then `decoder` wouldn't be just some random variable you believe everyone should just know :p – Jaromanda X Jul 31 '23 at 11:01
  • @IvanKuckir Does it work if you... **(1)** Set codec as: `"avc1.640028"` **(2)** Try slicing as: `file.slice(577, 577+44)`? That's the length of your AVC Config bytes (_ie:_ SPS & PPS). If still not working, let me now asap and I will test a possible solution. – VC.One Aug 06 '23 at 18:51
  • @VC.One Cool! Could I use this configuration for all "avcC" files? The codec "avc1.640028" and the first 44 Bytes of the "vacC" chunk? – Ivan Kuckir Aug 07 '23 at 13:53
  • @IvanKuckir Did you get a picture displaying? Also to answer your other concern, no you cannot use same config. When I get a chance, I'll write an answer to detect the correct config from the input file's own bytes. – VC.One Aug 07 '23 at 17:23

0 Answers0