Bug 217673 - Add support for VP9 Profile 2 (10-bit color) in WebRTC
Summary: Add support for VP9 Profile 2 (10-bit color) in WebRTC
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 14
Hardware: Unspecified iOS 13
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-10-13 15:04 PDT by Justin Uberti
Modified: 2020-10-26 20:59 PDT (History)
10 users (show)

See Also:


Attachments
Patch (28.85 KB, patch)
2020-10-22 06:43 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (30.97 KB, patch)
2020-10-22 09:22 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (30.47 KB, patch)
2020-10-26 01:27 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 Justin Uberti 2020-10-13 15:04:25 PDT
I believe the new iOS14 VideoToolbox support for VP9 includes HDR capabilities. If so, could Safari add another VP9 format (beyond the existing experimental VP9 support) with profile-id=2?

e.g.,

m=video 9 UDP/TLS/RTP/SAVPF 96 97
a=rtpmap:96 VP9/90000
a=fmtp:96 profile-id=0
a=rtpmap:97 VP9/90000
a=fmtp:97 profile-id=2
Comment 1 Radar WebKit Bug Importer 2020-10-14 01:37:47 PDT
<rdar://problem/70283885>
Comment 2 youenn fablet 2020-10-14 01:41:16 PDT
First step is probably to make use of VP9 VideoToolbox decoding support when available.

Do you know how much profile-id=2 is supported in other browsers (decoders and/or encoders)?
Comment 3 Justin Uberti 2020-10-14 09:37:36 PDT
I agree with the sequencing you propose. The current experimental setting to enable the existing VP9 support has been useful.

Regarding higher profiles:
- Chromium supports decoding profiles 1 and 2 in MSE and supports decoding profile 2 in WebRTC. I don't think it's fully plumbed for encoding yet though.
- Firefox supports decoding profiles 1 and 2 in MSE.

MSE support tester: https://googlechrome.github.io/samples/media/vp9-codec-string.html
Comment 4 youenn fablet 2020-10-22 06:43:46 PDT
Created attachment 412092 [details]
Patch
Comment 5 youenn fablet 2020-10-22 09:22:19 PDT
Created attachment 412106 [details]
Patch
Comment 6 Eric Carlson 2020-10-22 11:17:14 PDT
Comment on attachment 412106 [details]
Patch

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

r=me once the bots are happy.

> Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m:85
> +    NSDictionary<NSString *, NSString *> *profile0 = @{
> +      @"profile-id" : @"0",
> +    };
> +    RTCVideoCodecInfo *vp9InfoProfile0 = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name parameters: profile0];

Nit: can you do this inline?

    RTCVideoCodecInfo *vp9InfoProfile0 = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name parameters: @{ @"profile-id" : @"0" }];

> Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m:91
> +    RTCVideoCodecInfo *vp9InfoProfile2 = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name parameters: profile2];

Ditto.

> Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m:83
> +    RTCVideoCodecInfo *vp9InfoProfile0 = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name parameters: profile0];

Ditto.

> Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m:89
> +    RTCVideoCodecInfo *vp9InfoProfile2 = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name parameters: profile2];

Ditto.

> LayoutTests/webrtc/vp9-profile2.html:22
> +}, "VP9 profile 2in getCapabilities");

s/profile 2in/profile 2 in/
Comment 7 youenn fablet 2020-10-26 01:27:16 PDT
Created attachment 412293 [details]
Patch
Comment 8 EWS 2020-10-26 05:50:48 PDT
Committed r268971: <https://trac.webkit.org/changeset/268971>

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