Skip to main content
Version: 2.5.x (dev)

Get help

Liquidsoap is a self-documented application, meaning it can answer many questions about its own API and settings directly from the command line. This page explains how to use those built-in help tools.

If you can't find what you need, you can also reach the community:

Scripting API​

When scripting in liquidsoap, one uses functions that are either builtin (e.g. input.http or output.icecast) or defined in the script library (e.g. output). All these functions come with documentation, which you can access by executing liquidsoap -h FUNCTION on the command-line. For example:

$ liquidsoap -h sine
Generate a sine wave.

Type: (?id : string?, ?amplitude : {float}, ?duration : float?, ?{float}) ->
source(audio=pcm*)

Category: Source / Input / Passive

Composition:

This source uses file composition by default.

Arguments:

* amplitude : {float} (default: 1.0)
Maximal value of the waveform.

* duration : float? (default: null)
Duration in seconds (`null` means infinite).

* id : string? (default: null)
Force the value of the source ID.

* (unlabeled) : {float} (default: 440.0)
Frequency of the sine.

Methods:

* duration : () -> float
Estimation of the duration of the current track.

* elapsed : () -> float
Elapsed time in the current track.

* fallible : bool
Indicate if a source may fail, i.e. may not be ready to stream.

...

If you don't know which function you need, browse the API reference.

Note that some functions are optional and may not be available in your local liquidsoap install: they require an optional dependency to be enabled. You can see the list of optional dependencies via opam info liquidsoap or on the build page.

Settings​

Liquidsoap scripts can contain expressions like settings.log.stdout := true. These are settings: global variables that affect the behaviour of the application.

Some common settings have shortcuts for convenience. These are all aliases for their respective settings values:

settings.liq
log.level := 4
log.file := true
log.stdout := true
audio.samplerate := 48000
audio.channels := 2
video.frame.width := 720
video.frame.height := 1280

You can have a list of available settings, with their documentation, by running liquidsoap --list-settings.

The output is a valid liquidsoap script that you can edit to set the values you want, then load it (implicitly or explicitly) before your other scripts.

You can browse online the list of available settings.