Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
engine-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
engine-core
Commits
6d111ead
Commit
6d111ead
authored
2 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Refact: Liquidsoap 2.1 compatiblity
parent
a67ba8b1
No related branches found
No related tags found
1 merge request
!3
Liquidsoap 2 migration
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/library.liq
+11
-29
11 additions, 29 deletions
src/library.liq
src/outgoing_streams/mp3.liq
+44
-22
44 additions, 22 deletions
src/outgoing_streams/mp3.liq
src/outgoing_streams/ogg.liq
+36
-18
36 additions, 18 deletions
src/outgoing_streams/ogg.liq
src/readini.liq
+8
-1
8 additions, 1 deletion
src/readini.liq
with
99 additions
and
70 deletions
src/library.liq
+
11
−
29
View file @
6d111ead
...
@@ -72,47 +72,29 @@ def stream_to_icecast(id, encoding, bitrate, host, port, pass, mount_point, url,
...
@@ -72,47 +72,29 @@ def stream_to_icecast(id, encoding, bitrate, host, port, pass, mount_point, url,
log("Successfully connected to stream_#{streamnumber}")
log("Successfully connected to stream_#{streamnumber}")
end
end
stereo = (int_of_string(channels) >= 2)
user_ref = ref (user)
user_ref = ref (user)
if user == "" then
if user == "" then
user_ref := "source"
user_ref := "source"
end
end
# Liquidsoap cannot handle one output definition for mono and stereo
# TODO Refactor all outgoing stream formats this way
output_icecast_mono = output.icecast(id = id, host = host, port = port, password = pass, mount = mount_point, fallible = true, url = url, description = description, name = name, genre = genre, user = !user_ref, on_error = on_error, on_connect = on_connect, icy_metadata = "true")
let stereo = (int_of_string(channels) >= 2)
output_icecast_stereo = output.icecast(id = id, host = host, port = port, password = pass, mount = mount_point, fallible = true, url = url, description = description, name = name, genre = genre, user = !user_ref, on_error = on_error, on_connect = on_connect, icy_metadata = "true")
let format = %mp3(bitrate = 128, stereo = true)
# %ifencoder %aac
# if encoding == "aac" then
# log("ENABLING AAC to ICECAST")
# %include "outgoing_streams/aac.liq"
# end
# %endif
#
# %ifencoder %flac
# if encoding == "flac" then
# log("ENABLING FLAC to ICECAST")
# %include "outgoing_streams/flac.liq"
# end
# %endif
if encoding == "mp3" then
if encoding == "mp3" then
log("ENABLING MP3 to ICECAST")
%include "outgoing_streams/mp3.liq"
%include "outgoing_streams/mp3.liq"
end
end
if encoding == "ogg" then
if encoding == "ogg" then
log("ENABLING OGG to ICECAST")
%include "outgoing_streams/ogg.liq"
%include "outgoing_streams/ogg.liq"
end
end
# %ifencoder %opus
log("Icecast output format: #{encoding} #{bitrate}")
# if encoding == "opus" then
# Liquidsoap cannot handle one output definition for mono and stereo
# log("ENABLING OPUS to ICECAST")
# FIXME should be working since Liquidsoap 2
# %include "outgoing_streams/opus.liq"
output_icecast_mono = output.icecast(id = id, host = host, port = port, password = pass, mount = mount_point, fallible = true, url = url, description = description, name = name, genre = genre, user = !user_ref, on_error = on_error, on_connect = on_connect, icy_metadata = "true", format, !source)
# end
output_icecast_stereo = output.icecast(id = id, host = host, port = port, password = pass, mount = mount_point, fallible = true, url = url, description = description, name = name, genre = genre, user = !user_ref, on_error = on_error, on_connect = on_connect, icy_metadata = "true", format, !source)
# %endif
ignore(output_icecast_mono)
ignore(output_icecast_stereo)
end
end
###########
###########
...
...
This diff is collapsed.
Click to expand it.
src/outgoing_streams/mp3.liq
+
44
−
22
View file @
6d111ead
...
@@ -19,69 +19,91 @@
...
@@ -19,69 +19,91 @@
if bitrate == 24 then
if bitrate == 24 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%mp3(bitrate = 24, stereo = true), !source))
format = %mp3(bitrate = 24, stereo = true)
ignore(format)
else
else
ignore(output_icecast_mono(%mp3(bitrate = 24, stereo = false), mean(!source)))
format = %mp3(bitrate = 24, stereo = false)
ignore(format)
end
end
elsif bitrate == 32 then
elsif bitrate == 32 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%mp3(bitrate = 32, stereo = true), !source))
format = %mp3(bitrate = 32, stereo = true)
ignore(format)
else
else
ignore(output_icecast_mono(%mp3(bitrate = 32, stereo = false), mean(!source)))
format = %mp3(bitrate = 32, stereo = false)
ignore(format)
end
end
elsif bitrate == 48 then
elsif bitrate == 48 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%mp3(bitrate = 48, stereo = true), !source))
format = %mp3(bitrate = 48, stereo = true)
ignore(format)
else
else
ignore(output_icecast_mono(%mp3(bitrate = 48, stereo = false), mean(!source)))
format = %mp3(bitrate = 48, stereo = false)
ignore(format)
end
end
elsif bitrate == 64 then
elsif bitrate == 64 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%mp3(bitrate = 64, stereo = true), !source))
format = %mp3(bitrate = 64, stereo = true)
ignore(format)
else
else
ignore(output_icecast_mono(%mp3(bitrate = 64, stereo = false), mean(!source)))
format = %mp3(bitrate = 64, stereo = false)
ignore(format)
end
end
elsif bitrate == 96 then
elsif bitrate == 96 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%mp3(bitrate = 96, stereo = true), !source))
format = %mp3(bitrate = 96, stereo = true)
ignore(format)
else
else
ignore(output_icecast_mono(%mp3(bitrate = 96, stereo = false), mean(!source)))
format = %mp3(bitrate = 96, stereo = false)
ignore(format)
end
end
elsif bitrate == 128 then
elsif bitrate == 128 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%mp3(bitrate = 128, stereo = true), !source))
format = %mp3(bitrate = 128, stereo = true)
ignore(format)
else
else
ignore(output_icecast_mono(%mp3(bitrate = 128, stereo = false), mean(!source)))
format = %mp3(bitrate = 128, stereo = false)
ignore(format)
end
end
elsif bitrate == 160 then
elsif bitrate == 160 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%mp3(bitrate = 160, stereo = true), !source))
format = %mp3(bitrate = 160, stereo = true)
ignore(format)
else
else
ignore(output_icecast_mono(%mp3(bitrate = 160, stereo = false), mean(!source)))
format = %mp3(bitrate = 160, stereo = false)
ignore(format)
end
end
elsif bitrate == 192 then
elsif bitrate == 192 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%mp3(bitrate = 192, stereo = true), !source))
format = %mp3(bitrate = 192, stereo = true)
ignore(format)
else
else
ignore(output_icecast_mono(%mp3(bitrate = 192, stereo = false), mean(!source)))
format = %mp3(bitrate = 192, stereo = false)
ignore(format)
end
end
elsif bitrate == 224 then
elsif bitrate == 224 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%mp3(bitrate = 224, stereo = true), !source))
format = %mp3(bitrate = 224, stereo = true)
ignore(format)
else
else
ignore(output_icecast_mono(%mp3(bitrate = 224, stereo = false), mean(!source)))
format = %mp3(bitrate = 224, stereo = false)
ignore(format)
end
end
elsif bitrate == 256 then
elsif bitrate == 256 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%mp3(bitrate = 256, stereo = true), !source))
format = %mp3(bitrate = 256, stereo = true)
ignore(format)
else
else
ignore(output_icecast_mono(%mp3(bitrate = 256, stereo = false), mean(!source)))
format = %mp3(bitrate = 256, stereo = false)
ignore(format)
end
end
elsif bitrate == 320 then
elsif bitrate == 320 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%mp3(bitrate = 320, stereo = true), !source))
format = %mp3(bitrate = 320, stereo = true)
ignore(format)
else
else
ignore(output_icecast_mono(%mp3(bitrate = 320, stereo = false), mean(!source)))
format = %mp3(bitrate = 320, stereo = false)
ignore(format)
end
end
end
end
This diff is collapsed.
Click to expand it.
src/outgoing_streams/ogg.liq
+
36
−
18
View file @
6d111ead
...
@@ -23,57 +23,75 @@ end
...
@@ -23,57 +23,75 @@ end
if bitrate == 24 or bitrate == 32 or bitrate == 48 then
if bitrate == 24 or bitrate == 32 or bitrate == 48 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%vorbis(quality=-0.1, channels = 2), !source))
format = %vorbis(quality=-0.1, channels = 2)
ignore(format)
else
else
ignore(output_icecast_mono(%vorbis(quality=-0.1, channels = 1), mean(!source)))
format = %vorbis(quality=-0.1, channels = 1)
ignore(format)
end
end
elsif bitrate == 64 then
elsif bitrate == 64 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%vorbis(quality=0, channels = 2), !source))
format = %vorbis(quality=0, channels = 2)
ignore(format)
else
else
ignore(output_icecast_mono(%vorbis(quality=0, channels = 1), mean(!source)))
format = %vorbis(quality=0, channels = 1)
ignore(format)
end
end
elsif bitrate == 96 then
elsif bitrate == 96 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%vorbis(quality=0.2, channels = 2), !source))
format = %vorbis(quality=0.2, channels = 2)
ignore(format)
else
else
ignore(output_icecast_mono(%vorbis(quality=0.2, channels = 1), mean(!source)))
format = %vorbis(quality=0.2, channels = 1)
ignore(format)
end
end
elsif bitrate == 128 then
elsif bitrate == 128 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%vorbis(quality=0.4, channels = 2), !source))
format = %vorbis(quality=0.4, channels = 2)
ignore(format)
else
else
ignore(output_icecast_mono(%vorbis(quality=0.4, channels = 1), mean(!source)))
format = %vorbis(quality=0.4, channels = 1)
ignore(format)
end
end
elsif bitrate == 160 then
elsif bitrate == 160 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%vorbis(quality=0.5, channels = 2), !source))
format = %vorbis(quality=0.5, channels = 2)
ignore(format)
else
else
ignore(output_icecast_mono(%vorbis(quality=0.5, channels = 1), mean(!source)))
format = %vorbis(quality=0.5, channels = 1)
ignore(format)
end
end
elsif bitrate == 192 then
elsif bitrate == 192 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%vorbis(quality=0.6, channels = 2), !source))
format = %vorbis(quality=0.6, channels = 2)
ignore(format)
else
else
ignore(output_icecast_mono(%vorbis(quality=0.6, channels = 1), mean(!source)))
format = %vorbis(quality=0.6, channels = 1)
ignore(format)
end
end
elsif bitrate == 224 then
elsif bitrate == 224 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%vorbis(quality=0.7, channels = 2), !source))
format = %vorbis(quality=0.7, channels = 2)
ignore(format)
else
else
ignore(output_icecast_mono(%vorbis(quality=0.7, channels = 1), mean(!source)))
format = %vorbis(quality=0.7, channels = 1)
ignore(format)
end
end
elsif bitrate == 256 then
elsif bitrate == 256 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%vorbis(quality=0.8, channels = 2), !source))
format = %vorbis(quality=0.8, channels = 2)
ignore(format)
else
else
ignore(output_icecast_mono(%vorbis(quality=0.8, channels = 1), mean(!source)))
format = %vorbis(quality=0.8, channels = 1)
ignore(format)
end
end
elsif bitrate == 320 then
elsif bitrate == 320 then
if stereo then
if stereo then
ignore(output_icecast_stereo(%vorbis(quality=0.9, channels = 2), !source))
format = %vorbis(quality=0.9, channels = 2)
ignore(format)
else
else
ignore(output_icecast_mono(%vorbis(quality=0.9, channels = 1), mean(!source)))
format = %vorbis(quality=0.9, channels = 1)
ignore(format)
end
end
end
end
This diff is collapsed.
Click to expand it.
src/readini.liq
+
8
−
1
View file @
6d111ead
...
@@ -28,7 +28,14 @@ def read_ini(file)
...
@@ -28,7 +28,14 @@ def read_ini(file)
# read ini file
# read ini file
settings_file_content = process.read.lines("cat "^file )
settings_file_content = process.read.lines("cat "^file )
# one entry stored as ["setting_name", "setting"]
# one entry stored as ["setting_name", "setting"]
settings_map = list.map(string.split(separator="="), settings_file_content)
# settings_map = list.map(string.split(separator="="), settings_file_content)
def split_line(line)
string.split(line, separator="=")
end
settings_map = list.map(split_line, settings_file_content)
# settings_map = list.map(string.split("#{settings_file_content}", separator="="))
def filter_pair(setting_pair) =
def filter_pair(setting_pair) =
if !debug then
if !debug then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment