Bug 231071 - WebRTC p2p call, VP9-SVC only low layer decoded on receiver side
Summary: WebRTC p2p call, VP9-SVC only low layer decoded on receiver side
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 15
Hardware: All All
: P2 Major
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-01 05:16 PDT by ivan.zahrodskyi
Modified: 2021-10-20 01:13 PDT (History)
10 users (show)

See Also:


Attachments
Small example to reproduce the issue (2.38 KB, text/html)
2021-10-04 01:45 PDT, ivan.zahrodskyi
no flags Details
Patch (21.92 KB, patch)
2021-10-13 07:29 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (21.86 KB, patch)
2021-10-14 03:57 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (21.93 KB, patch)
2021-10-20 00:17 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ivan.zahrodskyi 2021-10-01 05:16:32 PDT
1) initiate WebRTC p2p call
2) peerA sends video stream, codec VP9-SVC with 3 spatial layers (720p, 360p, 180p)

actual result:
- peerB always decodes and plays only lowest layer (180p)

expected result:
- peerB should play high layer

NOTE: issue is not reproduces on safari Version 14.1.2 (16611.3.10.1.3)
Comment 1 Radar WebKit Bug Importer 2021-10-01 06:18:51 PDT
<rdar://problem/83763291>
Comment 2 youenn fablet 2021-10-01 06:20:45 PDT
Thanks for the report.

Would it be possible to get a repro case maybe as well, or get a sample bitstream?

Can you also clarify which version of Safari you have tested, and the device?
It would be nice to know whether that reproduces with HW VP9 decoder or SW VP9 decoder. I am leaning towards the former.
Comment 3 ivan.zahrodskyi 2021-10-04 01:45:26 PDT
Created attachment 440040 [details]
Small example to reproduce the issue

Using this example I can reproduce the issue on:
1) MacBook Air (M1, 2020), MacOS Monterey 12.0 Beta (21A5534d), Safari Version 15.1 (17612.2.6.1.1)
2) Iphone 12, IOS 15.0.1
3) Mac mini (2018), Big Sur 11.6, Safari Version 15.0 (16612.1.29.41.4, 16612)


I was not able to reproduce this issue on:
1) MacBook Pro (Retina, 15-inch, Late 2013), Big Sur 11.5, Safari Version 14.1.2 (16611.3.10.1.3)
Comment 4 youenn fablet 2021-10-12 01:52:07 PDT
Thanks Ivan, I validated that the issue is with the HW VP9 decoder, not the SW one.
Comment 5 youenn fablet 2021-10-12 02:09:08 PDT
To detect this, media capabilities can be used, for instance:
navigator.mediaCapabilities.decodingInfo({
  type: "file",
    video: {
      contentType: 'video/mp4; codecs="vp09.00.41.08"',
      width: 800,
      height: 600,
      bitrate: 10000,
      framerate: 15
   }
}).then(result => console.log(result.powerEfficient))
Comment 6 youenn fablet 2021-10-13 07:29:24 PDT
Created attachment 441073 [details]
Patch
Comment 7 Eric Carlson 2021-10-13 08:49:46 PDT
Comment on attachment 441073 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=441073&action=review

> Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:260
> +        auto report = LibWebRTCStatsCollector::createReport(rtcReport);

Is there any reason to create the report if the endpoint has stopped?
Comment 8 youenn fablet 2021-10-14 03:57:08 PDT
Created attachment 441200 [details]
Patch for landing
Comment 9 youenn fablet 2021-10-14 03:57:20 PDT
(In reply to Eric Carlson from comment #7)
> Comment on attachment 441073 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=441073&action=review
> 
> > Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:260
> > +        auto report = LibWebRTCStatsCollector::createReport(rtcReport);
> 
> Is there any reason to create the report if the endpoint has stopped?

Right, fix in the landing patch
Comment 10 EWS 2021-10-19 02:21:55 PDT
ChangeLog entry in Source/ThirdParty/libwebrtc/ChangeLog contains OOPS!.
Comment 11 youenn fablet 2021-10-20 00:17:27 PDT
Created attachment 441854 [details]
Patch for landing
Comment 12 EWS 2021-10-20 01:13:35 PDT
Committed r284523 (243266@main): <https://commits.webkit.org/243266@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 441854 [details].