Open8

Chrome M90 で WebRTC の AV1 が利用できるようになった

  • 双方に映像が映れば成功
  • AV1 かどうかの確認は chrome://webrtc-internals で確認する
  • RTCOutboundRTPVideoStream_* に codec が AV1X になっている事を確認する

Image from Gyazo

AV1 に対応しているかどうかをチェックする場合の雑コード。

RTCRtpSender.getCapabilities('video').codecs.some(codec => {
    if (codec.mimeType === 'video/AV1X' || codec.mimeType == 'video/AV1') {
        return true
    }
    return false
});

Offer SDP

v=0
o=- 9162866787994700278 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=extmap-allow-mixed
a=msid-semantic: WMS Dt5YcqBdN5php8AwHouypKamyLJT9Fezj4ic
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:HV8K
a=ice-pwd:drEV18nSyHA7EiWr1D9j37LN
a=ice-options:trickle
a=fingerprint:sha-256 D1:3E:D0:4E:5F:91:AA:08:33:DE:33:C0:3D:82:D4:C9:85:9B:70:78:F4:B8:71:5F:51:E0:8F:E8:0D:EC:54:5B
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:Dt5YcqBdN5php8AwHouypKamyLJT9Fezj4ic 6449b513-ce07-4e2f-a64d-d507013d0d1c
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:1966315384 cname:p1AjwDY1akYv5Xyl
a=ssrc:1966315384 msid:Dt5YcqBdN5php8AwHouypKamyLJT9Fezj4ic 6449b513-ce07-4e2f-a64d-d507013d0d1c
a=ssrc:1966315384 mslabel:Dt5YcqBdN5php8AwHouypKamyLJT9Fezj4ic
a=ssrc:1966315384 label:6449b513-ce07-4e2f-a64d-d507013d0d1c
m=video 9 UDP/TLS/RTP/SAVPF 35
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:HV8K
a=ice-pwd:drEV18nSyHA7EiWr1D9j37LN
a=ice-options:trickle
a=fingerprint:sha-256 D1:3E:D0:4E:5F:91:AA:08:33:DE:33:C0:3D:82:D4:C9:85:9B:70:78:F4:B8:71:5F:51:E0:8F:E8:0D:EC:54:5B
a=setup:actpass
a=mid:1
a=extmap:14 urn:ietf:params:rtp-hdrext:toffset
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:13 urn:3gpp:video-orientation
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:12 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:11 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:Dt5YcqBdN5php8AwHouypKamyLJT9Fezj4ic a41f6233-d0de-4bf0-9479-ae9cd6a8b6d6
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:35 AV1X/90000
a=rtcp-fb:35 goog-remb
a=rtcp-fb:35 transport-cc
a=rtcp-fb:35 ccm fir
a=rtcp-fb:35 nack
a=rtcp-fb:35 nack pli
a=ssrc:1975300151 cname:p1AjwDY1akYv5Xyl
a=ssrc:1975300151 msid:Dt5YcqBdN5php8AwHouypKamyLJT9Fezj4ic a41f6233-d0de-4bf0-9479-ae9cd6a8b6d6
a=ssrc:1975300151 mslabel:Dt5YcqBdN5php8AwHouypKamyLJT9Fezj4ic
a=ssrc:1975300151 label:a41f6233-d0de-4bf0-9479-ae9cd6a8b6d6

Answer SDP

v=0
o=- 4364282017263967299 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=extmap-allow-mixed
a=msid-semantic: WMS LEIFoUMg2FIy2rR4gIIOJQ1UZ6Rk9IWHLrZn
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:pENq
a=ice-pwd:P/6Yb4ThwQQM75aUlinnDysZ
a=ice-options:trickle
a=fingerprint:sha-256 A0:BB:90:F9:2F:3C:43:91:6D:7F:4D:D2:51:C1:75:6D:64:1F:F2:E5:58:B7:6F:E0:05:31:FA:5E:85:2E:59:71
a=setup:active
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:LEIFoUMg2FIy2rR4gIIOJQ1UZ6Rk9IWHLrZn 1ecdef46-ec10-412b-8d75-17b311dc4e39
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:2979558157 cname:gQ6GVcZSPVJEx0l1
m=video 9 UDP/TLS/RTP/SAVPF 35
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:pENq
a=ice-pwd:P/6Yb4ThwQQM75aUlinnDysZ
a=ice-options:trickle
a=fingerprint:sha-256 A0:BB:90:F9:2F:3C:43:91:6D:7F:4D:D2:51:C1:75:6D:64:1F:F2:E5:58:B7:6F:E0:05:31:FA:5E:85:2E:59:71
a=setup:active
a=mid:1
a=extmap:14 urn:ietf:params:rtp-hdrext:toffset
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:13 urn:3gpp:video-orientation
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:12 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:11 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:LEIFoUMg2FIy2rR4gIIOJQ1UZ6Rk9IWHLrZn 7389e855-b866-4886-ac61-f5782cb6ed77
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:35 AV1X/90000
a=rtcp-fb:35 goog-remb
a=rtcp-fb:35 transport-cc
a=rtcp-fb:35 ccm fir
a=rtcp-fb:35 nack
a=rtcp-fb:35 nack pli
a=ssrc:722599194 cname:gQ6GVcZSPVJEx0l1

WebRTC SFU 向けの RTP 拡張は実装済み

WebRTC SFU Sora で AV1 を指定した Offer に対する Answer SDP の一部

m=video 9 UDP/TLS/RTP/SAVPF 120 96
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:Jzts
a=ice-pwd:Ng6SpmAgK4U668hW/9CtRmqg
a=ice-options:trickle
a=fingerprint:sha-256 00:4A:4F:FA:DA:C8:66:56:FB:5D:28:C9:73:62:58:E7:37:DC:F3:E1:C1:D4:52:F0:06:C6:BC:E3:E1:71:F2:C9
a=setup:active
a=mid:video_hRtGP1
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:12 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:13 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=extmap:17 https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension
a=sendonly
a=msid:x6zYcOPH6Yn93kHJ57gQVGOYoXRkGkQ3lryH 9165b739-1d9f-4d24-b4f1-cb995ab24e44
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:120 AV1X/90000
a=rtcp-fb:120 goog-remb
a=rtcp-fb:120 ccm fir
a=rtcp-fb:120 nack
a=rtcp-fb:120 nack pli
a=rtpmap:96 rtx/90000
a=fmtp:96 apt=120
a=ssrc-group:FID 3296248428 210492880
a=ssrc:3296248428 cname:W8sqUEK6iFrM47M6
a=ssrc:210492880 cname:W8sqUEK6iFrM47M6

a=extmap:17 https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension が返ってきてるのが確認できる。

AV1 を WebRTC SFU で配信している例。

Image from Gyazo

AV1 (1080p@30) で 1Mbps をサーバ経由で配信している。

作成者以外のコメントは許可されていません