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

WebRTC AV1 streaming failed, no valid AV1 payload type found. #2760

Closed
trswygg opened this issue Nov 29, 2021 · 6 comments
Closed

WebRTC AV1 streaming failed, no valid AV1 payload type found. #2760

trswygg opened this issue Nov 29, 2021 · 6 comments
Assignees
Labels
TransByAI Translated by AI/GPT. WebRTC WebRTC, RTC2RTMP or RTMP2RTC.
Milestone

Comments

@trswygg
Copy link

trswygg commented Nov 29, 2021

Note: Before asking a question, please read the FAQ (Please read FAQ before filing an issue) #2716

WebRTC AV1 streaming, playback failed, using SRS returned 400, checking SDP found that AV1X has changed to a=rtpmap:35 AV1/90000.
Using a self-built server (Linux on a local network).
chrome:
Google Chrome | 96.0.4664.55 (Official Build) (x86_64)
Operating System | macOS Version 12.0.1 (Build 21A559)
JavaScript | V8 9.6.180.12
User Agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36

Please describe the issue you encountered.

  1. SRS version: SRS/5.0.19(Leo)

  2. SRS log:

[2021-11-29 11:19:10.223][Trace][274637][373v3df6] Hybrid cpu=1.00%,161MB, cid=1,0, timer=62,0,0, clock=0,49,0,0,0,0,0,0,0
[2021-11-29 11:19:13.138][Trace][274637][67f446i5] HTTP #0 172.17.0.3:34462 POST https://ubuntu.pve/rtc/v1/publish/?codec=av1, content-length=6179
[2021-11-29 11:19:13.138][Trace][274637][67f446i5] RTC publish webrtc:https://ubuntu.pve/live/livestream?codec=av1, api=https://ubuntu.pve:443/rtc/v1/publish/?codec=av1, tid=2ba78c4, clientip=192.1.1.50, app=live, stream=livestream, offer=5678B, eip=, codec=av1
[2021-11-29 11:19:13.138][Trace][274637][67f446i5] ignore attribute=, value=
[2021-11-29 11:19:13.138][Warn][274637][67f446i5][11] RTC error code=5018 : create session : create session : add publisher : publish negotiate : no found valid AV1 payload type
thread [274637][67f446i5]: do_serve_http() [src/app/srs_app_rtc_api.cpp:443][errno=11]
thread [274637][67f446i5]: create_session() [src/app/srs_app_rtc_server.cpp:480][errno=11]
thread [274637][67f446i5]: do_create_session() [src/app/srs_app_rtc_server.cpp:497][errno=11]
thread [274637][67f446i5]: add_publisher() [src/app/srs_app_rtc_conn.cpp:1981][errno=11]
thread [274637][67f446i5]: negotiate_publish_capability() [src/app/srs_app_rtc_conn.cpp:2882][errno=11]
[2021-11-29 11:19:13.138][Trace][274637][67f446i5] TCP: before dispose resource(HttpConn)(0x5592d7e65760), conns=1, zombies=0, ign=0, inz=0, ind=0
[2021-11-29 11:19:13.138][Warn][274637][67f446i5][104] client disconnect peer. ret=1007
[2021-11-29 11:19:13.138][Trace][274637][01t53653] TCP: clear zombies=1 resources, conns=1, removing=0, unsubs=0
[2021-11-29 11:19:13.138][Trace][274637][67f446i5] TCP: disposing #0 resource(HttpConn)(0x5592d7e65760), conns=1, disposing=1, zombies=0
[2021-11-29 11:19:15.224][Trace][274637][373v3df6] Hybrid cpu=0.00%,161MB, cid=1,0, timer=62,0,0, clock=0,49,0,0,0,0,0,0,0
  1. SRS configuration:
listen 1935;
max_connections 1000;
daemon on;
srs_log_tank file;
srs_log_level trace;
srs_log_file ./objs/srs.log;

http_api {
    enabled on;
    listen 1985;
    crossdomain on;
    raw_api {
        enabled on;
        allow_reload on;
        allow_query on;
        allow_update off;
    }
    https {
        enabled on;
        listen 1986;
        key ./conf/server.key;
        cert ./conf/server.crt;
    }
}

http_server {
    enabled on;
    listen 8080;
}

