add option to run locally

This commit is contained in:
Leandro Moreira
2024-02-11 23:47:08 -03:00
parent 3aeb4fa250
commit dfedeee4e0
5 changed files with 33 additions and 17 deletions

View File

@@ -6,6 +6,12 @@ test:
# docker compose stop test && docker compose down test && docker compose build test && docker compose run --rm test # docker compose stop test && docker compose down test && docker compose build test && docker compose run --rm test
docker compose stop test && docker compose down test && docker compose run --rm test docker compose stop test && docker compose down test && docker compose run --rm test
run-srt:
docker compose stop && docker compose down && docker compose build && docker compose up srt
mac-run-local:
./scripts/mac_local_run.sh
mac-test-local: mac-test-local:
./scripts/mac_local_run_test.sh ./scripts/mac_local_run_test.sh

View File

@@ -12,6 +12,10 @@ services:
- "8081:8081" - "8081:8081"
- "8081:8081/udp" - "8081:8081/udp"
- "6060:6060" - "6060:6060"
depends_on:
- srt
links:
- srt
test: test:
build: build:
@@ -47,9 +51,9 @@ services:
ports: ports:
- "40052:40052/udp" - "40052:40052/udp"
depends_on: depends_on:
- app - origin
links: links:
- app - origin
origin: # simulating an mpeg-ts upd origin live transmission origin: # simulating an mpeg-ts upd origin live transmission
image: jrottenberg/ffmpeg:4.4-alpine image: jrottenberg/ffmpeg:4.4-alpine
@@ -61,8 +65,4 @@ services:
- SRT_INPUT_HOST=srt - SRT_INPUT_HOST=srt
- SRT_INPUT_PORT=1234 - SRT_INPUT_PORT=1234
- PKT_SIZE=1316 - PKT_SIZE=1316
depends_on:
- srt
links:
- srt

12
scripts/mac_check_deps.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
if ! brew list srt &>/dev/null; then
echo "ERROR you must install srt"
echo "brew install srt"
exit 1
fi
if ! brew list ffmpeg &>/dev/null; then
echo "ERROR you must install ffmpeg"
echo "brew install ffmpeg"
exit 1
fi

7
scripts/mac_local_run.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
source ./scripts/mac_check_deps.sh
export CGO_LDFLAGS="-L$(brew --prefix srt)/lib -lsrt"
export CGO_CFLAGS="-I$(brew --prefix srt)/include/"
go run main.go

View File

@@ -1,14 +1,5 @@
if ! brew list srt &>/dev/null; then #!/bin/bash
echo "ERROR you must install srt" source ./scripts/mac_check_deps.sh
echo "brew install srt"
exit 1
fi
if ! brew list ffmpeg &>/dev/null; then
echo "ERROR you must install ffmpeg"
echo "brew install ffmpeg"
exit 1
fi
export CGO_LDFLAGS="-L$(brew --prefix srt)/lib -lsrt" export CGO_LDFLAGS="-L$(brew --prefix srt)/lib -lsrt"
export CGO_CFLAGS="-I$(brew --prefix srt)/include/" export CGO_CFLAGS="-I$(brew --prefix srt)/include/"