diff --git a/.gitignore b/.gitignore index 6e098f8..5595dfd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +example/audio/* .*.sw* .res/.$* diff --git a/.res/info.txt b/.res/info.txt index 631453b..cc9dc3b 100644 --- a/.res/info.txt +++ b/.res/info.txt @@ -1,23 +1,35 @@ Useful URLs and exposed services with default configuration. # Liquidsoap container (liquidsoap-myradio) -http://127.0.0.1:6001/metrics # Liquidsoap Prometheus Metrics -http://127.0.0.1:7000/livesource # Liquidsoap HTTP API -srt://127.0.0.1:10000 # Liquidsoap SRT input port voieA_caller1 -srt://127.0.0.1:10001 # Liquidsoap SRT input port voieA_caller2 -srt://127.0.0.1:10002 # Liquidsoap SRT input port voieB_caller1 -srt://127.0.0.1:10003 # Liquidsoap SRT input port voieB_caller2 -srt://127.0.0.1:10004 # Liquidsoap SRT input port override_caller1 -srt://127.0.0.1:10005 # Liquidsoap SRT input port override_caller2 -srt://127.0.0.1:10006 # Liquidsoap SRT input port sat_sat1 +http://127.0.0.1:6001/metrics # Liquidsoap (myradio) Prometheus Metrics +http://127.0.0.1:7000/livesource # Liquidsoap (myradio) HTTP API +srt://127.0.0.1:10000 # Liquidsoap (myradio) SRT input port voieA_caller1 +srt://127.0.0.1:10001 # Liquidsoap (myradio) SRT input port voieA_caller2 +srt://127.0.0.1:10002 # Liquidsoap (myradio) SRT input port voieB_caller1 +srt://127.0.0.1:10003 # Liquidsoap (myradio) SRT input port voieB_caller2 +srt://127.0.0.1:10004 # Liquidsoap (myradio) SRT input port override_caller1 +srt://127.0.0.1:10005 # Liquidsoap (myradio) SRT input port override_caller2 +srt://127.0.0.1:10006 # Liquidsoap (myradio) SRT input port sat_sat1 + +# Liquidsoap container (liquidsoap-myradiosurround) +http://127.0.0.1:6011/metrics # Liquidsoap (myradiosurround) Prometheus Metrics +http://127.0.0.1:7010/livesource # Liquidsoap (myradiosurround) HTTP API +srt://127.0.0.1:10010 # Liquidsoap (myradiosurround) SRT input port voieA_caller1 +srt://127.0.0.1:10011 # Liquidsoap (myradiosurround) SRT input port voieA_caller2 +srt://127.0.0.1:10012 # Liquidsoap (myradiosurround) SRT input port voieB_caller1 +srt://127.0.0.1:10013 # Liquidsoap (myradiosurround) SRT input port voieB_caller2 +srt://127.0.0.1:10014 # Liquidsoap (myradiosurround) SRT input port override_caller1 +srt://127.0.0.1:10015 # Liquidsoap (myradiosurround) SRT input port override_caller2 +srt://127.0.0.1:10016 # Liquidsoap (myradiosurround) SRT input port sat_sat1 # Icecast2 -http://127.0.0.1:8000 # Icecast status and mountpoints -http://127.0.0.1:8000/myradio-hifi.aac # Icecast mountpoint (AAC hifi) -http://127.0.0.1:8000/myradio-midfi.aac # Icecast mountpoint (AAC midfi) -http://127.0.0.1:8000/myradio-lofi.aac # Icecast mountpoint (AAC lofi) -http://127.0.0.1:8000/myradio-midfi.mp3 # Icecast mountpoint (MP3 midfi) -http://127.0.0.1:8000/myradio-lofi.mp3 # Icecast mountpoint (MP3 lofi) +http://127.0.0.1:8000 # Icecast status and mountpoints +http://127.0.0.1:8000/myradio-hifi.aac # Icecast mountpoint (AAC hifi) +http://127.0.0.1:8000/myradio-midfi.aac # Icecast mountpoint (AAC midfi) +http://127.0.0.1:8000/myradio-lofi.aac # Icecast mountpoint (AAC lofi) +http://127.0.0.1:8000/myradio-midfi.mp3 # Icecast mountpoint (MP3 midfi) +http://127.0.0.1:8000/myradio-lofi.mp3 # Icecast mountpoint (MP3 lofi) +http://127.0.0.1:8000/myradiosurround-hifi.aac # Icecast mountpoint (AAC hifi surround) # NGINX (HLS, only AAC audio) http://127.0.0.1:8080 # Browse HLS files @@ -25,6 +37,7 @@ http://127.0.0.1:8080/myradio/myradio.m3u8 # HLS playlist http://127.0.0.1:8080/myradio/myradio_hifi.m3u8 # HLS playlist (enforce hifi) http://127.0.0.1:8080/myradio/myradio_midfi.m3u8 # HLS playlist (enforce midfi) http://127.0.0.1:8080/myradio/myradio_lofi.m3u8 # HLS playlist (enforce lofi) +http://127.0.0.1:8080/myradiosurround/myradiosurround_hifi.m3u8 # HLS playlist (enforce lofi) # Prometheus http://127.0.0.1:9090 # Prometheus web interface diff --git a/Makefile b/Makefile index 69bd864..175ad3e 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ test: ## Run test on the liquidsoap configuration reload: ## Update containers if needed and restart liquidsoap @docker compose up -d - @docker compose restart liquidsoap-test liquidsoap-myradio + @docker compose restart liquidsoap-test liquidsoap-myradio liquidsoap-myradiosurround @docker compose ps @docker compose logs -f diff --git a/docker-compose.yml b/docker-compose.yml index 22b18ae..09cd5a7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: - /conf/test.liq - /scripts/00-live.liq container_name: liquidsoap-test - image: savonet/liquidsoap:v2.2.1 + image: savonet/liquidsoap:rolling-release-v2.2.x networks: - default volumes: @@ -20,7 +20,7 @@ services: - /conf/myradio.liq - /scripts/00-live.liq container_name: liquidsoap-myradio - image: savonet/liquidsoap:v2.2.1 + image: savonet/liquidsoap:rolling-release-v2.2.x networks: - default restart: unless-stopped @@ -40,6 +40,31 @@ services: - data_hls:/tmp/ - data_liquidsoap:/state/ + liquidsoap-myradiosurround: + command: + - /conf/myradiosurround.liq + - /scripts/00-live.liq + container_name: liquidsoap-myradiosurround + image: savonet/liquidsoap:rolling-release-v2.2.x + networks: + - default + restart: unless-stopped + ports: + - 6011:6011/tcp + - 7010:7010/tcp + - 10010:10010/tcp + - 10011:10011/tcp + - 10012:10012/tcp + - 10013:10013/tcp + - 10014:10014/tcp + - 10015:10015/tcp + - 10016:10016/tcp + volumes: + - ./example/liquidsoap/:/conf/:ro + - ./scripts/:/scripts/:ro + - data_hls:/tmp/ + - data_liquidsoap:/state/ + # Feed liquidsoap with an example SRT source (https://modular-station.com/) source-voieA-caller1: command: @@ -56,7 +81,7 @@ services: - "srt://liquidsoap-myradio:10000" # voieA_caller1 container_name: source-voieA-caller1 entrypoint: [] - image: savonet/liquidsoap:v2.2.1 + image: savonet/liquidsoap:rolling-release-v2.2.x networks: - default restart: unless-stopped @@ -77,7 +102,7 @@ services: - "srt://liquidsoap-myradio:10002" # voieB_caller1 container_name: source-voieB-caller1 entrypoint: [] - image: savonet/liquidsoap:v2.2.1 + image: savonet/liquidsoap:rolling-release-v2.2.x networks: - default restart: unless-stopped @@ -98,10 +123,33 @@ services: - "srt://liquidsoap-myradio:10004" # override_caller1 container_name: source-override-caller1 entrypoint: [] - image: savonet/liquidsoap:v2.2.1 + image: savonet/liquidsoap:rolling-release-v2.2.x + networks: + - default + restart: unless-stopped + + # Feed liquidsoap with an example SRT source (https://modular-station.com/) + source-surround: + command: + - /usr/bin/ffmpeg + - -hide_banner + - -re + - -i + - /audio/CHANNEL_ORDER_TEST_MUSIC_MULTI_5.1_-23LUFS.wav + - -vn + - -f + - wav + - -codec:a + - pcm_s24le + - "srt://liquidsoap-myradiosurround:10010" # voieA_caller1 + container_name: source-surround + entrypoint: [] + image: savonet/liquidsoap:rolling-release-v2.2.x networks: - default restart: unless-stopped + volumes: + - ./example/audio/:/audio/:ro # Streaming services: icecast icecast: @@ -112,9 +160,10 @@ services: - ICECAST_PASSWORD=secret - ICECAST_RELAY_PASSWORD=secret - ICECAST_HOSTNAME=icecast + - ICECAST_MAX_SOURCES=10 expose: - 8000 - image: moul/icecast + image: libretime/icecast ports: - 8000:8000 diff --git a/example/liquidsoap/myradio.liq b/example/liquidsoap/myradio.liq index 698963b..a979158 100644 --- a/example/liquidsoap/myradio.liq +++ b/example/liquidsoap/myradio.liq @@ -1,11 +1,14 @@ radio_name = "myradio" -hls_segments_http_post_origin = "hostname" -hls_state_path = "/state/#{radio_name}.hlsstate" -livesource_state_path = "/state/#{radio_name}.livesourcestate" +# Radio settings +formats_picker = fun (formats) -> formats.stereo +aac_encoder = "aac" +harbor_http_port = 7000 +prometheus_server_port = 6001 +liquidsoap_log_level = 3 -hls_segments_directory = "/tmp/#{radio_name}" +# SRT inputs configuration input_list = [ {name="voieA_caller1", is_autofallback=true, port=10000}, {name="voieA_caller2", is_autofallback=true, port=10001}, @@ -15,17 +18,24 @@ input_list = [ {name="override_caller2", is_autofallback=false, port=10005}, {name="sat_sat1", is_autofallback=true, port=10006}, ] +livesource_state_path = "/state/#{radio_name}.livesourcestate" -aac_encoder = "aac" +# HLS output configuration +hls_segments_directory = "/tmp/#{radio_name}" +hls_segments_enable_todo_files = false +hls_state_path = "/state/#{radio_name}.hlsstate" +hls_segments_http_post_enable = false +hls_segments_http_post_origin = "hostname" +hls_segments_http_post_target = "http://segmentforwarder" hls_formats = [ "lofi", "midfi", "hifi" ] -enable_upload_hls_segments = false -hls_segments_http_post_target = "http://segmentforwarder" - -enable_hls_segments_todo_files = false +# ICECAST output configuration +icecast_host = "icecast" +icecast_port = 8000 +icecast_password = "secret" icecast_formats = [ ("aac", [ "lofi", "midfi", "hifi" @@ -34,10 +44,3 @@ icecast_formats = [ "lofi", "midfi" ]) ] - -prometheus_server_port = 6001 -harbor_http_port = 7000 -icecast_host = "icecast" -icecast_port = 8000 -icecast_password = "secret" -liquidsoap_log_level = 3 diff --git a/example/liquidsoap/myradiosurround.liq b/example/liquidsoap/myradiosurround.liq new file mode 100644 index 0000000..c49812e --- /dev/null +++ b/example/liquidsoap/myradiosurround.liq @@ -0,0 +1,41 @@ +radio_name = "myradiosurround" + +# Radio settings +formats_picker = fun (formats) -> formats.surround +aac_encoder = "aac" +harbor_http_port = 7010 +prometheus_server_port = 6011 +liquidsoap_log_level = 3 + + +# SRT inputs configuration +input_list = [ + {name="voieA_caller1", is_autofallback=true, port=10010}, + {name="voieA_caller2", is_autofallback=true, port=10011}, + {name="voieB_caller1", is_autofallback=true, port=10012}, + {name="voieB_caller2", is_autofallback=true, port=10013}, + {name="override_caller1", is_autofallback=false, port=10014}, + {name="override_caller2", is_autofallback=false, port=10015}, + {name="sat_sat1", is_autofallback=true, port=10016}, +] +livesource_state_path = "/state/#{radio_name}.livesourcestate" + + +# HLS output configuration +hls_segments_directory = "/tmp/#{radio_name}" +hls_segments_enable_todo_files = false +hls_state_path = "/state/#{radio_name}.hlsstate" +hls_segments_http_post_enable = false +hls_segments_http_post_origin = "hostname" +hls_segments_http_post_target = "http://segmentforwarder" +hls_formats = [ + "hifi" +] + +# ICECAST output configuration +icecast_host = "icecast" +icecast_port = 8000 +icecast_password = "secret" +icecast_formats = [ + ("aac", ["hifi"]) +] diff --git a/example/prometheus/prometheus.yml b/example/prometheus/prometheus.yml index d7124b1..99c6c70 100644 --- a/example/prometheus/prometheus.yml +++ b/example/prometheus/prometheus.yml @@ -14,7 +14,10 @@ scrape_configs: - job_name: 'liquidsoap' scrape_interval: 5s static_configs: - - targets: ['liquidsoap-myradio:6001'] + - targets: [ + 'liquidsoap-myradio:6001', + 'liquidsoap-myradiosurround:6001', + ] - job_name: 'prometheus' scrape_interval: 10s diff --git a/scripts/00-live.liq b/scripts/00-live.liq index 989bc2c..4bf0a97 100644 --- a/scripts/00-live.liq +++ b/scripts/00-live.liq @@ -3,8 +3,6 @@ %include "10-settings.liq" %include "20-prometheus.liq" %include "30-formats.liq" -%include "40-icecast.liq" -%include "50-hls.liq" %include "60-core.liq" ############################# @@ -155,14 +153,5 @@ thread.run( {set_metric_audio_lufs(radio_prod.lufs())} ) -radio_prod = ffmpeg.raw.encode.audio(%ffmpeg(%audio.raw), radio_prod) - -# Outputs - -# HLS Output -mk_hls_output(hls_formats, radio_prod) - -# Icecast Output -mk_icecast_outputs(icecast_formats, radio_prod) - +%include "80-outputs.liq" %include "90-http.liq" diff --git a/scripts/20-prometheus.liq b/scripts/20-prometheus.liq index 3216f4a..94e07e4 100644 --- a/scripts/20-prometheus.liq +++ b/scripts/20-prometheus.liq @@ -95,34 +95,6 @@ audit_lufs_metric_create = "liquidsoap_output_lufs_5s" ) -# "hlsssegment_sent" is an output-only metric counting the number of -# HLS segments sent for each status code. -# As we don't know all the status codes beforehand we use a assoc list -# (aka map or dict) named increase_hlssegment_metrics to map status -# code to time serie and create_hlsssegment_metric as a helper -# function to dynamically create the time serie if it is not already -# in the list. -# These metrics are updated at on_file_change hook of HLS output. -hlssegment_sent_create = - prometheus.counter( - labels=["radio","code"], - help="Number of HLS segment send to segment-forwarder","liquidsoap_hlssegment_sent" - ) - -increase_hlssegment_metrics = ref([]) -def create_hlssegment_metrics(code, increment) = - increase_metric = hlssegment_sent_create(label_values=[radio_name,"#{code}"]) - increase_hlssegment_metrics := list.add((code, increase_metric), increase_hlssegment_metrics()) - increase_metric(increment) -end -def increase_hlssegment_sent_metric(code, increment) = - def default(increment) = - create_hlssegment_metrics(code, increment) - end - increase_metric = list.assoc(default=default, code, increase_hlssegment_metrics()) - increase_metric(increment) -end - # SRT metrics per source (input queues and buffers) # SRT sourceA (network) -> input.srt -> buffered_input ---------> radio_live # ^ ^ diff --git a/scripts/30-formats.liq b/scripts/30-formats.liq index c97e56c..29e7d83 100644 --- a/scripts/30-formats.liq +++ b/scripts/30-formats.liq @@ -1,6 +1,12 @@ let formats = { - icecast = (), - hls = () + surround = { + icecast = (), + hls = () + }, + stereo = { + icecast = (), + hls = () + } } %include "formats/hls-aac.liq" @@ -8,3 +14,5 @@ let formats = { %include "formats/icecast-aac.liq" %include "formats/icecast-libfdk-aac.liq" %include "formats/icecast-mp3.liq" + +formats = formats_picker(formats) diff --git a/scripts/80-outputs.liq b/scripts/80-outputs.liq new file mode 100644 index 0000000..ed7211b --- /dev/null +++ b/scripts/80-outputs.liq @@ -0,0 +1,13 @@ +# Outputs + +# HLS Output +if hls_formats != [] then + %include "outputs/hls.liq" + mk_hls_output(hls_formats, radio_prod) +end + +# Icecast Output +if icecast_formats != [] then + %include "outputs/icecast.liq" + mk_icecast_outputs(icecast_formats, radio_prod) +end diff --git a/scripts/formats/hls-aac.liq b/scripts/formats/hls-aac.liq index 9677955..58f753b 100644 --- a/scripts/formats/hls-aac.liq +++ b/scripts/formats/hls-aac.liq @@ -1,8 +1,8 @@ -let formats.hls.aac = [ +let formats.stereo.hls.aac = [ ("lofi", %ffmpeg( format="mpegts", - %audio.raw( + %audio( codec="aac", channels=2, b="32k", @@ -13,7 +13,7 @@ let formats.hls.aac = [ ("midfi", %ffmpeg( format="mpegts", - %audio.raw( + %audio( codec="aac", channels=2, b="96k", @@ -24,7 +24,7 @@ let formats.hls.aac = [ ("hifi", %ffmpeg( format="mpegts", - %audio.raw( + %audio( codec="aac", channels=2, b="192k", @@ -33,3 +33,17 @@ let formats.hls.aac = [ )) ) ] + +let formats.surround.hls.aac = [ + ("hifi", + %ffmpeg( + format="mpegts", + %audio( + codec="aac", + channel_layout=5.1, + b="192k", + samplerate=48000, + profile="aac_low" + )) + ) +] diff --git a/scripts/formats/hls-libfdk-aac.liq b/scripts/formats/hls-libfdk-aac.liq index 0db57ed..b1c648e 100644 --- a/scripts/formats/hls-libfdk-aac.liq +++ b/scripts/formats/hls-libfdk-aac.liq @@ -1,8 +1,8 @@ -let formats.hls.fdkaac = [ +let formats.stereo.hls.fdkaac = [ ("lofi", %ffmpeg( format="mpegts", - %audio.raw( + %audio( codec="libfdk_aac", channels=2, b="32k", @@ -14,7 +14,7 @@ let formats.hls.fdkaac = [ ("midfi", %ffmpeg( format="mpegts", - %audio.raw( + %audio( codec="libfdk_aac", channels=2, b="96k", @@ -26,7 +26,7 @@ let formats.hls.fdkaac = [ ("hifi", %ffmpeg( format="mpegts", - %audio.raw( + %audio( codec="libfdk_aac", channels=2, b="192k", @@ -36,3 +36,18 @@ let formats.hls.fdkaac = [ )) ) ] + +let formats.surround.hls.fdkaac = [ + ("hifi", + %ffmpeg( + format="mpegts", + %audio( + codec="libfdk_aac", + channel_layout=5.1, + b="192k", + samplerate=48000, + afterburner=1, + profile="aac_low" + )) + ) +] diff --git a/scripts/formats/icecast-aac.liq b/scripts/formats/icecast-aac.liq index bf096b8..d1d17b9 100644 --- a/scripts/formats/icecast-aac.liq +++ b/scripts/formats/icecast-aac.liq @@ -1,9 +1,9 @@ -let formats.icecast.aac = { +let formats.stereo.icecast.aac = { sub_formats = [ ("lofi", %ffmpeg( format="adts", - %audio.raw( + %audio( codec="aac", channels=2, b="32k", @@ -14,7 +14,7 @@ let formats.icecast.aac = { ("midfi", %ffmpeg( format="adts", - %audio.raw( + %audio( codec="aac", channels=2, b="96k", @@ -25,13 +25,30 @@ let formats.icecast.aac = { ("hifi", %ffmpeg( format="adts", - %audio.raw( + %audio( codec="aac", channels=2, b="192k", samplerate=48000, profile="aac_low" )) + ), + ], + file_extension = ".aac" +} + +let formats.surround.icecast.aac = { + sub_formats = [ + ("hifi", + %ffmpeg( + format="adts", + %audio( + codec="aac", + channel_layout=5.1, + b="192k", + samplerate=48000, + profile="aac_low" + )) ) ], file_extension = ".aac" diff --git a/scripts/formats/icecast-libfdk-aac.liq b/scripts/formats/icecast-libfdk-aac.liq index a9a39d9..da81489 100644 --- a/scripts/formats/icecast-libfdk-aac.liq +++ b/scripts/formats/icecast-libfdk-aac.liq @@ -1,9 +1,9 @@ -let formats.icecast.fdkaac = { +let formats.stereo.icecast.fdkaac = { sub_formats = [ ("lofi", %ffmpeg( format="adts", - %audio.raw( + %audio( codec="libfdk_aac", channels=2, b="32k", @@ -16,7 +16,7 @@ let formats.icecast.fdkaac = { ("midfi", %ffmpeg( format="adts", - %audio.raw( + %audio( codec="libfdk_aac", channels=2, b="96k", @@ -29,7 +29,7 @@ let formats.icecast.fdkaac = { ("hifi", %ffmpeg( format="adts", - %audio.raw( + %audio( codec="libfdk_aac", channels=2, b="192k", @@ -38,6 +38,25 @@ let formats.icecast.fdkaac = { eld_sbr=0, profile="aac_low" )) + ), + ], + file_extension = ".aac" +} + +let formats.surround.icecast.fdkaac = { + sub_formats = [ + ("hifi", + %ffmpeg( + format="adts", + %audio( + codec="libfdk_aac", + channel_layout=5.1, + b="192k", + samplerate=48000, + afterburner=1, + eld_sbr=0, + profile="aac_low" + )) ) ], file_extension = ".aac" diff --git a/scripts/formats/icecast-mp3.liq b/scripts/formats/icecast-mp3.liq index 86c89e2..ef3476a 100644 --- a/scripts/formats/icecast-mp3.liq +++ b/scripts/formats/icecast-mp3.liq @@ -1,12 +1,12 @@ -let formats.icecast.mp3 = { +let formats.stereo.icecast.mp3 = { sub_formats = [ ("lofi", %ffmpeg( format="mp3", id3v2_version=0, - %audio.raw( + %audio( codec="libmp3lame", - channels=1, + channels=2, b="32k", samplerate=48000, compression_level=2 @@ -16,7 +16,7 @@ let formats.icecast.mp3 = { %ffmpeg( format="mp3", id3v2_version=0, - %audio.raw( + %audio( codec="libmp3lame", channels=2, b="128k", @@ -27,3 +27,8 @@ let formats.icecast.mp3 = { ], file_extension = ".mp3" } + +let formats.surround.icecast.mp3 = { + sub_formats = [], + file_extension = ".mp3" +} diff --git a/scripts/50-hls.liq b/scripts/outputs/hls.liq similarity index 65% rename from scripts/50-hls.liq rename to scripts/outputs/hls.liq index b8490db..b3d1614 100644 --- a/scripts/50-hls.liq +++ b/scripts/outputs/hls.liq @@ -1,3 +1,4 @@ +# HLS output available_hls_formats = if aac_encoder == "libfdkaac" then @@ -6,6 +7,38 @@ available_hls_formats = formats.hls.aac end +## Prometheus metrics + +# "hlsssegment_sent" is an output-only metric counting the number of +# HLS segments sent for each status code. +# As we don't know all the status codes beforehand we use a assoc list +# (aka map or dict) named increase_hlssegment_metrics to map status +# code to time serie and create_hlsssegment_metric as a helper +# function to dynamically create the time serie if it is not already +# in the list. +# These metrics are updated at on_file_change hook of HLS output. +hlssegment_sent_create = + prometheus.counter( + labels=["radio","code"], + help="Number of HLS segment send to segment-forwarder","liquidsoap_hlssegment_sent" + ) + +increase_hlssegment_metrics = ref([]) +def create_hlssegment_metrics(code, increment) = + increase_metric = hlssegment_sent_create(label_values=[radio_name,"#{code}"]) + increase_hlssegment_metrics := list.add((code, increase_metric), increase_hlssegment_metrics()) + increase_metric(increment) +end +def increase_hlssegment_sent_metric(code, increment) = + def default(increment) = + create_hlssegment_metrics(code, increment) + end + increase_metric = list.assoc(default=default, code, increase_hlssegment_metrics()) + increase_metric(increment) +end + +## HLS segments + def segment_name(~position,~extname=_,stream_name) = segment_timestamp = int_of_float(time()) duration = int_of_float(4.0) @@ -44,10 +77,10 @@ def on_file_change(~state,fname) = '{"timestamp": "#{time()}", "file": "#{fname}"}') end end - if enable_upload_hls_segments then + if hls_segments_http_post_enable then thread.run(fast=false,upload_segment(hls_segments_http_post_target)) end - if enable_hls_segments_todo_files then + if hls_segments_enable_todo_files then thread.run(fast=false,segment_todo_file()) end end diff --git a/scripts/40-icecast.liq b/scripts/outputs/icecast.liq similarity index 98% rename from scripts/40-icecast.liq rename to scripts/outputs/icecast.liq index 26f560e..d85b499 100644 --- a/scripts/40-icecast.liq +++ b/scripts/outputs/icecast.liq @@ -1,3 +1,4 @@ +# Icecast output icecast_aac_encoder = if aac_encoder == "libfdkaac" then formats.icecast.fdkaac diff --git a/tests/liquidsoap/test.liq b/tests/liquidsoap/test.liq index e1f75d8..4e38f2d 100644 --- a/tests/liquidsoap/test.liq +++ b/tests/liquidsoap/test.liq @@ -16,23 +16,18 @@ input_list = [ {name="sat_sat1", is_autofallback=true, port=10006}, ] +formats_picker = fun (formats) -> formats.surround + aac_encoder = "aac" -hls_formats = [ - "lofi", "midfi", "hifi" -] +hls_formats = ["hifi"] enable_upload_hls_segments = false hls_segments_http_post_target = "http://segmentforwarder" enable_hls_segments_todo_files = false icecast_formats = [ - ("aac", [ - "lofi", "midfi", "hifi" - ]), - ("mp3", [ - "lofi", "midfi" - ]) + ("aac", ["hifi"]) ] prometheus_server_port = 6001