Skip to content

Commit

Permalink
WebRTC: Warning if no ideal profile. v6.0.33, v5.0.146 (#3446)
Browse files Browse the repository at this point in the history
For WebRTC, SRS expect the h.264 codec is:

```
a=rtpmap:106 H264/90000
a=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
```

But sometimes, the device does not support the profile, for example only bellow:

```
a=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e033
a=fmtp:122 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=420033
a=fmtp:121 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640033
a=fmtp:120 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0033
```

So we should warning user about the profile missmatch, because it might not work.

PICK a751448

----------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: LiPeng <lipeng19811218@gmail.com>
  • Loading branch information
3 people committed Mar 7, 2023
1 parent 47aa42f commit 34c78a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions trunk/doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The changelog for SRS.

## SRS 5.0 Changelog

* v5.0, 2023-03-07, Merge [#3446](https://github.com/ossrs/srs/pull/3446): WebRTC: Warning if no ideal profile. v5.0.146 (#3446)
* v5.0, 2023-03-06, Merge [#3445](https://github.com/ossrs/srs/pull/3445): Support configure for generic linux. v5.0.145 (#3445)
* v5.0, 2023-03-04, Merge [#3105](https://github.com/ossrs/srs/pull/3105): Kickoff publisher when stream is idle, which means no players. v5.0.144 (#3105)
* v5.0, 2023-02-25, Merge [#3424](https://github.com/ossrs/srs/pull/3424): API: Add service_id for http_hooks, which identify the process. v5.0.143 (#3424)
Expand Down
6 changes: 5 additions & 1 deletion trunk/src/app/srs_app_rtc_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2723,6 +2723,10 @@ srs_error_t SrsRtcConnection::negotiate_publish_capability(SrsRtcUserConfig* ruc

track_desc->type_ = "video";
track_desc->set_codec_payload((SrsCodecPayload*)video_payload);

if (!has_42e01f) {
srs_warn("not ideal H.264 pt=%d %s", payload.payload_type_, payload.format_specific_param_.c_str());
}
// Only choose first match H.264 payload type.
break;
}
Expand Down Expand Up @@ -2756,7 +2760,7 @@ srs_error_t SrsRtcConnection::negotiate_publish_capability(SrsRtcUserConfig* ruc

track_desc->type_ = "video";
track_desc->set_codec_payload((SrsCodecPayload*)video_payload);
srs_warn("choose backup H.264 payload type=%d", payload.payload_type_);
srs_warn("choose backup H.264 pt=%d %s", payload.payload_type_, payload.format_specific_param_.c_str());
}

// TODO: FIXME: Support RRTR?
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core_version5.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

#define VERSION_MAJOR 5
#define VERSION_MINOR 0
#define VERSION_REVISION 145
#define VERSION_REVISION 146

#endif

0 comments on commit 34c78a7

Please sign in to comment.