-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
HEVC: webrtc support hevc on safari. v6.0.34 #3441
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
Merged
winlinvip
merged 5 commits into
ossrs:develop
from
chundonglinlin:feature/webrtc-support-hevc-in-safari
Mar 7, 2023
Merged
HEVC: webrtc support hevc on safari. v6.0.34 #3441
winlinvip
merged 5 commits into
ossrs:develop
from
chundonglinlin:feature/webrtc-support-hevc-in-safari
Mar 7, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
winlinvip
approved these changes
Mar 6, 2023
chen-guanghua
approved these changes
Mar 7, 2023
xiaozhihong
added a commit
that referenced
this pull request
May 13, 2025
## 1. Usage ### Launch Chrome with H.265 enabled: ```bash # Windows: C:\Program Files\Google\Chrome\Application>"C:\Program Files\Google\Chrome\Application\chrome.exe" --enable-features=WebRtcAllowH265Receive --force-fieldtrials=WebRTC-Video-H26xPacketBuffer/Enabled # macOS: open -a "Google Chrome" --args --enable-features=WebRtcAllowH265Receive --force-fieldtrials=WebRTC-Video-H26xPacketBuffer/Enabled ``` > Note: The latest Chrome browser (version 136) fully enables this by default, so there's no need to launch it with any extra parameters. ### Launch SRS with `rtmp2rtc.conf` ```bash ./objs/srs -c conf/rtmp2rtc.conf ``` ### Push H.265 with RTMP ```bash ffmpeg -stream_loop -1 -re -i input.mp4 -c:v libx265 -preset fast -b:v 2000k -maxrate 2000k -bufsize 4000k -bf 0 -c:a aac -b:a 128k -ar 44100 -ac 2 -f flv rtmp://localhost/live/livestream ``` ### Play with WebRTC ```bash http://localhost:1985/rtc/v1/whep/?app=live&stream=livestream ```  ## 2. Parameter Combinations for SDP sendrecv offer ```bash --enable-features=WebRtcAllowH265Send,PlatformHEVCEncoderSupport,WebRtcAllowH265Receive --force-fieldtrials=WebRTC-Video-H26xPacketBuffer/Enabled ``` sendonly offer ```bash --enable-features=WebRtcAllowH265Send,PlatformHEVCEncoderSupport ``` recvonly offer ```bash --enable-features=WebRtcAllowH265Receive --force-fieldtrials=WebRTC-Video-H26xPacketBuffer/Enabled ``` ## 3. How to test if H.265 is working * Browser Test for supporting H265 https://webrtc.github.io/samples/src/content/peerconnection/change-codecs/  * How to test Safari: #3441 * Debug in Safari  --------- Co-authored-by: chundonglinlin <[email protected]> Co-authored-by: winlin <[email protected]> Co-authored-by: john <[email protected]> --------- Co-authored-by: chundonglinlin <[email protected]> Co-authored-by: john <[email protected]>
winlinvip
pushed a commit
that referenced
this pull request
May 14, 2025
```bash C:\Program Files\Google\Chrome\Application>"C:\Program Files\Google\Chrome\Application\chrome.exe" --enable-features=WebRtcAllowH265Receive --force-fieldtrials=WebRTC-Video-H26xPacketBuffer/Enabled open -a "Google Chrome" --args --enable-features=WebRtcAllowH265Receive --force-fieldtrials=WebRTC-Video-H26xPacketBuffer/Enabled ``` > Note: The latest Chrome browser (version 136) fully enables this by default, so there's no need to launch it with any extra parameters. ```bash ./objs/srs -c conf/rtmp2rtc.conf ``` ```bash ffmpeg -stream_loop -1 -re -i input.mp4 -c:v libx265 -preset fast -b:v 2000k -maxrate 2000k -bufsize 4000k -bf 0 -c:a aac -b:a 128k -ar 44100 -ac 2 -f flv rtmp://localhost/live/livestream ``` ```bash http://localhost:1985/rtc/v1/whep/?app=live&stream=livestream ```  sendrecv offer ```bash --enable-features=WebRtcAllowH265Send,PlatformHEVCEncoderSupport,WebRtcAllowH265Receive --force-fieldtrials=WebRTC-Video-H26xPacketBuffer/Enabled ``` sendonly offer ```bash --enable-features=WebRtcAllowH265Send,PlatformHEVCEncoderSupport ``` recvonly offer ```bash --enable-features=WebRtcAllowH265Receive --force-fieldtrials=WebRTC-Video-H26xPacketBuffer/Enabled ``` * Browser Test for supporting H265 https://webrtc.github.io/samples/src/content/peerconnection/change-codecs/  * How to test Safari: #3441 * Debug in Safari  --------- Co-authored-by: chundonglinlin <[email protected]> Co-authored-by: winlin <[email protected]> Co-authored-by: john <[email protected]> --------- Co-authored-by: chundonglinlin <[email protected]> Co-authored-by: john <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is for HEVC over WebRTC, right now only Safari.
First, please build SRS with HEVC support:
Then, please enable HEVC for WebRTC in Safari,
Develop > Experimental Features > WebRTC H265 codecNext, open webrtc://127.0.0.1/live/livestream?codec=hevc in Safari to push WebRTC stream to SRS:
Now, open webrtc://127.0.0.1/live/livestream?codec=hevc in Safari to pull the WebRTC stream.
If want to view the log for Safari WebRTC: