Skip to content

Commit

Permalink
update release cargo project files
Browse files Browse the repository at this point in the history
  • Loading branch information
harlanc committed Jul 28, 2023
1 parent 352f690 commit f97afa1
Show file tree
Hide file tree
Showing 22 changed files with 120 additions and 52 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
COPY_CONF_FILES = sh ./update_project_conf.sh

not_spport:
echo "input make <local|online|clean|check>"
echo "input make <local|online|build|clean|check>"
# build local source codes
local:
cd ./confs && $(COPY_CONF_FILES) "local"
cargo build
# pull the online crates codes and build
online:
cd ./confs && $(COPY_CONF_FILES) "online"
cargo build
check:
cargo clippy --fix --allow-dirty --allow-no-vcs
clean:
cargo clean
cargo clean
build:
cargo build
14 changes: 7 additions & 7 deletions application/xiu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "xiu"
description = "A powerful live server by Rust ."
version = "0.6.1"
version = "0.7.0"
authors = ["HarlanC <wawacry@qq.com"]
repository = "https://github.com/harlanc/xiu"
license = "MIT"
Expand All @@ -26,12 +26,12 @@ serde_json = { version = "1", default-features = false, features = [
axum = "0.6.10"
tokio-metrics = { version = "0.2.0", default-features = false }

env_logger_extend = { path = "../../library/logger/" }
streamhub = { path = "../../library/streamhub/" }
rtmp = { path = "../../protocol/rtmp/" }
rtsp = { path = "../../protocol/rtsp/" }
httpflv = { path = "../../protocol/httpflv/" }
hls = { path = "../../protocol/hls/" }
env_logger_extend = "0.1.1"
streamhub = "0.1.0"
rtmp = "0.4.0"
rtsp = "0.1.0"
httpflv = "0.3.0"
hls = "0.3.0"

[features]
default = ["std"]
Expand Down
60 changes: 49 additions & 11 deletions application/xiu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,25 @@

[中文文档](https://github.com/harlanc/xiu/blob/master/README_CN.md)

Xiu is a simple,high performance and secure live media server written in pure Rust, it now supports popular live protocols like RTMP/HLS/HTTP-FLV, you can deploy it as a stand-alone server or a cluster using the relay feature.
Xiu is a simple,high performance and secure live media server written in pure Rust, it now supports popular live protocols like RTMP/RTSP/HLS/HTTP-FLV, you can deploy it as a stand-alone server or a cluster using the relay feature.

## Features
- [x] Support multiple platforms(Linux/MacOS/Windows).
- [x] Support RTMP as a
stand-alone server or cluster(RTMP relay).
- [x] Support RTMP.
- [x] Support publish/subscribe H264/AAC stream .
- [x] Support GOP cache which can be configured in the configuration file.
- [x] Support HTTP-FLV/HLS protocols(Transferred from RTMP).
- [x] Support transfer from RTMP to HLS/HTTP-FLV
- [x] Support cluster.
- [x] Support RTSP.
- [x] Support publish/subscribe H265/H264/AAC stream over both TCP(Interleaved) and UDP.
- [x] Support transfer from RTSP to RTMP/HLS/HTTP-FLV
- [x] Support HTTP-FLV/HLS protocols(Transferred from RTMP/RTSP).
- [x] Support configuring the service using command line or a configuration file.
- [x] Support HTTP API/Notifications.
- [x] Support querying stream information.
- [x] Support notify stream status.
- [x] Support token authentications.
- [ ] Support RTSP.


## Preparation
#### Install Rust and Cargo
Expand All @@ -62,11 +67,12 @@ Start the service with the following command to get help:
xiu -h
A secure and easy to use live media server, hope you love it!!!

Usage: xiu [OPTIONS] <--config <path>|--rtmp <port>>
Usage: xiu [OPTIONS]

Options:
-c, --config <path> Specify the xiu server configuration file path.
-r, --rtmp <port> Specify the RTMP listening port(e.g.:1935).
-t, --rtsp <port> Specify the rtsp listening port.(e.g.:554)
-f, --httpflv <port> Specify the HTTP-FLV listening port(e.g.:8080).
-s, --hls <port> Specify the HLS listening port(e.g.:8081).
-l, --log <level> Specify the log level. [possible values: trace, debug, info, warn, error, debug]
Expand All @@ -83,11 +89,18 @@ use master branch

#### Build

cd ./xiu/application/xiu
cargo build --release
We use makefile to build xiu and revelant libraries.

- Using make local to build local source codes:

make local
- Using make online to pull the online crates codes and build:

make online

#### Run

cd ./xiu/target/release
cd ./xiu/target/release or ./xiu/target/debug
./xiu -h

## CLI
Expand All @@ -102,7 +115,7 @@ You can use command line to configure the xiu server easily. You can specify to

##### Configure using command line

xiu -r 1935 -f 8080 -s 8081 -l info
xiu -r 1935 -t 5544 -f 8080 -s 8081 -l info


#### How to Configure the configuration file
Expand All @@ -128,6 +141,12 @@ You can use command line to configure the xiu server easily. You can specify to
address = "192.168.0.3"
port = 1935


##### RTSP
[rtsp]
enabled = false
port = 5544

##### HTTPFLV

[httpflv]
Expand Down Expand Up @@ -175,19 +194,33 @@ It contains the following 4 files:

##### Push

###### Push RTMP

You can use two ways:

- Use OBS to push a live rtmp stream
- Or use FFmpeg to push a rtmp stream:

ffmpeg -re -stream_loop -1 -i test.mp4 -c:a copy -c:v copy -f flv -flvflags no_duration_filesize rtmp://127.0.0.1:1935/live/test

###### Push RTSP

- Over TCP(Interleaved mode)

ffmpeg -re -stream_loop -1 -i test.mp4 -c:v copy -c:a copy -rtsp_transport tcp -f rtsp rtsp://127.0.0.1:5544/live/test

- Over UDP

ffmpeg -re -stream_loop -1 -i test.mp4 -c:v copy -c:a copy -f rtsp rtsp://127.0.0.1:5544/live/test


##### Play

Use ffplay to play the rtmp/httpflv/hls live stream:
Use ffplay to play the rtmp/rtsp/httpflv/hls live stream:

ffplay -i rtmp://localhost:1935/live/test
ffplay -i rtsp://127.0.0.1:5544/live/test
ffplay -rtsp_transport tcp -i rtsp://127.0.0.1:5544/live/test
ffplay -i http://localhost:8081/live/test.flv
ffplay -i http://localhost:8080/live/test/test.m3u8

Expand Down Expand Up @@ -267,6 +300,8 @@ Use the above methods to push live stream to service 1, when you play the stream
Open issues if you have any problems. Star and pull requests are welcomed. Your stars can make this project go faster and further.





## v0.5.0
- Support rtmp gop number configuration.
Expand All @@ -283,4 +318,7 @@ Open issues if you have any problems. Star and pull requests are welcomed. Your
- Fix error that cannot receive rtmp stream pushed from GStreamer.
- Fix rtmp cts parse error.
- Fix RTMP examples in README.
## v0.7.0
- Support RTSP.


2 changes: 1 addition & 1 deletion library/bytesio/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bytesio"
version = "0.2.0"
version = "0.3.0"
authors = ["HarlanC <wawacry@qq.com>"]
edition = "2018"
description = "a network io library using tokio."
Expand Down
4 changes: 3 additions & 1 deletion library/bytesio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ A network bytes io library.
## v0.1.27
Add functions.
## v0.2.0
Add bits reader and writer.
Add bits reader and writer.
## v0.3.0
Support Udp.
5 changes: 3 additions & 2 deletions library/codec/h264/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "h264-decoder"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
authors = ["HarlanC <wawacry@qq.com>"]
description = "a h264 decoder"
Expand All @@ -15,4 +15,5 @@ bytes = "1.0.0"
log = "0.4"
failure = "0.1.1"

bytesio = { path = "../../bytesio/" }
bytesio = "0.3.0"

2 changes: 2 additions & 0 deletions library/codec/h264/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ A h264 decoder library.

## v0.1.0
- Add sps parser.
## v0.2.0
- Reference bytesio v0.3.0.

6 changes: 3 additions & 3 deletions library/container/flv/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "xflv"
description = "flv library."
version = "0.2.1"
version = "0.3.0"
authors = ["HarlanC <wawacry@qq.com"]
repository = "https://github.com/harlanc/xiu"
license = "MIT"
Expand All @@ -16,6 +16,6 @@ bytes = "1.0.0"
failure = "0.1.1"
serde = { version = "1.0", features = ["derive", "rc"] }
log = "0.4"
bytesio = "0.3.0"
h264-decoder = "0.2.0"

bytesio = { path = "../../bytesio/" }
h264-decoder = { path = "../../codec/h264/" }
5 changes: 3 additions & 2 deletions library/container/flv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ A flv library.
## v0.1.0
- Fix #20, clean up the remaing PPS data.
- Fix the error chain.

## v0.2.0
- Read audio and video codec information.

## v0.2.1
- Fix rtmp cts parse error.
## v0.3.0
- Reference bytesio v0.3.0.
- Do some refactoring for rtsp2rtmp.
5 changes: 3 additions & 2 deletions library/container/mpegts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "xmpegts"
description = "mpegts library."
version = "0.1.1"
version = "0.2.0"
authors = ["HarlanC <wawacry@qq.com"]
repository = "https://github.com/harlanc/xiu"
license = "MIT"
Expand All @@ -14,4 +14,5 @@ edition = "2018"
byteorder = "1.4.2"
bytes = "1.0.0"
failure = "0.1.1"
bytesio = { path = "../../bytesio/" }

bytesio = "0.3.0"
3 changes: 3 additions & 0 deletions library/container/mpegts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ Remove no used dependences.
- Remove compile warnings.
## v0.1.1
- Refactor codes.
## v0.2.0
- Reference bytesio v0.3.0.



4 changes: 2 additions & 2 deletions library/streamhub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ serde_json = { version = "1", default-features = false, features = [
] }
serde = { version = "1.0", features = ["derive", "rc"] }

bytesio = { path = "../../library/bytesio/" }
xflv = { path = "../../library/container/flv/" }
xflv = "0.3.0"
bytesio = "0.3.0"

[dependencies.tokio]
version = "1.4.0"
Expand Down
4 changes: 4 additions & 0 deletions library/streamhub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The streamhub is used for xiu to communicate between publisher/subscirber.

## v0.1.0
The first version.
10 changes: 5 additions & 5 deletions protocol/hls/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "hls"
description = "hls library."
version = "0.2.1"
version = "0.3.0"
authors = ["HarlanC <wawacry@qq.com"]
repository = "https://github.com/harlanc/xiu"
license = "MIT"
Expand All @@ -18,10 +18,10 @@ log = "0.4"
hyper = { version = "0.14", features = ["full"] }
tokio-util = { version = "0.6.5", features = ["codec"] }

streamhub = { path = "../../library/streamhub/" }
xmpegts = { path = "../../library/container/mpegts/" }
xflv = { path = "../../library/container/flv/" }
rtmp = { path = "../rtmp/" }
streamhub = "0.1.0"
xflv = "0.3.0"
rtmp = "0.4.0"
xmpegts = "0.2.0"

[dependencies.tokio]
version = "1.4.0"
Expand Down
3 changes: 3 additions & 0 deletions protocol/hls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ Change the listening port type.
## v0.2.1
- Reference xflv new version v0.2.1.
- Reference rtmp new version v0.3.1.
## 0.3.0
- Do some refactoring.
- Reference bytesio v0.3.0.


8 changes: 4 additions & 4 deletions protocol/httpflv/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "httpflv"
description = "httpflv library."
version = "0.2.1"
version = "0.3.0"
authors = ["HarlanC <wawacry@qq.com"]
repository = "https://github.com/harlanc/xiu"
license = "MIT"
Expand All @@ -18,9 +18,9 @@ log = "0.4"
hyper = { version = "0.14", features = ["full"] }
futures = "0.3"

streamhub = { path = "../../library/streamhub/" }
xflv = { path = "../../library/container/flv/" }
rtmp = { path = "../rtmp/" } #"0.0.4"
streamhub = "0.1.0"
xflv = "0.3.0"
rtmp = "0.4.0"

[dependencies.tokio]
version = "1.4.0"
Expand Down
3 changes: 3 additions & 0 deletions protocol/httpflv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ A httpflv library.
## v0.2.1
- Reference xflv new version v0.2.1.
- Reference rtmp new version v0.3.1.
## v0.3.0
- Reference bytesio v0.3.0.
- Do some refactoring.

10 changes: 5 additions & 5 deletions protocol/rtmp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "rtmp"
description = "rtmp library."
version = "0.3.1"
version = "0.4.0"
authors = ["HarlanC <wawacry@qq.com"]
repository = "https://github.com/harlanc/xiu"
license = "MIT"
Expand Down Expand Up @@ -30,10 +30,10 @@ serde_json = { version = "1", default-features = false, features = [
] }
serde = { version = "1.0", features = ["derive", "rc"] }

bytesio = { path = "../../library/bytesio/" }
streamhub = { path = "../../library/streamhub/" }
h264-decoder = { path = "../../library/codec/h264/" }
xflv = { path = "../../library/container/flv/" }
streamhub = "0.1.0"
xflv = "0.3.0"
bytesio = "0.3.0"
h264-decoder = "0.2.0"

[dependencies.tokio]
version = "1.4.0"
Expand Down
Loading

0 comments on commit f97afa1

Please sign in to comment.