CC-2590: support multiple stream on liquidsoap
- temp commit
This commit is contained in:
parent
ceea384154
commit
3dca3fd800
|
@ -6,11 +6,18 @@
|
||||||
# Output settings #
|
# Output settings #
|
||||||
###########################################
|
###########################################
|
||||||
output_sound_device = false
|
output_sound_device = false
|
||||||
output_icecast_vorbis = true
|
output_s1 = "icecast"
|
||||||
output_icecast_mp3 = false
|
output_s2 = "icecast"
|
||||||
output_shoutcast = false
|
output_s3 = "shoutcast"
|
||||||
|
|
||||||
|
s1_type = "mp3"
|
||||||
|
s2_type = "ogg"
|
||||||
|
s3_type = "mp3"
|
||||||
|
|
||||||
#output_bitrate = 128
|
#output_bitrate = 128
|
||||||
|
s1_bitrate = 64
|
||||||
|
s2_bitrate = 128
|
||||||
|
s3_bitrate = 128
|
||||||
#output_samplerate = 44100
|
#output_samplerate = 44100
|
||||||
#output_stereo = true
|
#output_stereo = true
|
||||||
|
|
||||||
|
@ -23,18 +30,31 @@ log_file = "/var/log/airtime/pypo-liquidsoap/<script>.log"
|
||||||
###########################################
|
###########################################
|
||||||
# Icecast Stream settings #
|
# Icecast Stream settings #
|
||||||
###########################################
|
###########################################
|
||||||
icecast_host = "127.0.0.1"
|
s1_host = "127.0.0.1"
|
||||||
icecast_port = 8000
|
s2_host = "127.0.0.1"
|
||||||
icecast_pass = "hackme"
|
s3_host = "127.0.0.1"
|
||||||
|
s1_port = 8000
|
||||||
|
s2_port = 8000
|
||||||
|
s3_port = 9000
|
||||||
|
s1_pass = "hackme"
|
||||||
|
s2_pass = "hackme"
|
||||||
|
s3_pass = "testing"
|
||||||
|
|
||||||
# Icecast mountpoint names
|
# Icecast mountpoint names
|
||||||
mount_point_mp3 = "airtime.mp3"
|
s1_mount = "airtime_64.mp3"
|
||||||
mount_point_vorbis = "airtime.ogg"
|
s2_mount = "airtime_128.ogg"
|
||||||
|
s3_mount = "airtime_128.ogg"
|
||||||
|
|
||||||
# Webstream metadata settings
|
# Webstream metadata settings
|
||||||
icecast_url = "http://airtime.sourcefabric.org"
|
s1_url = "http://airtime.sourcefabric.org"
|
||||||
icecast_description = "Airtime Radio!"
|
s2_url = "http://airtime.sourcefabric.org"
|
||||||
icecast_genre = "genre"
|
s3_url = "http://airtime.sourcefabric.org"
|
||||||
|
s1_description = "Airtime Radio!"
|
||||||
|
s2_description = "Airtime Radio!"
|
||||||
|
s3_description = "Airtime Radio!"
|
||||||
|
s1_genre = "genre"
|
||||||
|
s2_genre = "genre"
|
||||||
|
s3_genre = "genre"
|
||||||
|
|
||||||
# Audio stream metadata for vorbis/ogg is disabled by default
|
# Audio stream metadata for vorbis/ogg is disabled by default
|
||||||
# due to a number of client media players that disconnect
|
# due to a number of client media players that disconnect
|
||||||
|
@ -46,10 +66,10 @@ output_icecast_vorbis_metadata = false
|
||||||
###########################################
|
###########################################
|
||||||
# Shoutcast Stream settings #
|
# Shoutcast Stream settings #
|
||||||
###########################################
|
###########################################
|
||||||
shoutcast_host = "127.0.0.1"
|
#shoutcast_host = "127.0.0.1"
|
||||||
shoutcast_port = 9000
|
#shoutcast_port = 9000
|
||||||
shoutcast_pass = "testing"
|
#shoutcast_pass = "testing"
|
||||||
|
|
||||||
# Webstream metadata settings
|
# Webstream metadata settings
|
||||||
shoutcast_url = "http://airtime.sourcefabric.org"
|
#shoutcast_url = "http://airtime.sourcefabric.org"
|
||||||
shoutcast_genre = "genre"
|
#shoutcast_genre = "genre"
|
||||||
|
|
|
@ -36,6 +36,133 @@ def to_live(old,new) =
|
||||||
sequence([old,new])
|
sequence([old,new])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s) =
|
||||||
|
if output_type == "icecast" then
|
||||||
|
if type == "mp3" then
|
||||||
|
if bitrate == 64 then
|
||||||
|
ignore(output.icecast(%mp3(bitrate = 64),
|
||||||
|
host = host,
|
||||||
|
port = port,
|
||||||
|
password = pass,
|
||||||
|
mount = mount_point,
|
||||||
|
fallible = true,
|
||||||
|
restart = true,
|
||||||
|
restart_delay = 5,
|
||||||
|
url = url,
|
||||||
|
description = description,
|
||||||
|
genre = genre,
|
||||||
|
s)
|
||||||
|
)
|
||||||
|
elsif bitrate == 128 then
|
||||||
|
ignore(output.icecast(%mp3(bitrate = 128),
|
||||||
|
host = host,
|
||||||
|
port = port,
|
||||||
|
password = pass,
|
||||||
|
mount = mount_point,
|
||||||
|
fallible = true,
|
||||||
|
restart = true,
|
||||||
|
restart_delay = 5,
|
||||||
|
url = url,
|
||||||
|
description = description,
|
||||||
|
genre = genre,
|
||||||
|
s)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if bitrate == 64 then
|
||||||
|
if output_icecast_vorbis_metadata then
|
||||||
|
ignore(output.icecast(%vorbis,
|
||||||
|
host = host,
|
||||||
|
port = port,
|
||||||
|
password = pass,
|
||||||
|
mount = mount_point,
|
||||||
|
fallible = true,
|
||||||
|
restart = true,
|
||||||
|
restart_delay = 5,
|
||||||
|
url = url,
|
||||||
|
description = description,
|
||||||
|
genre = genre,
|
||||||
|
s)
|
||||||
|
)
|
||||||
|
else
|
||||||
|
s = add(normalize=false, [amplify(0.00001, noise()),s])
|
||||||
|
ignore(output.icecast(%vorbis,
|
||||||
|
host = host,
|
||||||
|
port = port,
|
||||||
|
password = pass,
|
||||||
|
mount = mount_point,
|
||||||
|
fallible = true,
|
||||||
|
restart = true,
|
||||||
|
restart_delay = 5,
|
||||||
|
url = url,
|
||||||
|
description = description,
|
||||||
|
genre = genre,
|
||||||
|
s)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
elsif bitrate == 128 then
|
||||||
|
if output_icecast_vorbis_metadata then
|
||||||
|
ignore(output.icecast(%vorbis,
|
||||||
|
host = host,
|
||||||
|
port = port,
|
||||||
|
password = pass,
|
||||||
|
mount = mount_point,
|
||||||
|
fallible = true,
|
||||||
|
restart = true,
|
||||||
|
restart_delay = 5,
|
||||||
|
url = url,
|
||||||
|
description = description,
|
||||||
|
genre = genre,
|
||||||
|
s)
|
||||||
|
)
|
||||||
|
else
|
||||||
|
s = add(normalize=false, [amplify(0.00001, noise()),s])
|
||||||
|
ignore(output.icecast(%vorbis,
|
||||||
|
host = host,
|
||||||
|
port = port,
|
||||||
|
password = pass,
|
||||||
|
mount = mount_point,
|
||||||
|
fallible = true,
|
||||||
|
restart = true,
|
||||||
|
restart_delay = 5,
|
||||||
|
url = url,
|
||||||
|
description = description,
|
||||||
|
genre = genre,
|
||||||
|
s)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if bitrate == 64 then
|
||||||
|
ignore(output.shoutcast(%mp3(bitrate = 64),
|
||||||
|
host = host,
|
||||||
|
port = port,
|
||||||
|
password = pass,
|
||||||
|
fallible = true,
|
||||||
|
restart = true,
|
||||||
|
restart_delay = 5,
|
||||||
|
url = url,
|
||||||
|
genre = genre,
|
||||||
|
s)
|
||||||
|
)
|
||||||
|
elsif bitrate == 128 then
|
||||||
|
ignore(output.shoutcast(%mp3(bitrate = 128),
|
||||||
|
host = host,
|
||||||
|
port = port,
|
||||||
|
password = pass,
|
||||||
|
fallible = true,
|
||||||
|
restart = true,
|
||||||
|
restart_delay = 5,
|
||||||
|
url = url,
|
||||||
|
genre = genre,
|
||||||
|
s)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Add a skip function to a source
|
# Add a skip function to a source
|
||||||
# when it does not have one
|
# when it does not have one
|
||||||
# by default
|
# by default
|
||||||
|
|
|
@ -56,70 +56,18 @@ if output_sound_device then
|
||||||
ignore(output.alsa(s))
|
ignore(output.alsa(s))
|
||||||
end
|
end
|
||||||
|
|
||||||
if output_icecast_mp3 then
|
if output_s1 != "" then
|
||||||
|
#output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s)
|
||||||
#format = %mp3(bitrate=192, samplerate=44100, stereo=false)
|
output_to(output_s1, s1_type, s1_bitrate, s1_host, s1_port, s1_pass, s1_mount, s1_url, s1_description, s1_genre, s)
|
||||||
ignore(output.icecast(%mp3,
|
|
||||||
host = icecast_host,
|
|
||||||
port = icecast_port,
|
|
||||||
password = icecast_pass,
|
|
||||||
mount = mount_point_mp3,
|
|
||||||
fallible = true,
|
|
||||||
restart = true,
|
|
||||||
restart_delay = 5,
|
|
||||||
url = icecast_url,
|
|
||||||
description = icecast_description,
|
|
||||||
genre = icecast_genre,
|
|
||||||
s)
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if output_icecast_vorbis then
|
if output_s2 != "" then
|
||||||
if output_icecast_vorbis_metadata then
|
#output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s)
|
||||||
ignore(output.icecast(%vorbis,
|
output_to(output_s2, s2_type, s2_bitrate, s2_host, s2_port, s2_pass, s2_mount, s2_url, s2_description, s2_genre, s)
|
||||||
host = icecast_host,
|
|
||||||
port = icecast_port,
|
|
||||||
password = icecast_pass,
|
|
||||||
mount = mount_point_vorbis,
|
|
||||||
fallible = true,
|
|
||||||
restart = true,
|
|
||||||
restart_delay = 5,
|
|
||||||
url = icecast_url,
|
|
||||||
description = icecast_description,
|
|
||||||
genre = icecast_genre,
|
|
||||||
s)
|
|
||||||
)
|
|
||||||
else
|
|
||||||
#remove metadata from ogg source and merge tracks to fix bug
|
|
||||||
#with vlc and mplayer disconnecting at the end of every track
|
|
||||||
s = add(normalize=false, [amplify(0.00001, noise()),s])
|
|
||||||
ignore(output.icecast(%vorbis,
|
|
||||||
host = icecast_host,
|
|
||||||
port = icecast_port,
|
|
||||||
password = icecast_pass,
|
|
||||||
mount = mount_point_vorbis,
|
|
||||||
fallible = true,
|
|
||||||
restart = true,
|
|
||||||
restart_delay = 5,
|
|
||||||
url = icecast_url,
|
|
||||||
description = icecast_description,
|
|
||||||
genre = icecast_genre,
|
|
||||||
s)
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if output_shoutcast then
|
if output_s3 != "" then
|
||||||
ignore(output.shoutcast(%mp3,
|
#output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s)
|
||||||
host = shoutcast_host,
|
output_to(output_s3, s3_type, s3_bitrate, s3_host, s3_port, s3_pass, s3_mount, s3_url, s3_description, s3_genre, s)
|
||||||
port = shoutcast_port,
|
|
||||||
password = shoutcast_pass,
|
|
||||||
fallible = true,
|
|
||||||
restart = true,
|
|
||||||
restart_delay = 5,
|
|
||||||
url = shoutcast_url,
|
|
||||||
genre = shoutcast_genre,
|
|
||||||
s)
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue