harlanc / xiu

A simple,high performance and secure live media server in pure Rust (RTMP[cluster]/RTSP/WebRTC[whip/whep]/HTTP-FLV/HLS).🦀
https://www.rustxiu.com
MIT License
1.6k stars 168 forks source link

Still unable to use WHIP #125

Open kaitlynia opened 2 months ago

kaitlynia commented 2 months ago

v0.12.6, Ubuntu

Describe the bug Throws the following error: [2024-04-28T00:25:45Z ERROR xwebrtc::webrtc] session run error, err: Utf8Error: invalid utf-8 sequence of 1 bytes from index 11

No matter what URL is supplied in OBS (with/without token, specifying /whip or not) it always throws Utf8Error

To Reproduce Use any URL pointing to a xiu server in OBS (WHIP)

Expected behavior Accepts incoming request from OBS

kaitlynia commented 2 months ago

The error occurs for this line: https://github.com/harlanc/xiu/blob/7df491b69215e2182e8cca2748c14b2d75de88b5/protocol/webrtc/src/session/mod.rs#L97

...indicating that whatever data ends up in reader is not Utf8. I have not supplied any non-Utf8 text in my OBS settings, so it's possible that OBS is injecting some non-Utf8 characters or somewhere along the way the request is mutated by xiu to contain non-Utf8 characters

harlanc commented 2 months ago

A similar problem mentioned here : https://github.com/harlanc/xiu/issues/82#issuecomment-1868472390. Or refer to the doc https://www.rustxiu.com/docs/scenarios/webrtc ?

kaitlynia commented 1 month ago

There is not sufficient information in the docs for me to troubleshoot with. An example push URL is provided in the form of http://localhost:8900/whip?app=live&stream=test&token=123 but there is no explanation of where to set app or whether token goes into the URL field or Bearer Token field in OBS. Is /whip always the served path? Do WHEP listeners really need the token too/is there no way to require authentication for only WHIP?

wxjrkm520 commented 3 weeks ago

18:14:30.831: [FFmpeg libopus encoder: 'simple_opus'] bitrate: 160, channels: 2, channel_layout: stereo 18:14:30.831: 18:14:30.834: [obs-webrtc] [whip_output: 'simple_stream'] PeerConnection state is now: Connecting 18:14:31.097: [obs-webrtc] [whip_output: 'simple_stream'] PeerConnection state is now: Failed 18:14:31.097: Output 'simple_stream': stopping 18:14:31.097: Output 'simple_stream': Total frames output: 0 18:14:31.097: Output 'simple_stream': Total drawn frames: 8 18:14:31.097: [obs-webrtc] [whip_output: 'simple_stream'] PeerConnection state is now: Closed

wxjrkm520 commented 3 weeks ago

webrtc::peer_connection::peer_connection_internal] Failed to start manager dtls: Alert is Fatal or Close Notify