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.83k stars 198 forks source link

Save RTMP to file #157

Open ozabalaferrera opened 1 week ago

ozabalaferrera commented 1 week ago

Hi, Is it possible to use the rtmp crate (or other underlying crates here) to save/write the stream to a file for some amount of time? I'm not seeing any way to do so. With ffmpeg I could achieve this with:

ffmpeg -re -t 20 -i rtmp://foo.com:554/bar/blah filename.mp4
harlanc commented 1 week ago

Maybe you can save the RTMP streams as FLV format files and you can refer to this repository: https://github.com/ningnao/xiu/tree/flv_record.