Liquidsoap supports dynamic creation and destruction of sources
during the execution of a script. The following gives an example
First some outlines:
This example is meant to create a new source and outputs. It is not easy currently to change a source being streamed
The idea is to create a new output using a telnet/server command.
In this example, we will register a command that creates a playlist source using an uri passed
as argument and outputs it to a fixed icecast output.
With more work on parsing the argument passed to the telnet command,
you may write more evolved options, such as the possibility to change
the output parameters etc..
Due to some limitations of the language, we have used some
intricate (but classic) functional programming tricks. They are
commented in order to help reading the code..
New here's the code:
If you execute this code (add a output.dummy(blank()) if you have
no other output..), you have two new telnet commands:
which you can use to create/destroy dynamically your sources.
With more tweaking, you should be able to adapt these ideas to your
If you want to plug those sources into an existing output, you may
want to use an input.harbor in the main output and change the
output.icecast in the dynamic source creation to send everything to
this input.harbor. You can use the %wav format in this case to avoid
compressing/decompressing the data..