CC-2590: Make bitrate for liquidsoap adjustable, support multiple

stream

- done
This commit is contained in:
James 2011-08-11 14:43:45 -04:00
parent 3dca3fd800
commit 4125f83ae7
3 changed files with 65 additions and 141 deletions

View File

@ -7,19 +7,16 @@
########################################### ###########################################
output_sound_device = false output_sound_device = false
output_s1 = "icecast" output_s1 = "icecast"
output_s2 = "icecast" output_s2 = "disabled"
output_s3 = "shoutcast" output_s3 = "disabled"
s1_type = "mp3" s1_type = "ogg"
s2_type = "ogg" s2_type = "ogg"
s3_type = "mp3" s3_type = "mp3"
#output_bitrate = 128 s1_bitrate = 128
s1_bitrate = 64
s2_bitrate = 128 s2_bitrate = 128
s3_bitrate = 128 s3_bitrate = 160
#output_samplerate = 44100
#output_stereo = true
########################################### ###########################################
# Logging settings # # Logging settings #
@ -35,23 +32,23 @@ s2_host = "127.0.0.1"
s3_host = "127.0.0.1" s3_host = "127.0.0.1"
s1_port = 8000 s1_port = 8000
s2_port = 8000 s2_port = 8000
s3_port = 9000 s3_port = 8000
s1_pass = "hackme" s1_pass = "hackme"
s2_pass = "hackme" s2_pass = "hackme"
s3_pass = "testing" s3_pass = "hackme"
# Icecast mountpoint names # Icecast mountpoint names
s1_mount = "airtime_64.mp3" s1_mount = "airtime_128.ogg"
s2_mount = "airtime_128.ogg" s2_mount = "airtime_128.ogg"
s3_mount = "airtime_128.ogg" s3_mount = "airtime_160.mp3"
# Webstream metadata settings # Webstream metadata settings
s1_url = "http://airtime.sourcefabric.org" s1_url = "http://airtime.sourcefabric.org"
s2_url = "http://airtime.sourcefabric.org" s2_url = "http://airtime.sourcefabric.org"
s3_url = "http://airtime.sourcefabric.org" s3_url = "http://airtime.sourcefabric.org"
s1_description = "Airtime Radio!" s1_description = "Airtime Radio! stream1"
s2_description = "Airtime Radio!" s2_description = "Airtime Radio! stream2"
s3_description = "Airtime Radio!" s3_description = "Airtime Radio! stream3"
s1_genre = "genre" s1_genre = "genre"
s2_genre = "genre" s2_genre = "genre"
s3_genre = "genre" s3_genre = "genre"
@ -62,14 +59,3 @@ s3_genre = "genre"
# mplayer and VLC have this problem. Enable this option at your # mplayer and VLC have this problem. Enable this option at your
# own risk! # own risk!
output_icecast_vorbis_metadata = false output_icecast_vorbis_metadata = false
###########################################
# Shoutcast Stream settings #
###########################################
#shoutcast_host = "127.0.0.1"
#shoutcast_port = 9000
#shoutcast_pass = "testing"
# Webstream metadata settings
#shoutcast_url = "http://airtime.sourcefabric.org"
#shoutcast_genre = "genre"

View File

