Xiu is a live server written by Rust.
- RTMP
- publish and play
- relay: static push
- relay: static pull
- HTTPFLV
- HLS
- ...
- CentOS 7
- MaxOS
git clone https://github.com/harlanc/xiu.git
use master branch
cd ./xiu/application
cargo build
cd ./xiu/target/debug
./application config.toml
Use OBS to push a live rtmp stream.
Use ffplay to play rtmp live stream:
ffplay -i rtmp://localhost:1935/live/test
The configuration file is as follows (now only test on local machine):
The configuration file of Service 1 named config.toml:
[rtmp]
enabled = true
port = 1935
[[rtmp.push]]
enabled = true
address = "localhost"
port = 1936
The configuration file of Service 2 named config_push.toml:
[rtmp]
enabled = true
port = 1936
Run the 2 services:
./application config.toml
./application config_push.toml
Use Obs to push live stream to service 1, then the stream can be pushed to service 2 automatically, you can play the same live stream from both the two services:
ffplay -i rtmp://localhost:1935/live/test
ffplay -i rtmp://localhost:1936/live/test
The configuration file is as follows (now only test on local machine):
The configuration file of Service 1 named config.toml:
[rtmp]
enabled = true
port = 1935
The configuration file of Service 2 named config_pull.toml:
[rtmp]
enabled = true
port = 1936
[rtmp.pull]
enabled = false
address = "localhost"
port = 1935
Run the 2 services:
./application config.toml
./application config_pull.toml
Use obs to push live stream to service 1, when you play the stream from serivce 2, it will pull the stream from service 1:
ffplay -i rtmp://localhost:1935/live/test
ffplay -i rtmp://localhost:1936/live/test
[2021-05-15]
- Impl : Coding for pull is finished.
[2021-05-02]
- Impl : Coding for static push is finished.
[2021-04-16]
- Fix: obs publish-> unpublish->publish ,, ffplay cannot play successfully
[2021-04-15]
- Improve: remove build warnings.
[2021-04-14]
- Fix bug: when shutdown ffplayer ,the OBS publisher will be reconnected automatically.
[2021-04-11]
- Impl: add flush_timeout and read_timeout functinos.
- Impl: add some log print configuratinos.
- Fix bug: Chunk header with the save csid is not saved.
- Impl: add unsubscribe and unpublish logic in server_session and channels models.
[2021-04-10]
- Improve: change use libraries format.
[2021-04-09]
- Update README.
[2021-04-08]
- Fix: replace oneshot by mpsc channel,may be improved.