-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.liq
62 lines (46 loc) · 1.41 KB
/
script.liq
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
%include "http.liq"
%include "segments.liq"
%include "files.liq"
set("init.allow_root", true)
set("protocol.aws.endpoint", "{{ S3_ENDPOINT }}")
set("harbor.bind_addrs", ["0.0.0.0"])
# Input Icecast stream
live = input.harbor("{{ ICECAST_PATH }}live",
port={{ ICECAST_PORT }},
user="{{ ICECAST_USERNAME }}",
password="{{ ICECAST_PASSWORD }}",
replay_metadata=true,
)
# Metadata server
live = http_serve_metadata(live, "{{ HTTP_PATH }}live.json", {{ HTTP_PORT }});
# Output formats
aac_lofi = %ffmpeg(format="mpegts", codec="aac", channels=2, ar=44100)
aac_midfi = %ffmpeg(format="mpegts", codec="aac", channels=2, ar=44100, b="96k")
aac_hifi = %ffmpeg(format="mpegts", codec="aac", channels=2, ar=44100, b="192k")
streams_info = [
("aac_lofi", (40000, "mp4a.40.29", "ts")),
("aac_midfi", (110000, "mp4a.40.2", "ts")),
("aac_hifi", (220000, "mp4a.40.2", "ts")),
]
streams = [
("aac_lofi", aac_lofi),
("aac_midfi", aac_midfi),
("aac_hifi", aac_hifi),
]
# Output HLS stream
output.harbor.hls(
playlist="live.m3u8",
port={{ HLS_PORT }},
path="{{ HLS_PATH }}",
fallible=true,
segments={{ HLS_SEGMENTS_COUNT }},
segments_overhead={{ HLS_SEGMENTS_OVERHEAD }},
segment_duration={{ HLS_SEGMENTS_DURATION }},
segment_name=hls_segment_name,
persist=true,
persist_at="/var/liquidsoap/hls.config",
on_file_change=on_hls_file_change,
streams_info=streams_info,
streams,
live,
)