@ -38,127 +38,65 @@ end
def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s) = def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s) =
if output_type == "icecast" then if output_type == "icecast" then
output.icecast = output.icecast(host = host,
port = port,
password = pass,
mount = mount_point,
fallible = true,
restart = true,
restart_delay = 5,
url = url,
description = description,
genre = genre)
if type == "mp3" then if type == "mp3" then
if bitrate == 64 then if bitrate == 32 then
ignore(output.icecast(%mp3(bitrate = 64), ignore(output.icecast(%mp3(bitrate = 32),s))
host = host, elsif bitrate == 64 then
port = port, ignore(output.icecast(%mp3(bitrate = 64),s))
password = pass, elsif bitrate == 96 then
mount = mount_point, ignore(output.icecast(%mp3(bitrate = 96),s))
fallible = true,
restart = true,
restart_delay = 5,
url = url,
description = description,
genre = genre,
s)
)
elsif bitrate == 128 then elsif bitrate == 128 then
ignore(output.icecast(%mp3(bitrate = 128), ignore(output.icecast(%mp3(bitrate = 128),s))
host = host, elsif bitrate == 160 then
port = port, ignore(output.icecast(%mp3(bitrate = 160),s))
password = pass,
mount = mount_point,
fallible = true,
restart = true,
restart_delay = 5,
url = url,
description = description,
genre = genre,
s)
)
end end
else else
if bitrate == 64 then source = ref s
if output_icecast_vorbis_metadata then if not output_icecast_vorbis_metadata then
ignore(output.icecast(%vorbis, source := add(normalize=false, [amplify(0.00001, noise()),s])
host = host, end
port = port, if bitrate == 32 then
password = pass, ignore(output.icecast(%vorbis.cbr(bitrate = 32),!source))
mount = mount_point, elsif bitrate == 64 then
fallible = true, ignore(output.icecast(%vorbis.cbr(bitrate = 64),!source))
restart = true, elsif bitrate == 96 then
restart_delay = 5, ignore(output.icecast(%vorbis.cbr(bitrate = 96),!source))
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 elsif bitrate == 128 then
if output_icecast_vorbis_metadata then ignore(output.icecast(%vorbis.cbr(bitrate = 128),!source))
ignore(output.icecast(%vorbis, elsif bitrate == 160 then
host = host, ignore(output.icecast(%vorbis.cbr(bitrate = 160),!source))
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
end end
else else
if bitrate == 64 then output.shoutcast = output.shoutcast(host = host,
ignore(output.shoutcast(%mp3(bitrate = 64), port = port,
host = host, password = pass,
port = port, fallible = true,
password = pass, restart = true,
fallible = true, restart_delay = 5,
restart = true, url = url,
restart_delay = 5, genre = genre)
url = url, if bitrate == 32 then
genre = genre, ignore(output.shoutcast(%mp3(bitrate = 32),s))
s) elsif bitrate == 64 then
) ignore(output.shoutcast(%mp3(bitrate = 64),s))
elsif bitrate == 96 then
ignore(output.shoutcast(%mp3(bitrate = 96),s))
elsif bitrate == 128 then elsif bitrate == 128 then
ignore(output.shoutcast(%mp3(bitrate = 128), ignore(output.shoutcast(%mp3(bitrate = 128),s))
host = host, elsif bitrate == 160 then
port = port, ignore(output.shoutcast(%mp3(bitrate = 160),s))
password = pass,
fallible = true,
restart = true,
restart_delay = 5,
url = url,
genre = genre,
s)
)
end end
end end
end end

View File

@ -56,17 +56,17 @@ if output_sound_device then
ignore(output.alsa(s)) ignore(output.alsa(s))
end end
if output_s1 != "" then if output_s1 != "disabled" then
#output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s) #output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s)
output_to(output_s1, s1_type, s1_bitrate, s1_host, s1_port, s1_pass, s1_mount, s1_url, s1_description, s1_genre, s) output_to(output_s1, s1_type, s1_bitrate, s1_host, s1_port, s1_pass, s1_mount, s1_url, s1_description, s1_genre, s)
end end
if output_s2 != "" then if output_s2 != "disabled" then
#output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s) #output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s)
output_to(output_s2, s2_type, s2_bitrate, s2_host, s2_port, s2_pass, s2_mount, s2_url, s2_description, s2_genre, s) output_to(output_s2, s2_type, s2_bitrate, s2_host, s2_port, s2_pass, s2_mount, s2_url, s2_description, s2_genre, s)
end end
if output_s3 != "" then if output_s3 != "disabled" then
#output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s) #output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s)
output_to(output_s3, s3_type, s3_bitrate, s3_host, s3_port, s3_pass, s3_mount, s3_url, s3_description, s3_genre, s) output_to(output_s3, s3_type, s3_bitrate, s3_host, s3_port, s3_pass, s3_mount, s3_url, s3_description, s3_genre, s)
end end