263.3. mlt-7.42.0
MLT multimedia framework: the video editing engine under Kdenlive and Shotcut
| Version | 7.42.0, release 2 |
| Shelf | media-frameworks — Multimedia frameworks, capture, and media inspection |
| Phase | 43_toolkits (Toolkits), 236 of 344 in build order |
| Licence | LGPL-2.1-or-later AND GPL-2.0-or-later AND GPL-3.0-or-later |
| Homepage | https://www.mltframework.org/ |
| Build time | 5.0 SBU |
| Installed size | 9.9 MiB in 506 files |
| Recipe | ports/core/media-frameworks/mlt/kpkgbuild |
About
MLT is the multimedia framework that video editors are built on: a library, libmlt with its C++ wrapper libmlt++, that composes producers, filters, transitions and consumers into a timeline and renders it, plus the melt command that plays or renders an MLT XML project from the command line. Almost everything it can do lives in modules, loadable libraries under /usr/lib/mlt-7, each wrapping one library or one family of effects. In this tree kdenlive, shotcut and krita link it.
Sources
mlt-7.42.0.tar.gz(6.5 MiB)
sha2568800e343f43aaa885bd5d9d23553030fa220aa3e2f0c94d9fd6a936d41638cdd
upstream: https://github.com/mltframework/mlt/releases/download/v7.42.0/mlt-7.42.0.tar.gz
archive copy: sources-3/media-frameworks--mlt-7.42.0.tar.gz
Dependencies
Depends on: cmake, ninja, pkgconf, ffmpeg, fftw, gdk-pixbuf, pango, fontconfig, libexif, libxml2, zlib, glib, ladspa, lilv, libebur128, libsamplerate, rtaudio, rubberband, sdl2-compat, sox, vidstab, libvorbis, frei0r-plugins, qt6-qtbase, qt6-qtsvg, alsa-lib, libpulse, movit, libX11, libglvnd, opencv, rnnoise, libspatialaudio.
Required by (3): kdenlive, krita, shotcut.
Patches
build.sh applies these; kpkg applies nothing by itself.
melt-include-missing-system-headers.patch— adds<sys/time.h>and<sys/select.h>tosrc/melt/io.c, which usesstruct timeval,FD_ZERO,FD_SETandselect()without including the headers that declare them.mlt-man-link-destdir.patch— makes the install step that linksmelt.1tomelt-<major>.1run inside$DESTDIR. Upstream runs it in the live/usr/share/man/man1, so a staged install would write outside the package and leave the package without the link.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/43_toolkits/phase.env && kpkg install mlt'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/media-frameworks/mlt.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/media-frameworks/mlt
echo '8800e343f43aaa885bd5d9d23553030fa220aa3e2f0c94d9fd6a936d41638cdd mlt-7.42.0.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/mlt
SRC=$SRC_ROOT/mlt-7.42.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf mlt-7.42.0.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/melt-include-missing-system-headers.patch"
patch -p1 -i "$PORT_SRC/mlt-man-link-destdir.patch"
mkdir build && cd build
cmake .. -G Ninja \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_DISABLE_FIND_PACKAGE_JACK=ON \
-DGPL=ON \
-DGPL3=ON \
-DBUILD_TESTING=OFF \
-DBUILD_DOCS=OFF \
-DCLANG_FORMAT=OFF \
-DMOD_AVFORMAT=ON \
-DUSE_AVDEVICE=ON \
-DMOD_DECKLINK=OFF \
-DMOD_FREI0R=ON \
-DMOD_GDK=ON \
-DMOD_GLAXNIMATE_QT6=ON \
-DMOD_JACKRACK=ON \
-DUSE_LV2=ON \
-DUSE_VST2=ON \
-DMOD_KDENLIVE=ON \
-DMOD_MOVIT=ON \
-DMOD_NDI=OFF \
-DMOD_NORMALIZE=ON \
-DMOD_OLDFILM=ON \
-DMOD_OPENCV=ON \
-DMOD_OPENFX=ON \
-DMOD_PLUS=ON \
-DMOD_PLUSGPL=ON \
-DMOD_QT6=ON \
-DMOD_RESAMPLE=ON \
-DMOD_RTAUDIO=ON \
-DMOD_RUBBERBAND=ON \
-DMOD_RNNOISE=ON \
-DMOD_SDL1=OFF \
-DMOD_SDL2=ON \
-DMOD_SOX=ON \
-DMOD_SPATIALAUDIO=ON \
-DMOD_VIDSTAB=ON \
-DMOD_VORBIS=ON \
-DMOD_XINE=ON \
-DMOD_XML=ON \
-DSWIG_PYTHON=OFF
ninja
DESTDIR=$PKG ninja install
test -L "$PKG/usr/share/man/man1/melt.1"
The switches, and why each is set:
-DCMAKE_DISABLE_FIND_PACKAGE_JACK=ON— make CMake’sfind_package(JACK)fail whatever is installed. Thejackrackdirectory then builds nomltjackrackmodule, which is MLT’s JACK consumer and JACK-hosted LADSPA rack, and still buildsmltladspa, which hosts LADSPA, LV2 and VST2 plugins inside MLT itself. pipewire installs a JACK library andjack.pcin an earlier phase and is not independs, so without this switch the package would carry a module linking a library it does not declare.-DGPL=ON— with-DGPL3=ON: allow the GPL-licensed modules. WithGPLoff, upstream turns off normalize, openfx, plusgpl, qt6, resample, rubberband, vidstab and xine, and LADSPA hosting is a configuration error;GPL3adds thevqmvideo-quality transition to the Qt module. Both are upstream’s defaults, named.-DCLANG_FORMAT=OFF— no formatting target, which looks forclang-formatversion 14 exactly. It formats source and builds nothing; upstream’s default is on.-DBUILD_DOCS=OFF— no Doxygen API reference. Upstream’s default, named.-DMOD_AVFORMAT=ON— the FFmpeg module, MLT’s decoder and encoder for nearly every format, with-DUSE_AVDEVICE=ONadding libavdevice’s capture inputs. Both are upstream’s defaults, and the module makes ffmpeg a hard requirement.-DMOD_DECKLINK=OFF— no module for Blackmagic Design DeckLink capture and playback cards. The module carries the SDK headers but loadslibDeckLinkAPI.so, Blackmagic’s driver library, at run time, and nothing in this tree provides it. Upstream’s default is on.-DMOD_NDI=OFF— no NewTek NDI network video module, which needs the NDI SDK (not a port). Upstream’s default, named.-DMOD_GLAXNIMATE_QT6=ON— the producer that plays Glaxnimate and Lottie vector animations. It compiles the copy of Glaxnimate’s own source that ships undersrc/modules/glaxnimate/glaxnimate, against Qt 6. Off by upstream’s default.-DMOD_OPENCV=ON— theopencv.trackerfilter, which follows an object across frames. It needs OpenCV’strackingmodule, which opencv builds from its contrib sources. Off by upstream’s default.-DMOD_SPATIALAUDIO=ON— the ambisonic audio filters, through libspatialaudio. Off by upstream’s default.-DMOD_JACKRACK=ON— with-DUSE_LV2=ONand-DUSE_VST2=ON: thejackrackdirectory, where LADSPA hosting lives, with LV2 plugins through lilv and VST2 plugins through MLT’s own host, written against thevestige.hheader it carries. LADSPA hosting itself,USE_LADSPA, is left at its default of on, and the ladspa header must be present or configuration stops. All are upstream’s defaults, named.-DMOD_MOVIT=ON— the GPU effects module, through movit. It requires OpenGL and, on Linux, X11’s client library, which is why libglvnd and libX11 are independs.-DMOD_QT6=ON— the Qt 6 module: image and text producers, Kdenlive’s title producer, the audio visualisation filters, and Qt-drawn blend, crop, shadow and GPS-overlay effects.-DMOD_GDK=ONis its GdkPixbuf and Pango counterpart, an image and text producer of its own.-DMOD_RTAUDIO=ON— the audio consumer through rtaudio. Whenrtaudio.pcis missing, upstream falls back to its own copy of RtAudio over ALSA and PulseAudio.-DMOD_SDL1=OFF— with-DMOD_SDL2=ON: build the SDL 2 preview consumer, not the SDL 1.2 one. Both are upstream’s defaults, named.-DMOD_XINE=ON— MLT’s deinterlacing module, whose yadif and other deinterlacers come from xine and are compiled from MLT’s own source; it links no xine library.-DMOD_FREI0R=ON— and the remainingMOD_switches (KDENLIVE,NORMALIZE,OLDFILM,OPENFX,PLUS,PLUSGPL,RESAMPLE,RUBBERBAND,RNNOISE,SOX,VIDSTAB,VORBIS,XML): each module at upstream’s default of on, named. Upstream requires the library of each that has one (frei0r, libsamplerate, rubberband, rnnoise, SoX, vid.stab, Vorbis, libxml2), so a missing one stops the configure, and each is independs. The Plus module links libebur128 when pkg-config finds it and compiles its own copy otherwise.-DSWIG_PYTHON=OFF— no Python bindings, themlt7module. Upstream’s default, named.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/mlt, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf mlt-7.42.0-2.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/mlt, and runs the triggers its paths call for.
Contents
Installed programs: melt, melt-7.
Installed libraries: libmlt++-7.so, libmlt-7.so.
Installed directories: /usr/include/mlt-7, /usr/lib/cmake/Mlt7, /usr/lib/mlt-7, /usr/share/licenses/mlt, /usr/share/mlt-7.
Short descriptions
melt-7 |
author, play, and encode multitrack audio/video compositions |
mlt++-7.pc |
C++ API for MLT multimedia framework |
mlt-framework-7.pc |
MLT multimedia framework |
Notes
build.sh ends with test -L "$PKG/usr/share/man/man1/melt.1", which fails the build if the package lacks the man page link that the second patch makes.
The libplacebo module is not named in build.sh. Upstream’s MOD_PLACEBO defaults to on and builds the module only when pkg-config finds libplacebo 5.229 or newer, and drops it without an error otherwise. libplacebo is not in this port’s own depends; it arrives through ffmpeg, which is built with --enable-libplacebo, so the package carries libmltplacebo.so for as long as ffmpeg keeps that dependency.