AirenSoft / OvenMediaEngine

OvenMediaEngine (OME) is a Sub-Second Latency Live Streaming Server with Large-Scale and High-Definition. #WebRTC #LLHLS
https://OvenMediaEngine.com/ome
GNU Affero General Public License v3.0
2.53k stars 1.06k forks source link

Cannot view H265 stream #696

Closed alexthedamager closed 2 years ago

alexthedamager commented 2 years ago

From FFMpeg, I can stream SRT H265 to OME, but I cannot view the stream in Safari (only tried using WebRTC for playback). SRT H264 with playback over WebRTC works fine.

The error message in the Safari console is InvalidAccessError: Failed to set remote offer sdp: Failed to set remote video description send parameters.

I believe only Safari supports H265 via WebRTC, so all playback attempts have been done in Safari. Non-WebRTC playback protocols have not been tested.

OME Information Using OME 12.8 Docker image on Ubuntu 20.04 Server.xml video is set to Bypass, audio is set to Opus transcode

Encoder information ffmpeg running in macOS.

Command for h265: ffmpeg -f lavfi -re -i testsrc=duration=90:size=1280x720:rate=25 -vcodec libx265 -b:v 4000000 -b:a 512000 -preset:v ultrafast -tune zerolatency -bf 0 -g 1 -pix_fmt yuv420p -f mpegts 'srtUrl'

Command for h264: ffmpeg -f lavfi -re -i testsrc=duration=90:size=1280x720:rate=25 -vcodec libx264 -b:v 4000000 -b:a 512000 -preset:v ultrafast -tune zerolatency -bf 0 -g 1 -pix_fmt yuv420p -f mpegts 'srtUrl'

Player information It reproduces on https://demo.ovenplayer.com (I entered the WSS url) with the console message same as at the top of this post.

Again - I have no problems with H264 playback over WebRTC via SRT and RTMP input - it's just H265 that I cannot subscribe to.

getroot commented 2 years ago

About a year ago I had an experimental implementation of H.265. But it looks like Chrome and Firefox won't support H.265 on WebRTC, so I haven't really bothered with that feature lately.

Anyway, Safari also provided it as a Technical Preview feature at that time, and to use this feature, you had to enable the option. I don't know if this is still the case, but would you like to check this?

Please refer to the URL below for details. https://webrtcbydralex.com/index.php/2020/04/28/how-to-enable-hevc-h265-and-av1-in-webrtc-in-your-browser/

alexthedamager commented 2 years ago

Thank you.

It seems like Safari still doesn't support H265 in WebRTC as a standard feature - I tried it in Safari Technical Preview (with the 'WebRTC H265 Codec' option enabled) and had a bit more success: I don't get the SDP error in the console (or any other errors), but the stream still doesn't play and the demo oven player just shows a constant spinner. Might be an encoder thing.

Either way, if it's not supported in standard Safari then it's of little real world use to anyone, I guess. Seems like VP9 and AV1 is probably the way things are going to go.

getroot commented 2 years ago

Yes, I am also going to focus on VP9 and AV1.

alexthedamager commented 1 year ago

It looks like libwebrtc / Chrome is in the process of adding support for HEVC in WebRTC... exciting!

https://webrtc.googlesource.com/src/+/972f28335a7f989ee1ffccb7c64fda1f29e09747

https://webrtc.googlesource.com/src/+/44943c8064b93a366cb8c8afdb881c009957e3df