mirror of
https://github.com/flavioribeiro/donut.git
synced 2025-09-26 19:11:11 +08:00
update readme to reflect current implementation
This commit is contained in:
BIN
.github/docker-compose-donut-setup.webp
vendored
BIN
.github/docker-compose-donut-setup.webp
vendored
Binary file not shown.
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 41 KiB |
@@ -1,17 +1,17 @@
|
||||
# Developing using docker
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
```bash
|
||||
make run-docker-dev
|
||||
```
|
||||
|
||||
Inside the container, you can start the donut server.
|
||||
While you're inside the container, you can start/stop/restart the donut server.
|
||||
|
||||
```bash
|
||||
make run-server-inside-docker
|
||||
```
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Running on MacOS
|
||||
|
||||
To develop using your mac, make sure you have `ffmpeg@5` installed:
|
||||
To run Donut locally using MacOS, make sure you have `ffmpeg@5` installed:
|
||||
|
||||
```bash
|
||||
brew install ffmpeg@5
|
||||
@@ -20,7 +20,7 @@ sudo find /opt/homebrew -name avcodec.h
|
||||
/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/include/libavcodec/avcodec.h
|
||||
```
|
||||
|
||||
You must configure the CGO library path pointing it to the ffmpeg 5 folder.
|
||||
You must configure the CGO library path pointing it to ffmpeg 5 (`5.1.4_6`) folder not the newest (`7.0_1`).
|
||||
|
||||
```bash
|
||||
export CGO_LDFLAGS="-L/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/lib/"
|
||||
@@ -28,9 +28,23 @@ export CGO_CFLAGS="-I/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/include/"
|
||||
export PKG_CONFIG_PATH="/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/lib/pkgconfig"
|
||||
```
|
||||
|
||||
Now, you can run it locally:
|
||||
After you set the proper cgo paths, you can run it locally:
|
||||
|
||||
```bash
|
||||
go run main.go -- --enable-ice-mux=true
|
||||
go test -v ./...
|
||||
```
|
||||
|
||||
# Simulating SRT and RTMP live streaming
|
||||
|
||||
You can use docker to simulate `SRT` and `RTMP` streaming:
|
||||
|
||||
```bash
|
||||
# docker compose stop && docker compose down && docker compose up nginx_rtmp haivision_srt
|
||||
make run-srt-rtmp-streaming-alone
|
||||
```
|
||||
|
||||
They're both now exposed `RTMP/1935` and `SRT/40052` in your `localhost`. You can use VLC to test both streams:
|
||||
|
||||
* vlc rtmp://localhost/live/app
|
||||
* vlc srt://localhost:40052
|
3
Makefile
3
Makefile
@@ -16,5 +16,8 @@ run-docker-dev:
|
||||
run-server-inside-docker:
|
||||
go run main.go -- --enable-ice-mux=true
|
||||
|
||||
run-srt-rtmp-streaming-alone:
|
||||
docker compose stop && docker compose down && docker compose up nginx_rtmp haivision_srt
|
||||
|
||||
lint:
|
||||
docker compose stop lint && docker compose down lint && docker compose run --rm lint
|
||||
|
45
README.md
45
README.md
@@ -1,28 +1,53 @@
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/244265/200068510-7c24d5c7-6ba0-44ee-8e60-0f157f990b90.png" width="350" />
|
||||
|
||||
donut is a zero setup required SRT+MPEG-TS -> WebRTC Bridge powered by [Pion](http://pion.ly/).
|
||||
donut is a zero setup required SRT+MPEG-TS and RTMP -> WebRTC Bridge powered by [Pion](http://pion.ly/).
|
||||
|
||||
### Install & Run Locally
|
||||
|
||||
Make sure you have the `libsrt` installed in your system. If not, follow their [build instructions](https://github.com/Haivision/srt#build-instructions).
|
||||
Once you finish installing it, execute:
|
||||
Make sure you have the `ffmpeg 5.x.x` (with SRT) installed in your system.
|
||||
|
||||
You can have multiple versions of ffmpeg installed in your system. To find where the specific `ffmpeg 5.x.x` was installed, run:
|
||||
|
||||
```bash
|
||||
sudo find /opt/homebrew -name avcodec.h
|
||||
```
|
||||
|
||||
Let's assume the prior command showed two entries:
|
||||
|
||||
```bash
|
||||
sudo find /opt/homebrew -name avcodec.h
|
||||
/opt/homebrew/Cellar/ffmpeg/7.0_1/include/libavcodec/avcodec.h
|
||||
/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/include/libavcodec/avcodec.h
|
||||
```
|
||||
|
||||
You must configure the CGO library path pointing it to **ffmpeg 5** (`5.1.4_6`) folder instead of the newest (`7.0_1`).
|
||||
|
||||
```bash
|
||||
export CGO_LDFLAGS="-L/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/lib/"
|
||||
export CGO_CFLAGS="-I/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/include/"
|
||||
export PKG_CONFIG_PATH="/opt/homebrew/Cellar/ffmpeg@5/5.1.4_6/lib/pkgconfig"
|
||||
```
|
||||
|
||||
Once you finish installing, and setting it up, execute:
|
||||
|
||||
```bash
|
||||
|
||||
go install github.com/flavioribeiro/donut@latest
|
||||
|
||||
```
|
||||
$ go install github.com/flavioribeiro/donut@latest
|
||||
```
|
||||
|
||||
Once installed, execute `donut`. This will be in your `$GOPATH/bin`. The default will be `~/go/bin/donut`
|
||||
|
||||
Here are specific instructions [to run on MacOS](/MAC_DEVELOPMENT.md).
|
||||
|
||||
### Run using docker-compose
|
||||
|
||||
Alternatively, you can use `docker-compose` to simulate an SRT live transmission and run the donut effortless.
|
||||
Alternatively, you can use `docker-compose` to simulate an [SRT live transmission and run the donut effortless](/DOCKER_DEVELOPMENT.md).
|
||||
|
||||
```
|
||||
$ make run
|
||||
```
|
||||
|
||||
#### Open the Web UI
|
||||
Open [http://localhost:8080](http://localhost:8080). You will see three text boxes. Fill in with the SRT listener configuration and hit connect.
|
||||
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.
|
||||
|
||||

|
||||
|
||||
|
Reference in New Issue
Block a user