# WebRTC
rtc_server {
    enabled on;
    listen 8000;
    perf_stat       on;
    ip_family ipv4;
    candidate $CANDIDATE;
}

vhost __defaultVhost__ {
    rtc {
        enabled on;
        dtls_version auto;

        rtmp_to_rtc on;
        rtc_to_rtmp on;
        # The PLI interval in seconds, for RTC to RTMP.
        # Note the available range is [0.5, 30]
        pli_for_rtmp 6.0;
    }
    min_latency on;
    play {
            mw_latency      0;
            mw_msgs         0;
            queue_length    10;
        }
    http_remux {
        enabled on;
        mount [vhost]/[app]/[stream].flv;
    }
}

Replay

How to replay bug?

Steps to reproduce the bug

1. Visit https://ubuntu.pve/players/rtc_publisher.html?autostart=false

  1. webrtc:https://ubuntu.pve/live/aabbcc?codec=av1
    1. The player is destroyed, and the console prints Got answer: {code: 400}.

推流端sdp (Streaming end SDP)

v=0
o=- 583941141996781899 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=extmap-allow-mixed
a=msid-semantic: WMS
m=audio 9 UDP/TLS/RTP/SAVPF 111 63 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:Vf9F
a=ice-pwd:7RzzXxhY18LmUszopMe8KaUW
a=ice-options:trickle
a=fingerprint:sha-256 F3:9F:40:41:16:79:4B:07:90:D6:EC:40:77:CD:3D:A2:30:95:47:5A:95:A6:3D:70:A1:BF:B0:30:1B:80:96:F2
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 https://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 https://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=sendonly
a=msid:- 1fd1f971-b674-44c0-802c-3fc5e2c6bfd3
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:63 red/48000/2
a=fmtp:63 111/111
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:331486039 cname:nHAPEsqENL+Z6CK2
a=ssrc:331486039 msid:- 1fd1f971-b674-44c0-802c-3fc5e2c6bfd3
a=ssrc:331486039 mslabel:-
a=ssrc:331486039 label:1fd1f971-b674-44c0-802c-3fc5e2c6bfd3
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 121 127 120 125 107 108 109 35 36 124 119 123 118 114 115 116
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:Vf9F
a=ice-pwd:7RzzXxhY18LmUszopMe8KaUW
a=ice-options:trickle
a=fingerprint:sha-256 F3:9F:40:41:16:79:4B:07:90:D6:EC:40:77:CD:3D:A2:30:95:47:5A:95:A6:3D:70:A1:BF:B0:30:1B:80:96:F2
a=setup:actpass
a=mid:1
a=extmap:14 urn:ietf:params:rtp-hdrext:toffset
a=extmap:2 https://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:13 urn:3gpp:video-orientation
a=extmap:3 https://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:12 https://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:11 https://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:7 https://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:8 https://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=sendonly
a=msid:- 9a54aa56-2115-4a30-8cf7-db9aa4fef522
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:98 VP9/90000
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=fmtp:98 profile-id=0
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:100 VP9/90000
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=fmtp:100 profile-id=2
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=rtpmap:102 H264/90000
a=rtcp-fb:102 goog-remb
a=rtcp-fb:102 transport-cc
a=rtcp-fb:102 ccm fir
a=rtcp-fb:102 nack
a=rtcp-fb:102 nack pli
a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=rtpmap:121 rtx/90000
a=fmtp:121 apt=102
a=rtpmap:127 H264/90000
a=rtcp-fb:127 goog-remb
a=rtcp-fb:127 transport-cc
a=rtcp-fb:127 ccm fir
a=rtcp-fb:127 nack
a=rtcp-fb:127 nack pli
a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f
a=rtpmap:120 rtx/90000
a=fmtp:120 apt=127
a=rtpmap:125 H264/90000
a=rtcp-fb:125 goog-remb
a=rtcp-fb:125 transport-cc
a=rtcp-fb:125 ccm fir
a=rtcp-fb:125 nack
a=rtcp-fb:125 nack pli
a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:107 rtx/90000
a=fmtp:107 apt=125
a=rtpmap:108 H264/90000
a=rtcp-fb:108 goog-remb
a=rtcp-fb:108 transport-cc
a=rtcp-fb:108 ccm fir
a=rtcp-fb:108 nack
a=rtcp-fb:108 nack pli
a=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f
a=rtpmap:109 rtx/90000
a=fmtp:109 apt=108
a=rtpmap:35 AV1/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=rtpmap:36 rtx/90000
a=fmtp:36 apt=35
a=rtpmap:124 H264/90000
a=rtcp-fb:124 goog-remb
a=rtcp-fb:124 transport-cc
a=rtcp-fb:124 ccm fir
a=rtcp-fb:124 nack
a=rtcp-fb:124 nack pli
a=fmtp:124 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0032
a=rtpmap:119 rtx/90000
a=fmtp:119 apt=124
a=rtpmap:123 H264/90000
a=rtcp-fb:123 goog-remb
a=rtcp-fb:123 transport-cc
a=rtcp-fb:123 ccm fir
a=rtcp-fb:123 nack
a=rtcp-fb:123 nack pli
a=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640032
a=rtpmap:118 rtx/90000
a=fmtp:118 apt=123
a=rtpmap:114 red/90000
a=rtpmap:115 rtx/90000
a=fmtp:115 apt=114
a=rtpmap:116 ulpfec/90000
a=ssrc-group:FID 582915416 3168979914
a=ssrc:582915416 cname:nHAPEsqENL+Z6CK2
a=ssrc:582915416 msid:- 9a54aa56-2115-4a30-8cf7-db9aa4fef522
a=ssrc:582915416 mslabel:-
a=ssrc:582915416 label:9a54aa56-2115-4a30-8cf7-db9aa4fef522
a=ssrc:3168979914 cname:nHAPEsqENL+Z6CK2
a=ssrc:3168979914 msid:- 9a54aa56-2115-4a30-8cf7-db9aa4fef522
a=ssrc:3168979914 mslabel:-
a=ssrc:3168979914 label:9a54aa56-2115-4a30-8cf7-db9aa4fef522

