Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught (in promise) DOMException: Failed to execute 'decode' on 'VideoDecoder': A key frame is required after configure() or flush() #867

Open
wohencainiao opened this issue Jan 2, 2025 · 1 comment

Comments

@wohencainiao
Copy link

I'm getting a browser error when decoding H265, “VideoDecoder.js:270 Uncaught (in promise) DOMException: Failed to execute 'decode' on 'VideoDecoder': A key frame is required after configure() or flush(). If you're using HEVC formatted H.265 you must fill out the description field in the VideoDecoderConfig.” Here's some of my code:
let config = {
codec: "hvc1.1.6.L123.00",
};
const chunk = new EncodedVideoChunk({
data: payData,
timestamp: videoInfo.timeStamp,
type: videoInfo.isKeyFrame ? 'key' : 'delta'
});
this.decoderObj.decode(chunk);
An error occurs when the code is executed at this point “this.decoderObj.decode(chunk);”,I would like to ask for advice on how to locate the error,Or I'd like to know how to catch the error of this interface“decode”,For example, is there a way to throw an exception or return a value for a function

@Djuffin
Copy link
Contributor

Djuffin commented Jan 2, 2025

What browser do you use?

You might need to populate VideoDecoderConfig.description if you encoded data isn't in annexb format.
It's hard to tell what's going on without seeing the encoded data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants