w3c / webcodecs

WebCodecs is a flexible web API for encoding and decoding audio and video.
https://w3c.github.io/webcodecs/
Other
941 stars 132 forks source link

Include some frame info with `VideoDecoder` Errors? #811

Closed snosenzo closed 5 days ago

snosenzo commented 5 days ago

As far as I can see the DOMException passed to the error callback on the VideoDecoder constructor for failing to decode a frame only provides error.name = "EncodingError" and error.message = "DecodingError". This leaves a lot to be desired in terms of trying to debug the data being decoded. I understand that it's hard to give more info due to fingerprinting (as discussed here: #643), but I was wondering if it would be possible to reference the frame that caused the error somehow? Decoding is asynchronous and can build up an internal queue of frames before processing (as far as I can tell, given lack of 1-in 1-out support), it's not possible to know which of the EncodedVideoChunks was responsible for causing that error. It would be great if a part (like the timestamp) or the whole EncodedVideoChunk could attached to the error in some way in order to determine the problematic frame.

If this still is at risk of fingerprinting, then no worries and feel free to close the issue.

dalecurtis commented 5 days ago

We probably can't attach more in the generated error, but usually the media dev tools for each browser will have more information. In chrome you can find them either in the Dev Tools panel or under chrome://media-internals.

snosenzo commented 5 days ago

Thought so, thanks for your response!