WebRTC HW decode stops after decoding error. |
||||
Issue descriptionVersion: 50 OS: CrOS, OSX, win (where H.264 HW decode is available) In certain scenarios (speaker switching) Chrome might receive H.264 streams that aren't decodable for a while, until a new key frame is received. For software decoding this works fine, but we get the following error message: 1:537:0310/104844:ERROR:h264_decoder_impl.cc(320)] avcodec_decode_video2 error: -1094995529 For hardware on the other hand the decoder will bail out after one (or maybe several) errors. I discussed this with posciak@ and he didn't want to change the behaviour on the hardware level, but suggested that we reinit the decoder when we get an error. After being initialized the decoder will accept non-decodable data until it gets a key frame. This problem might also be a contributing factor to crbug.com/583704
,
Mar 16 2016
Reset() shouldn't be necessary here. A new Decode() attempt from a new keyframe should try to bring the VDA back up (re-initialize?). This recovery should be done inside RTCVideoDecoder I think, and shouldn't require a new interface. This error boiling down to ~nothing should be fixed when H.264 supports software decode here: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/webrtc/video/video_decoder.cc&sq=package:chromium&type=cs&l=104&rcl=1458143321 I'm not sure how this is wired up at the moment, it should work for VP8 and VP9, but I think we didn't wire it up to H.264 because there was no such decoder in software at that point.
,
Mar 19 2016
I uploaded a CL trying to solve it within RTCVideoDecoder as pbos@ described. PTAL: https://codereview.chromium.org/1817573004/.
,
Mar 30 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d73415ce0c9e0d6c334612f3c3395b8162093586 commit d73415ce0c9e0d6c334612f3c3395b8162093586 Author: emircan <emircan@chromium.org> Date: Wed Mar 30 17:44:04 2016 Handle HW decode failures in RTCVideoDecoder This CL adds functionality to reset underlying HW decoder implementation after an error happens. BUG= 594161 TEST=Tested on Mac using VT HW decoder, injecting error frames in intervals. Review URL: https://codereview.chromium.org/1817573004 Cr-Commit-Position: refs/heads/master@{#384019} [modify] https://crrev.com/d73415ce0c9e0d6c334612f3c3395b8162093586/content/renderer/media/rtc_video_decoder.cc [modify] https://crrev.com/d73415ce0c9e0d6c334612f3c3395b8162093586/content/renderer/media/rtc_video_decoder.h [modify] https://crrev.com/d73415ce0c9e0d6c334612f3c3395b8162093586/content/renderer/media/rtc_video_decoder_unittest.cc
,
Mar 30 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d73415ce0c9e0d6c334612f3c3395b8162093586 commit d73415ce0c9e0d6c334612f3c3395b8162093586 Author: emircan <emircan@chromium.org> Date: Wed Mar 30 17:44:04 2016 Handle HW decode failures in RTCVideoDecoder This CL adds functionality to reset underlying HW decoder implementation after an error happens. BUG= 594161 TEST=Tested on Mac using VT HW decoder, injecting error frames in intervals. Review URL: https://codereview.chromium.org/1817573004 Cr-Commit-Position: refs/heads/master@{#384019} [modify] https://crrev.com/d73415ce0c9e0d6c334612f3c3395b8162093586/content/renderer/media/rtc_video_decoder.cc [modify] https://crrev.com/d73415ce0c9e0d6c334612f3c3395b8162093586/content/renderer/media/rtc_video_decoder.h [modify] https://crrev.com/d73415ce0c9e0d6c334612f3c3395b8162093586/content/renderer/media/rtc_video_decoder_unittest.cc
,
Mar 31 2016
Is this bug fixed now with the above patch?
,
Mar 31 2016
I will have a followup CL that dynamically resets the error counter, i.e. if we start decoding frames successfully, reset the counter so that periodic failures can be handled as well. Currently, this handles the first 5 errors and falls back to SW.
,
Apr 1 2016
SGTM :)
,
Apr 1 2016
Do the tests cover that video actually resumes playing? I would assume that an effective reset would also have to involve sending an RTCP message to the sender to say "send me an IFrame", but I don't see any such code here. Has this been tested with a live stream, so that you actually see the recovery happen?
,
Apr 1 2016
hta@, I tested on a Mac using VideoToolbox decoder: via AppRTC loopback by injecting errors in code, and via Cisco WebEx where we currently have errors happening-3 people session-. It is able to recover from VDA Error multiple times. I am not sure about the RTCP message since Chrome code doesn't know about it. Currently, we are sending WEBRTC_VIDEO_CODEC_ERROR to WebRTC. That would be handled inside WebRTC's generic_decoder. I just took pbos@'s advice from #2.
,
Apr 6 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e3de5b456a41997ef6026b06bf70801277a58df9 commit e3de5b456a41997ef6026b06bf70801277a58df9 Author: emircan <emircan@chromium.org> Date: Wed Apr 06 20:23:30 2016 Dynamic error tracking in RTCVideoDecoder This CL dynamically resets the error counter, i.e. if we start decoding frames successfully, reset the counter so that periodic failures can be handled as well. BUG= 594161 TEST=Tested on Mac using VT HW decoder, injecting error frames in intervals. Review URL: https://codereview.chromium.org/1850063003 Cr-Commit-Position: refs/heads/master@{#385544} [modify] https://crrev.com/e3de5b456a41997ef6026b06bf70801277a58df9/content/renderer/media/rtc_video_decoder.cc [modify] https://crrev.com/e3de5b456a41997ef6026b06bf70801277a58df9/content/renderer/media/rtc_video_decoder.h [modify] https://crrev.com/e3de5b456a41997ef6026b06bf70801277a58df9/content/renderer/media/rtc_video_decoder_unittest.cc
,
Apr 7 2016
,
Apr 18 2016
emircan@ I'm not too sure what the (manual) steps would be to verify this fix in M51 .. can you please explain?
,
Apr 18 2016
Yeah this bug only happened in a specific Webex-WebRTC scenario. We have tested that this fix resolves the problem, so I'll mark it as verified. |
||||
►
Sign in to add a comment |
||||
Comment 1 by emir...@chromium.org
, Mar 16 2016