feat(playout): enable vorbis metadata per icecast output
Use new jinja template system to tweak the streams per output.
This commit is contained in:
parent
00b5c08647
commit
a71606d39c
|
@ -2,7 +2,6 @@ from pathlib import Path
|
||||||
from typing import Optional, Tuple
|
from typing import Optional, Tuple
|
||||||
|
|
||||||
from jinja2 import Environment, PackageLoader
|
from jinja2 import Environment, PackageLoader
|
||||||
from libretime_shared.config import AudioFormat
|
|
||||||
|
|
||||||
from ..config import Config
|
from ..config import Config
|
||||||
from .models import Info, StreamPreferences
|
from .models import Info, StreamPreferences
|
||||||
|
@ -33,23 +32,13 @@ def generate_entrypoint(
|
||||||
if log_filepath is not None:
|
if log_filepath is not None:
|
||||||
paths["log_filepath"] = log_filepath.resolve()
|
paths["log_filepath"] = log_filepath.resolve()
|
||||||
|
|
||||||
config = config.copy()
|
|
||||||
|
|
||||||
# Global icecast_vorbis_metadata until it is
|
|
||||||
# handled per output
|
|
||||||
icecast_vorbis_metadata = any(
|
|
||||||
o.enabled and o.audio.format == AudioFormat.OGG and o.audio.enable_metadata # type: ignore
|
|
||||||
for o in config.stream.outputs.icecast
|
|
||||||
)
|
|
||||||
|
|
||||||
entrypoint_filepath.write_text(
|
entrypoint_filepath.write_text(
|
||||||
templates.get_template("entrypoint.liq.j2").render(
|
templates.get_template("entrypoint.liq.j2").render(
|
||||||
config=config,
|
config=config.copy(),
|
||||||
preferences=preferences,
|
preferences=preferences,
|
||||||
info=info,
|
info=info,
|
||||||
paths=paths,
|
paths=paths,
|
||||||
version=version,
|
version=version,
|
||||||
icecast_vorbis_metadata=icecast_vorbis_metadata,
|
|
||||||
),
|
),
|
||||||
encoding="utf-8",
|
encoding="utf-8",
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,9 +8,6 @@ input_main_port = {{ config.stream.inputs.main.port }}
|
||||||
input_show_mount = {{ config.stream.inputs.show.mount | quote }}
|
input_show_mount = {{ config.stream.inputs.show.mount | quote }}
|
||||||
input_show_port = {{ config.stream.inputs.show.port }}
|
input_show_port = {{ config.stream.inputs.show.port }}
|
||||||
|
|
||||||
# Outputs
|
|
||||||
icecast_vorbis_metadata = {{ icecast_vorbis_metadata | lower }}
|
|
||||||
|
|
||||||
# Settings
|
# Settings
|
||||||
auth_path = {{ paths.auth_filepath | quote }}
|
auth_path = {{ paths.auth_filepath | quote }}
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,12 @@ output_icecast_{{ output_id }}_source = s
|
||||||
output_icecast_{{ output_id }}_source = mean(s)
|
output_icecast_{{ output_id }}_source = mean(s)
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
|
{#- Add per output stream modifications. -#}
|
||||||
|
{% if output.audio.format == "ogg" and not output.audio.enable_metadata -%}
|
||||||
|
# Disable ogg metadata
|
||||||
|
output_icecast_{{ output_id }}_source = add(normalize=false, [amplify(0.00001, noise()), output_icecast_{{ output_id }}_source])
|
||||||
|
{% endif -%}
|
||||||
|
|
||||||
output.icecast(
|
output.icecast(
|
||||||
id="icecast:{{ output_id }}",
|
id="icecast:{{ output_id }}",
|
||||||
host={{ output.host | quote }},
|
host={{ output.host | quote }},
|
||||||
|
|
|
@ -11,9 +11,6 @@
|
||||||
input_show_mount = "show"
|
input_show_mount = "show"
|
||||||
input_show_port = 8002
|
input_show_port = 8002
|
||||||
|
|
||||||
# Outputs
|
|
||||||
icecast_vorbis_metadata = false
|
|
||||||
|
|
||||||
# Settings
|
# Settings
|
||||||
auth_path = "/fake/liquidsoap_auth.py"
|
auth_path = "/fake/liquidsoap_auth.py"
|
||||||
|
|
||||||
|
@ -51,9 +48,6 @@
|
||||||
input_show_mount = "show"
|
input_show_mount = "show"
|
||||||
input_show_port = 8002
|
input_show_port = 8002
|
||||||
|
|
||||||
# Outputs
|
|
||||||
icecast_vorbis_metadata = false
|
|
||||||
|
|
||||||
# Settings
|
# Settings
|
||||||
auth_path = "/fake/liquidsoap_auth.py"
|
auth_path = "/fake/liquidsoap_auth.py"
|
||||||
|
|
||||||
|
@ -75,6 +69,8 @@
|
||||||
|
|
||||||
# icecast:1
|
# icecast:1
|
||||||
output_icecast_1_source = s
|
output_icecast_1_source = s
|
||||||
|
# Disable ogg metadata
|
||||||
|
output_icecast_1_source = add(normalize=false, [amplify(0.00001, noise()), output_icecast_1_source])
|
||||||
output.icecast(
|
output.icecast(
|
||||||
id="icecast:1",
|
id="icecast:1",
|
||||||
host="localhost",
|
host="localhost",
|
||||||
|
@ -114,9 +110,6 @@
|
||||||
input_show_mount = "show"
|
input_show_mount = "show"
|
||||||
input_show_port = 8002
|
input_show_port = 8002
|
||||||
|
|
||||||
# Outputs
|
|
||||||
icecast_vorbis_metadata = false
|
|
||||||
|
|
||||||
# Settings
|
# Settings
|
||||||
auth_path = "/fake/liquidsoap_auth.py"
|
auth_path = "/fake/liquidsoap_auth.py"
|
||||||
|
|
||||||
|
@ -175,9 +168,6 @@
|
||||||
input_show_mount = "show"
|
input_show_mount = "show"
|
||||||
input_show_port = 8002
|
input_show_port = 8002
|
||||||
|
|
||||||
# Outputs
|
|
||||||
icecast_vorbis_metadata = false
|
|
||||||
|
|
||||||
# Settings
|
# Settings
|
||||||
auth_path = "/fake/liquidsoap_auth.py"
|
auth_path = "/fake/liquidsoap_auth.py"
|
||||||
|
|
||||||
|
@ -199,6 +189,8 @@
|
||||||
|
|
||||||
# icecast:1
|
# icecast:1
|
||||||
output_icecast_1_source = s
|
output_icecast_1_source = s
|
||||||
|
# Disable ogg metadata
|
||||||
|
output_icecast_1_source = add(normalize=false, [amplify(0.00001, noise()), output_icecast_1_source])
|
||||||
output.icecast(
|
output.icecast(
|
||||||
id="icecast:1",
|
id="icecast:1",
|
||||||
host="localhost",
|
host="localhost",
|
||||||
|
@ -259,9 +251,6 @@
|
||||||
input_show_mount = "show"
|
input_show_mount = "show"
|
||||||
input_show_port = 8002
|
input_show_port = 8002
|
||||||
|
|
||||||
# Outputs
|
|
||||||
icecast_vorbis_metadata = false
|
|
||||||
|
|
||||||
# Settings
|
# Settings
|
||||||
auth_path = "/fake/liquidsoap_auth.py"
|
auth_path = "/fake/liquidsoap_auth.py"
|
||||||
|
|
||||||
|
@ -306,9 +295,6 @@
|
||||||
input_show_mount = "show"
|
input_show_mount = "show"
|
||||||
input_show_port = 8002
|
input_show_port = 8002
|
||||||
|
|
||||||
# Outputs
|
|
||||||
icecast_vorbis_metadata = false
|
|
||||||
|
|
||||||
# Settings
|
# Settings
|
||||||
auth_path = "/fake/liquidsoap_auth.py"
|
auth_path = "/fake/liquidsoap_auth.py"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue