-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
82 lines (67 loc) · 2.14 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
include .env
export
##########################################
# Build
##########################################
# Build all compose services at once
build:
@echo "\n\033[42m=== Building server-base ===\033[0m"
@docker compose build server-base
@echo "\n\033[42m=== Building server-builder ===\033[0m"
@docker compose build server-builder
@echo "\n\033[42m=== Building server-dev ===\033[0m"
@docker compose build server-dev
@echo "\n\033[42m=== Building server ===\033[0m"
@docker compose build server
# Generate test sources
generate:
@mkdir -p sources
@echo "\n\033[42m=== Generating testsrc.mp4 (sourceA: color) ===\033[0m"
@docker compose run sourceA \
-f lavfi -i "sine=frequency=1000" \
-f lavfi -i "testsrc=size=1920x1080" -pix_fmt yuv420p \
-c:v libx264 -b:v 2M -maxrate 2M -bufsize 1M -g 60 \
-c:a aac -b:a 128k \
-t 600 sources/testsrc.mp4
@echo "\n\033[42m=== Generating testsrc2.mp4 (sourceB: black and white) ===\033[0m"
@docker compose run sourceB \
-f lavfi -i "sine=frequency=1000" \
-f lavfi -i "testsrc=size=1920x1080" -pix_fmt yuv420p -vf hue=s=0 \
-c:v libx264 -b:v 2M -maxrate 2M -bufsize 1M -g 60 \
-c:a aac -b:a 128k \
-t 600 sources/testsrc2.mp4
##########################################
# Run
##########################################
# Start the streaming server
rtsp:
@echo "\n\033[42m=== Starting the streaming server ===\033[0m"
@docker compose up -d rtsp
# Start the streaming sources and server
testsrc: rtsp
@echo "\n\033[42m=== Starting the streaming sources ===\033[0m"
@docker compose up -d rtsp sourceA sourceB
# Start obs-headless server
server:
@echo "\n\033[42m=== Starting obs-headless ===\033[0m"
@xhost +
@docker compose up server
# Start sources + server
up: testsrc server
# Stop and remove all containers
down:
@docker compose down --remove-orphans
# Start builder dev container
builder:
@xhost +
@docker compose run server-builder
# Start obs-headless server dev container
dev:
@xhost +
@docker compose run server-dev
# Start obs-headless client container
client:
@docker compose run client
# Play obs-headless server output stream
play:
@ffplay rtmp://localhost/live/key