I don't know why

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Nov 30, 2021

You should have failed to push the stream, it didn't go up successfully, it's not a playback failure.

no found valid AV1 payload type

TRANS_BY_GPT3

@winlinvip winlinvip changed the title WebRTC AV1 推流,播放失败 WebRTC AV1 推流失败 no found valid AV1 payload type Nov 30, 2021
@winlinvip winlinvip self-assigned this Nov 30, 2021
@winlinvip winlinvip added the WebRTC WebRTC, RTC2RTMP or RTMP2RTC. label Nov 30, 2021
@winlinvip winlinvip added this to the 5.0 milestone Nov 30, 2021
@trswygg
Copy link
Author

trswygg commented Nov 30, 2021

Before and after exchanging SDP on the client side, you can solve it by using replaceAll("AV1","AV1X") and replaceAll("AV1X","AV1"), but I don't know if I should do this, and currently I don't have any other computers and browsers available for testing.

setLocalDescription of SrsRtcPublisherAsync.publish can accept AV1X, but the player will report "Failed to execute 'setLocalDescription' on 'RTCPeerConnection': Failed to set local offer sdp: Failed to set local video description recv parameters for m-section with mid='1'."

It feels very strange that this problem only appeared after upgrading Chrome.

TRANS_BY_GPT3

@jocover
Copy link

jocover commented Dec 3, 2021

https://bugs.chromium.org/p/webrtc/issues/detail?id=13166
AV1X has been renamed to AV1.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Dec 4, 2021

@jocover 👍 Can you conveniently submit a PR?

TRANS_BY_GPT3

@Huachao
Copy link
Contributor

Huachao commented Dec 10, 2021

@winlinvip @jocover I submitted a fix PR #2784, please help take a look. Make sure to maintain the markdown structure.

TRANS_BY_GPT3

winlinvip pushed a commit that referenced this issue Dec 20, 2021
* RTC: Replace payload name AV1X with AV1 for WebRTC. (#2760)

* Add compatibility check code for old versions of Chrome

* 新增获取track_desc的AV1X编码兼容性检查
@winlinvip
Copy link
Member

Fixed in SRS 4

@winlinvip winlinvip modified the milestones: 5.0, 4.0 Jan 2, 2023
@winlinvip winlinvip changed the title WebRTC AV1 推流失败 no found valid AV1 payload type WebRTC AV1 streaming failed, no valid AV1 payload type found. Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT. WebRTC WebRTC, RTC2RTMP or RTMP2RTC.
Projects
None yet
Development

No branches or pull requests

4 participants