harlanc / xiu

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

Recording is supported? #48

Closed danielboros1990 closed 11 months ago

danielboros1990 commented 1 year ago

Is it possible to record the rtmp streaming?

harlanc commented 1 year ago

Currently not supported, but it's easily achievable.The RTMP stream can be saved as a FLV file or HLS files(m3u8+ts).

danielboros1990 commented 1 year ago

Great, thank you. We would like to use Xiu instead of Nginx, this would be pretty nice if the recording would be supported.

harlanc commented 1 year ago

Hi @danielboros1990

Now the RTMP stream can be saved as HLS files in xiu v0.8.0, you need to do the following configurations:

[hls]
# true or false to enable or disable the feature
enabled = true
# listening port
port = 8080
# need record the live stream or not
need_record = true

Then when RTMP stream is published to xiu, it will remux the stream to HLS and the ts files will not be deleted when the stream is unpublished, and a VOD m3u8 will also be generated in the same folder with ts files in the end.

If you set the need_record to false (or remove this item ,the default value is false), the ts files and LIVE m3u8 will be deleted when the stream is unpublished.