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

Does SRS support push HEVC/H.265 over WebRTC(whip) using OBS ? #4263

Closed
Zhanghailin1995 opened this issue Dec 23, 2024 · 7 comments · May be fixed by #4289
Closed

Does SRS support push HEVC/H.265 over WebRTC(whip) using OBS ? #4263

Zhanghailin1995 opened this issue Dec 23, 2024 · 7 comments · May be fixed by #4289
Labels
Codec HEVC, FFmpeg for ingesting, trascoding or codec. EnglishNative This issue is conveyed exclusively in English. WebRTC WebRTC, RTC2RTMP or RTMP2RTC.

Comments

@Zhanghailin1995
Copy link

Describe the bug
Does SRS support push HEVC/H.265 over WebRTC using OBS ? I don't know whether SRS or OBS does not support push HEVC/H.265 over WebRTC ?

Version
SRS 6.0.155

@winlinvip winlinvip added the EnglishNative This issue is conveyed exclusively in English. label Dec 23, 2024
@suzp1984
Copy link
Contributor

I think it's a bug, HEVC/H.264 over WebRTC is supported by SRS, but when it is the WHIP publish, the code will force RTC downgrade to H.264 during SDP negotiation.

} else if (remote_media_desc.is_video()) {
std::vector<SrsMediaPayloadType> payloads = remote_media_desc.find_media_with_encoding_name("H264");
if (payloads.empty()) {
return srs_error_new(ERROR_RTC_SDP_EXCHANGE, "no found valid H.264 payload type");

There's a recent related issue #4259 , which is publish by GB28181 with HEVC, but play offer said SRS only support H.264.
Maybe adjust the SDP negotiation can fix this issue, I'll try later.

@Zhanghailin1995
Copy link
Author

I think it's a bug, HEVC/H.264 over WebRTC is supported by SRS, but when it is the WHIP publish, the code will force RTC downgrade to H.264 during SDP negotiation.

} else if (remote_media_desc.is_video()) {
std::vector<SrsMediaPayloadType> payloads = remote_media_desc.find_media_with_encoding_name("H264");
if (payloads.empty()) {
return srs_error_new(ERROR_RTC_SDP_EXCHANGE, "no found valid H.264 payload type");

There's a recent related issue #4259 , which is publish by GB28181 with HEVC, but play offer said SRS only support H.264. Maybe adjust the SDP negotiation can fix this issue, I'll try later.

I made a mistake, I didn't add codec=hevc in the whip url parameters. After I did this, It worked

@suzp1984
Copy link
Contributor

oh, I just knows that.
repeat the solution: use the whip url with codec: http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream&codec=hevc

@Zhanghailin1995
Copy link
Author

oh, I just knows that. repeat the solution: use the whip url with codec: http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream&codec=hevc

push stream was successful, but it still cannot be played normally in Chrome, even though I have turned on hardware-accelerated video decode flag. can you try it?

@Zhanghailin1995
Copy link
Author

I I found a way to play the hevc stream over WebRTC in chrome. Add two param to start chrome "--enable-features=WebRtcAllowH265Receive --force-fieldtrials=WebRTC-Video-H26xPacketBuffer/Enabled".

@Diras226
Copy link

Diras226 commented Feb 8, 2025

Hey, i also have a problem pushing a WHIP stream to SRS using OBS and HEVC. After like 1minute of pushing the stream i get infinite warnings in SRS. I am also not able to play the stream. Did i do something wrong in OBS?

I am using the following url:
https://rtclocal.de/rtc/v1/whip/?app=live&stream=d6efeeb3-8e6f-42fe-935a&stream-key=ec663a9b-fcec-48b8-9ad8&codec=hevc

Is the additional "stream-key" query param maybe the problem?

Image

My OBS settings are as followed:

Image

@winlinvip winlinvip added WebRTC WebRTC, RTC2RTMP or RTMP2RTC. Codec HEVC, FFmpeg for ingesting, trascoding or codec. labels Feb 8, 2025
@duiniuluantanqin
Copy link
Member

duiniuluantanqin commented Mar 4, 2025

Hey, i also have a problem pushing a WHIP stream to SRS using OBS and HEVC. After like 1minute of pushing the stream i get infinite warnings in SRS. I am also not able to play the stream. Did i do something wrong in OBS?

I am using the following url: https://rtclocal.de/rtc/v1/whip/?app=live&stream=d6efeeb3-8e6f-42fe-935a&stream-key=ec663a9b-fcec-48b8-9ad8&codec=hevc

Is the additional "stream-key" query param maybe the problem?

Image

My OBS settings are as followed:

Image

You do not require a stream-key.

TRANS_BY_GPT4

@duiniuluantanqin duiniuluantanqin linked a pull request Mar 4, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Codec HEVC, FFmpeg for ingesting, trascoding or codec. EnglishNative This issue is conveyed exclusively in English. WebRTC WebRTC, RTC2RTMP or RTMP2RTC.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants