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

Encode and Decode error event #2219

Closed
drkron opened this issue Jun 26, 2019 · 9 comments
Closed

Encode and Decode error event #2219

drkron opened this issue Jun 26, 2019 · 9 comments
Assignees
Labels

Comments

@drkron
Copy link
Contributor

drkron commented Jun 26, 2019

I'm looking for a way to detect decoding errors (both in the sense of failure to decode a frame and also in the sense that the decoder is falling behind due to scarce resources.

My suggestion is to add error events for decoding and encoding errors.

This was also proposed two years ago in #1323, where the consensus was that getStats() would be good enough.

The primary target for me is to use this to detect when the decoder is falling behind.
A concern I have with using getStats() is that it would require the user to have some custom heuristic code to detect this. Since this would be based on a rather limited set of information it would be noisy and it also requires the user to constantly pull getStats() for information. I believe that a signaling event that is fired from within WebRTC should be possible to make more accurate and robust.

Another problem is that some HW encoder/decoder uses a pipeline so that there's always a one-frame delay. In this case a high encode/decode time does not mean that it's falling behind. In such a case a detection in WebRTC could look at how queues are building up.

@aboba
Copy link
Contributor

aboba commented Jun 26, 2019

I am wondering if this issue applies only to webrtc-pc or perhaps also to media capture. A device (such as a webcam) can have a built-in encoder. Sometimes the device will successfully initialize, but later on there will be transient encoding errors, or perhaps encoding will stop.

There is a DOMException with a name of EncodingError that we could use, but it seems like having some extended information (as would be possible with RTCError) might be more useful.

@aboba
Copy link
Contributor

aboba commented Jun 26, 2019

@drkron Would you be available to present this issue (and potential solutions) at the July 2 Virtual Interim?

@drkron
Copy link
Contributor Author

drkron commented Jul 1, 2019

@drkron Would you be available to present this issue (and potential solutions) at the July 2 Virtual Interim?

I'm on vacation but I will try to attend the meeting.
Is there an agenda for the meeting, that is, is it decided in which order all issues are discussed?

@henbos
Copy link
Contributor

henbos commented Jul 2, 2019

Is there an agenda for the meeting, that is, is it decided in which order all issues are discussed?

Yes, see the slides. I gave you write-access with your google account

@aboba aboba self-assigned this Jul 18, 2019
@aboba
Copy link
Contributor

aboba commented Jul 21, 2019

Note that there is an RTCError defined for a hardware encoder error in Section 5.2 (used by setParameters):

"If an error occurred due to a hardware encoder not supporting parameters, reject p with a newly created RTCError whose errorDetail is set to "hardware-encoder-error"

@aboba aboba assigned drkron and unassigned aboba Aug 8, 2019
@aboba aboba added the TPAC 2019 label Aug 8, 2019
@alvestrand alvestrand added this to To do in WebRTC 1.0 to PR Aug 22, 2019
@drkron
Copy link
Contributor Author

drkron commented Sep 6, 2019

I'm looking into using the existing stats, framesReceived and framesDecoded, to detect if the decoder is too slow. From my initial testing it seems as taking the difference gives a quite good indication of the current decoding status.
So for now I don't see the immediate need for this feature.

@aboba
Copy link
Contributor

aboba commented Sep 12, 2019

@drkron Can we close this issue?

@aboba aboba added Icebox and removed TPAC 2019 labels Sep 12, 2019
@henbos
Copy link
Contributor

henbos commented Sep 12, 2019

Maybe this will be addressed by WebCodecs?

@drkron
Copy link
Contributor Author

drkron commented Sep 12, 2019

From my point of view, it can be closed.

@drkron drkron closed this as completed Sep 12, 2019
WebRTC 1.0 to PR automation moved this from To do to Done Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

3 participants