ossrs / srs

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
25.35k stars 5.34k forks source link

WebRTC: no found valid H.264 payload type #2651

Closed Alijaaan closed 2 years ago

Alijaaan commented 2 years ago

Note: Issues that do not provide the following information will be deleted directly (Please follow the issue template, or we will delete it)'

Make sure to maintain the markdown structure.

Note: For inquiries and discussions, please submit them to the SRS forum (Please ask questions at) http://bbs.ossrs.net

Make sure to maintain the markdown structure.

Description

Make sure to maintain the markdown structure.

Please describe your issue here.

Make sure to maintain the markdown structure.

  1. SRS version: 4
  2. The log of SRS is as follows:

Make sure to maintain the markdown structure.

[2021-10-05 17:41:37.206][Trace][1][20g675o7] Hybrid cpu=1.00%,9MB, cid=1,0, timer=62,0,0, clock=0,48,1,0,0,0,0,0,0
[2021-10-05 17:41:37.356][Trace][1][hxh6579f] HTTP #0 5.114.5.94:51753 POST http://194.5.175.130:1985/rtc/v1/publish/, content-length=-1
[2021-10-05 17:41:37.382][Trace][1][hxh6579f] RTC publish webrtc://194.5.175.130/live/livestream, api=http://194.5.175.130:1985/rtc/v1/publish/, tid=, clientip=5.114.5.94, app=live, stream=livestream, offer=6167B, eip=, codec=
[2021-10-05 17:41:37.383][Trace][1][hxh6579f] ignore attribute=, value=
[2021-10-05 17:41:37.385][Warn][1][hxh6579f][0] RTC error code=5018 : create session : create session : add publisher : publish negotiate : no found valid H.264 payload type
thread [1][hxh6579f]: do_serve_http() [src/app/srs_app_rtc_api.cpp:443][errno=0]
thread [1][hxh6579f]: create_session() [src/app/srs_app_rtc_server.cpp:480][errno=0]
thread [1][hxh6579f]: do_create_session() [src/app/srs_app_rtc_server.cpp:497][errno=0]
thread [1][hxh6579f]: add_publisher() [src/app/srs_app_rtc_conn.cpp:1975][errno=0]
thread [1][hxh6579f]: negotiate_publish_capability() [src/app/srs_app_rtc_conn.cpp:2933][errno=0]
[2021-10-05 17:41:37.486][Trace][1][hxh6579f] TCP: before dispose resource(HttpConn)(0x2e68cc0), conns=1, zombies=0, ign=0, inz=0, ind=0
[2021-10-05 17:41:37.486][Warn][1][hxh6579f][104] client disconnect peer. ret=1007
[2021-10-05 17:41:37.486][Trace][1][8g51640k] TCP: clear zombies=1 resources, conns=1, removing=0, unsubs=0
[2021-10-05 17:41:37.486][Trace][1][hxh6579f] TCP: disposing #0 resource(HttpConn)(0x2e68cc0), conns=1, disposing=1, zombies=0
[2021-10-05 17:41:42.207][Trace][1][20g675o7] Hybrid cpu=0.00%,9MB, cid=2,1, timer=62,0,0, clock=0,48,1,0,0,0,0,0,0, free=1
  1. The configuration of SRS is as follows:

Make sure to maintain the markdown structure.

# WebRTC streaming config for SRS.
# @see full.conf for detail config.

listen              1935;
max_connections     1000;
daemon              off;
srs_log_tank        console;

http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
}

http_api {
    enabled         on;
    listen          1985;
}
stats {
    network         0;
}
rtc_server {
    enabled on;
    # Listen at udp://8000
    listen 8000;
    #
    # The $CANDIDATE means fetch from env, if not configed, use * as default.
    #
    # The * means retrieving server IP automatically, from all network interfaces,
    # @see https://github.com/ossrs/srs/wiki/v4_CN_RTCWiki#config-candidate
    candidate 194.5.175.130;
}

vhost __defaultVhost__ {
    rtc {
        enabled     on;
    }
    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }
}

Replay

Make sure to maintain the markdown structure.

How to replay bug?

Make sure to maintain the markdown structure.

  1. xxxxxx
  2. xxxxxx
  3. xxxxxx

Expected behavior (Expect)

Make sure to maintain the markdown structure.

Please describe your expectation

Make sure to maintain the markdown structure. I'm trying to publish and play with webrtc in my flutter app. First I added the stream by OBV to server and I could play with VLCPlayer by rtmp. Even I could recieve it in webrtc in html default page of srs. Then I used some help from flutter_live project and rtcdn-draft to how play streams by webrtc. I received : no found valid H.264 payload type. Then I tried to publish my stream to server by webrtc from my app. I received again : no found valid H.264 payload type.

TRANS_BY_GPT3

winlinvip commented 2 years ago

Is H5 OK? Or only issue in flutter_live?

Alijaaan commented 2 years ago

Is H5 OK? Or only issue in flutter_live?

Yes H5 is Ok. I easily can publish Streams by OBV and play in H5(webrtc) and VlC-player (rtmp). But when I try to publish or play from flutter app I receive this error.

Alijaaan commented 2 years ago

I tried so hard, but no luck, It seems when the offer send to api it has a problem and I do not receive answer. this is my offer :

v=0\r\no=- 3003030913490621030 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1 2\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS 271b7e9d-c661-4053-8478-f04056474eb7\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 35 36 100 101 127\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:q6nb\r\na=ice-pwd:Db+Hauh1GeyqgNUT3TrKw87O\r\na=ice-options:trickle renomination\r\na=fingerprint:sha-256 85:1B:E0:F1:F9:34:D6:90:51:FA:C8:21:EE:37:D3:A9:A7:21:D1:03:CB:E6:18:76:2D:0A:A5:A9:3D:A5:B7:62\r\na=setup:actpass\r\na=mid:0\r\na=extmap:1 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:3 urn:3gpp:video-orientation\r\na=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/vi

winlinvip commented 2 years ago

If H5 is ok, it generally the problem of client, and SRS can not help you.

Please check your client carefully.

BTW: Recommend use HTTP-FLV/RTMP/HLS if possible.

Alijaaan commented 2 years ago

If H5 is ok, it generally the problem of client, and SRS can not help you.

Please check your client carefully.

BTW: Recommend use HTTP-FLV/RTMP/HLS if possible.

Dear Winlinvip, Thanks for your answer and help. I tried so much and I found something. When I'm using flutter-web. everything is ok. Peer Connection is ok and I can publish and play in both side. But when I'm trying on emulator or real device I receive this error : no valid found h264 payload type Don't you think it might be related to srs server or any config?

Alijaaan commented 2 years ago

Dear Winlinvip,

I've searched a lot in flutter webrtc and I found many devices are not support H264. It means if anyone wants to use webrtc in any device they have problem like me. That's why I could publish and play easily in flutter web, but no luck in device. Is there any chance to support other codecs in srs server or is there any configuration that I missed?

Thanks in advance for your time and help.