Liquidsoap 2.1.0
This is the first release of the 2.1.x
release branch! 🎉
This version comes with some major improvements and breaking changes. As usual, you can get a (mostly) complete list in the migration page
In particular, the following changes are noticeable:
JSON parsing is greatly improved
You should now be able to do:
let json.parse ({
foo,
bla,
gni
} : {
foo: string,
bla: float,
gni: bool
}) = '{ "foo": "aabbcc", "bla": 3.14, "gni": true }'
For any one who has ever tried to parse json in their liquidsoap scripts, this is gonna be a game changer. We have a detailed article here
Partial function application has been removed.
This is not so much an improvement but something we thought was an acceptable trade-off. Support for partial application is creating a lot of complexity in the language's implementation and not a lot of users are actively using it. This change means that instead of doing:
def f(x, y) =
...
end
g = f(0)
You will now have to do:
def f(x, y) =
...
end
def g(y) =
f(0, y)
end
Regular expressions are now first-class entities.
This should be familiar to anyone used to working with Javascript's regular expression. So, now, instead of doing:
string.match(pattern="\\d+", s)
You will now do:
r/\d+/.test(s)
There's a detailed description of this new feature here.
Full Changelog:
2.1.0 (2022-07-15)
New:
- Added support for variables in encoders (#1858)
- Added support for regular expressions (#1881)
- Added generalized support for value extraction patterns (#1970)
- Added support for string getter for
http.{post,put}
operations (#1984) - Added
output.youtube.live.hls
- Rewrote out internal JSON parser/renderer (#2011). Breaking change values
that cannot be represented asJSON
will now raiseerror.json
when
converted toJSON
.infinite
andnan
floats can be exported using the
json5
export format. - Added socket API (#2014).
- Added support for ffmpeg bitstream filters (#2387)
- Added
liquidsoap.version.at_least
. - Added
video.rectangle
,video.persistence
. - Added
video.vumeter
. - Added
video.slideshow
. - Added
video.add_text.camlimages
(#2202). - Added
video.text.*
and re-implementedvideo.add_text.*
from those (#2226). - Added
irc.channel
operator to retrieve the contents of an IRC channel
(#2210). - Added new in-house parsing of metadata for some image and video formats
(#2236). - Added
file.download
- Added new options for
%ffmpeg
copy encoder:ignore_keyframes
andwait_for_keyframe
(#2382)
Changed:
- Removed support for partial application, which should avoid some type errors,
improve performance and simplifies the code related to the reduction (#2204). - Video dimensions (width and height) can now be specified per stream in the
type and are then used instead of the default ones. For instance, you can now
writein order to force the decoding of a file to be performed at the 300×200s = (single("file.mp4") : source(video(width=300,height=200)))
resolution (#2212). - Video images are now canvas, which means that they do not directly contain
the images, but are constituted of multiple images placed at various
positions. This should make much more efficient operations such as making
videos from multiple ones, adding a logo, etc. (#2207) output.youtube.live
renamedoutput.youtube.live.rtmp
, removebitrate
and
quality
arguments and added a single encoder argument to allow stream copy
and more.source.on_metadata
andsource.on_track
now return a source as this was the
case in previous versions, and associated handlers are triggered only when the
returned source is pulled (#2103).- Made
streams_info
parameter ofoutput.file.hls
a record (#2173). - Disable scrolling by default in
video.add_text
. You can re-enable it by
usingvideo.add_text(speed=70, ...)
. - Added "example" sections to operators documentation, we now need to populate
those (#2227). - Default implementation of
video.testsrc
is now builtin, previous
implementation can be found undervideo.testsrc.ffmpeg
. - Images can now generate blank audio if needed, no need to add
mux_audio(audio=blank(),image)
anymore (#2230). - Removed deprecated
timeout
argument inhttp.*
operators. - Deprecated
request.ready
in favor ofrequest.resolved
.
Fixed:
- Fixed typo in
status
command of themix
operator. - Fixed performances issues with
input.ffmpeg
andinput.http
(#2475) - Fixed
list.shuffle
which was used to randomize playlists inplaylist
operator (#2507, #2500).