Skip to content

Commit 535da65

Browse files
committedJun 2, 2024
update readme to reflect current implementation
1 parent c445c13 commit 535da65

5 files changed

+58
-16
lines changed
 
8.34 KB
Binary file not shown.

‎DOCKER_DEVELOPMENT.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Developing using docker
22

3-
To develop using docker, make sure you have `docker` installed. Run the following command to start simulations of SRT and RTMP streamings, and a bash session where you can run commands such as you'd in your local machine.
3+
To run/test/develop using docker, make sure you have `docker` installed. Run the following command to start simulations of SRT and RTMP streamings, and **a bash session where you can run commands** such as you'd in your local machine.
44

55
```bash
66
make run-docker-dev
77
```
88

9-
Inside the container, you can start the donut server.
9+
While you're inside the container, you can start/stop/restart the donut server.
1010

1111
```bash
1212
make run-server-inside-docker
1313
```
1414

15-
You can access [http://localhost:8080/demo/](http://localhost:8080/demo/), using preferable the Chrome browser. You can connect to the simulated SRT and see donut working in practice.
15+
You can access [http://localhost:8080/demo/](http://localhost:8080/demo/), using preferable **the Chrome browser**. You can connect to the simulated SRT and see donut working in practice.
1616

17-
You can work and change files locally, in your OS, and restart `CTRL+C + make run-server-inside-docker` the donut server in the container. It's fast because it avoids rebuilding all images. It'll offer a faster feedback cycle while developing.
17+
You can work and change files locally, on your OS, and restart `CTRL+C + make run-server-inside-docker` the donut server in the container. It's fast since it avoids rebuilding all images. It'll offer a faster feedback cycle while developing.

‎MAC_DEVELOPMENT.md

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Running on MacOS
22

3-
To develop using your mac, make sure you have `ffmpeg@5` installed:
3+
To run Donut locally using MacOS, make sure you have `ffmpeg@5` installed:
44

55
```bash
66
brew install ffmpeg@5
@@ -20,17 +20,31 @@ sudo find /opt/homebrew -name avcodec.h
2020
/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/include/libavcodec/avcodec.h
2121
```
2222

23-
You must configure the CGO library path pointing it to the ffmpeg 5 folder.
23+
You must configure the CGO library path pointing it to ffmpeg 5 (`5.1.4_6`) folder not the newest (`7.0_1`).
2424

2525
```bash
2626
export CGO_LDFLAGS="-L/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/lib/"
2727
export CGO_CFLAGS="-I/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/include/"
2828
export PKG_CONFIG_PATH="/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/lib/pkgconfig"
2929
```
3030

31-
Now, you can run it locally:
31+
After you set the proper cgo paths, you can run it locally:
3232

3333
```bash
3434
go run main.go -- --enable-ice-mux=true
3535
go test -v ./...
3636
```
37+
38+
# Simulating SRT and RTMP live streaming
39+
40+
You can use docker to simulate `SRT` and `RTMP` streaming:
41+
42+
```bash
43+
# docker compose stop && docker compose down && docker compose up nginx_rtmp haivision_srt
44+
make run-srt-rtmp-streaming-alone
45+
```
46+
47+
They're both now exposed `RTMP/1935` and `SRT/40052` in your `localhost`. You can use VLC to test both streams:
48+
49+
* vlc rtmp://localhost/live/app
50+
* vlc srt://localhost:40052

‎Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@ run-docker-dev:
1616
run-server-inside-docker:
1717
go run main.go -- --enable-ice-mux=true
1818

19+
run-srt-rtmp-streaming-alone:
20+
docker compose stop && docker compose down && docker compose up nginx_rtmp haivision_srt
21+
1922
lint:
2023
docker compose stop lint && docker compose down lint && docker compose run --rm lint

‎README.md

+34-9
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,53 @@
11

22
<img src="https://user-images.githubusercontent.com/244265/200068510-7c24d5c7-6ba0-44ee-8e60-0f157f990b90.png" width="350" />
33

4-
donut is a zero setup required SRT+MPEG-TS -> WebRTC Bridge powered by [Pion](http://pion.ly/).
4+
donut is a zero setup required SRT+MPEG-TS and RTMP -> WebRTC Bridge powered by [Pion](http://pion.ly/).
55

66
### Install & Run Locally
77

8-
Make sure you have the `libsrt` installed in your system. If not, follow their [build instructions](https://github.com/Haivision/srt#build-instructions).
9-
Once you finish installing it, execute:
8+
Make sure you have the `ffmpeg 5.x.x` (with SRT) installed in your system.
109

10+
You can have multiple versions of ffmpeg installed in your system. To find where the specific `ffmpeg 5.x.x` was installed, run:
11+
12+
```bash
13+
sudo find /opt/homebrew -name avcodec.h
14+
```
15+
16+
Let's assume the prior command showed two entries:
17+
18+
```bash
19+
sudo find /opt/homebrew -name avcodec.h
20+
/opt/homebrew/Cellar/ffmpeg/7.0_1/include/libavcodec/avcodec.h
21+
/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/include/libavcodec/avcodec.h
1122
```
12-
$ go install github.com/flavioribeiro/donut@latest
23+
24+
You must configure the CGO library path pointing it to **ffmpeg 5** (`5.1.4_6`) folder instead of the newest (`7.0_1`).
25+
26+
```bash
27+
export CGO_LDFLAGS="-L/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/lib/"
28+
export CGO_CFLAGS="-I/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/include/"
29+
export PKG_CONFIG_PATH="/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/lib/pkgconfig"
1330
```
31+
32+
Once you finish installing, and setting it up, execute:
33+
34+
```bash
35+
36+
go install github.com/flavioribeiro/donut@latest
37+
38+
```
39+
1440
Once installed, execute `donut`. This will be in your `$GOPATH/bin`. The default will be `~/go/bin/donut`
1541

42+
Here are specific instructions [to run on MacOS](/MAC_DEVELOPMENT.md).
43+
1644
### Run using docker-compose
1745

18-
Alternatively, you can use `docker-compose` to simulate an SRT live transmission and run the donut effortless.
46+
Alternatively, you can use `docker-compose` to simulate an [SRT live transmission and run the donut effortless](/DOCKER_DEVELOPMENT.md).
1947

20-
```
21-
$ make run
22-
```
2348

2449
#### Open the Web UI
25-
Open [http://localhost:8080](http://localhost:8080). You will see three text boxes. Fill in with the SRT listener configuration and hit connect.
50+
Open [http://localhost:8080/demo](http://localhost:8080/demo). You will see two text fields. Fill them with the your streaming info and hit connect.
2651

2752
![donut docker-compose setup](/.github/docker-compose-donut-setup.webp "donut docker-compose setup")
2853

0 commit comments

Comments
 (0)
Please sign in to comment.