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.59k stars 168 forks source link

Cannot publish rtsp stream via gstreamer #135

Open GrumpyChubbyCat opened 6 days ago

GrumpyChubbyCat commented 6 days ago

XIU version XIU 0.12.7

Describe the bug I'm trying to publish an rtsp broadcast using gstreamer. Xiu cannot parse requests from the gstreamer's rtspclientsink element - GStreamer 1.16.3 To Reproduce To publish a stream I use the following gstreamer command:

gst-launch-1.0 videotestsrc ! x264enc ! rtspclientsink protocols=tcp location=rtsp://0.0.0.0:8554/test-stream

Log from Xiu:

[2024-06-24T09:32:10Z INFO  xrtsp::rtsp] Rtsp server listening on tcp://0.0.0.0:8554
[2024-06-24T09:32:10Z INFO  xiu::api] Http api server listening on http://0.0.0.0:8000
[2024-06-24T09:32:22Z DEBUG xrtsp::session] dollar sign: false
[2024-06-24T09:32:22Z DEBUG xrtsp::session] dollar sign: false
[2024-06-24T09:32:22Z INFO  xrtsp::sdp] not parsed: i=rtspclientsink
[2024-06-24T09:32:22Z INFO  xrtsp::session] media_name: video
[2024-06-24T09:32:22Z INFO  streamhub] event data: {"Publish":{"identifier":{"rtsp":{"stream_path":"test-stream"}},"info":{"id":"1719221542","pub_type":"PushRtsp","notify_info":{"request_url":"","remote_addr":""}}}}
[2024-06-24T09:32:22Z INFO  streamhub] transceiver run success, idetifier: RTSP - stream_name: test-stream
[2024-06-24T09:32:22Z DEBUG xrtsp::session] dollar sign: false
[2024-06-24T09:32:22Z DEBUG xrtsp::session] dollar sign: false
[2024-06-24T09:32:42Z ERROR xrtsp::rtsp] session run error, err: net io error: none return
[2024-06-24T09:32:42Z DEBUG xrtsp::session] dollar sign: false
[2024-06-24T09:32:42Z ERROR xrtsp::rtsp] session run error, err: net io error: none return

When try to connect again, an error occurs:

2024-06-24T09:40:45Z DEBUG xrtsp::session] dollar sign: false
[2024-06-24T09:40:45Z DEBUG xrtsp::session] dollar sign: false
[2024-06-24T09:40:45Z INFO  xrtsp::sdp] not parsed: i=rtspclientsink
[2024-06-24T09:40:45Z INFO  xrtsp::session] media_name: video
[2024-06-24T09:40:45Z INFO  streamhub] event data: {"Publish":{"identifier":{"rtsp":{"stream_path":"test-stream"}},"info":{"id":"1719222045","pub_type":"PushRtsp","notify_info":{"request_url":"","remote_addr":""}}}}
[2024-06-24T09:40:45Z ERROR streamhub] event_loop Publish err: exists
[2024-06-24T09:40:45Z ERROR xrtsp::rtsp] session run error, err: event execute error: exists
[2024-06-24T09:40:45Z DEBUG xrtsp::session] dollar sign: false
[2024-06-24T09:40:45Z INFO  xrtsp::sdp] not parsed: i=rtspclientsink
[2024-06-24T09:40:45Z INFO  xrtsp::session] media_name: video
[2024-06-24T09:40:45Z INFO  streamhub] event data: {"Publish":{"identifier":{"rtsp":{"stream_path":"test-stream"}},"info":{"id":"1719222045","pub_type":"PushRtsp","notify_info":{"request_url":"","remote_addr":""}}}}
[2024-06-24T09:40:45Z ERROR streamhub] event_loop Publish err: exists
[2024-06-24T09:40:45Z ERROR xrtsp::rtsp] session run error, err: event execute error: exists
[2024-06-24T09:40:45Z DEBUG xrtsp::session] dollar sign: false
[2024-06-24T09:40:45Z ERROR xrtsp::rtsp] session run error, err: net io error: none return
harlanc commented 6 days ago

seems a bug..