322.6. avidemux-2.8.1
Qt 6 video cutter, filter and encoder
| Version | 2.8.1, release 1 |
| Shelf | video-tools — Video editing, transcoding, muxing, recording, streaming and webcam apps |
| Phase | 44_apps (Applications), 414 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://avidemux.sourceforge.net/ |
| Build time | 7.5 SBU |
| Installed size | 30.4 MiB in 675 files |
| Recipe | ports/core/video-tools/avidemux/kpkgbuild |
About
Avidemux is a video editor for cutting, filtering and re-encoding: it trims and joins clips, applies filters, and writes the result through its encoders or copies the streams untouched. The port builds the Qt 6 application avidemux3_qt6, the command-line front end and the plugins for both. Its core carries a private FFmpeg release under avidemux_core/ffmpeg_package, patched by Avidemux and linked as its own libADM6av* libraries, separate from the ffmpeg port.
Sources
avidemux-2.8.1.tar.gz(24.9 MiB)
sha25677d9bdca8683ce57c192b69d207cfab7cf92a7759ce0f63fa37b5c8e42ad3da2
upstream: https://github.com/mean00/avidemux2/releases/download/2.8.1/avidemux_2.8.1.tar.gz
archive copy: sources-4/video-tools--avidemux-2.8.1.tar.gz
Dependencies
Depends on: cmake, make, pkgconf, nasm, patch, qt6-qtbase, qt6-qttools, qt6-qtwayland, sqlite, zlib, x264, x265, libvpx, opus, lame, twolame, libvorbis, faad2, libmad, libass, freetype2, fontconfig, fribidi, alsa-lib, libpulse, mesa, libglvnd, libX11, glu.
Required by: no port names it.
Optional, off in KDOS
These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
Patches
build.sh applies these; kpkg applies nothing by itself.
ffmpeg-mathops-shift.patch— Adds a patch toavidemux_core/ffmpeg_package/patches/upstream/, the list Avidemux applies to its FFmpeg, that hands x86 inline assembly inlibavcodec/x86/mathops.ha masked immediate when the shift count is a constant and%clotherwise. Under the link-time optimisation that FFmpeg build uses, a constant count outside 0 to 31 reaches the assembler, which rejects it (A shift count out of range in inline assembly).fluxsmooth-table-size.patch— Gives the FluxSmooth filter’sscaletab_MMXtable 65536 entries, the numberinitScaleTab()fills; declared with 65535, the table takes the loop’s last write past its end.mp4-menu-sentinel.patch— Ends the MP4 muxer’s format menu with an empty entry{}instead ofNULL, which musl’s C++ headers define asnullptrand which cannot initialise the entry’s integer field (NULLused as an integer).musl-glibc-calls.patch— musl has no<execinfo.h>and nocanonicalize_file_name(). The crash handler keeps its backtrace for glibc; on musl a crash reports its message and source line and exits. The data directories are resolved withrealpath(path, NULL), the POSIX equivalent (A glibc-only call on musl).no-update-check.patch— Sets the default of theupdate.enabledpreference to 0, so Avidemux does not ask avidemux.org for a newer release at every start. The preference turns it back on.qt6-moc-headers-only.patch— Leaves only headers in twoADM_QT_WRAP_CPPlists, the job control’s and the updater’s. Qt 6 refuses a.cppthere unless a target is named, and these two declare noQ_OBJECTclass, so moc has nothing to generate from them (A source file in a moc list).qt6-no-cxx11.patch— Drops the-std=c++11the GUI’sCMakeLists.txtadds, which lands after the C++17 that Qt 6 needs and wins (An older standard after CMake’s).x265-stat-filename.patch— x265’sparam.rc.statFileNameis a fixedchararray; the patch writes the two-pass log name into it withsnprintfinstead of assigning astrduped pointer (A library member whose type changed).
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/44_apps/phase.env && kpkg install avidemux'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/video-tools/avidemux.
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/video-tools/avidemux
echo '77d9bdca8683ce57c192b69d207cfab7cf92a7759ce0f63fa37b5c8e42ad3da2 avidemux-2.8.1.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/avidemux
SRC=$SRC_ROOT/avidemux-2.8.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf avidemux-2.8.1.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/no-update-check.patch"
patch -p1 -i "$PORT_SRC/ffmpeg-mathops-shift.patch"
patch -p1 -i "$PORT_SRC/musl-glibc-calls.patch"
patch -p1 -i "$PORT_SRC/qt6-moc-headers-only.patch"
patch -p1 -i "$PORT_SRC/qt6-no-cxx11.patch"
patch -p1 -i "$PORT_SRC/mp4-menu-sentinel.patch"
patch -p1 -i "$PORT_SRC/x265-stat-filename.patch"
patch -p1 -i "$PORT_SRC/fluxsmooth-table-size.patch"
_features="-DQT6=ON -DOPENGL=ON -DSDL=OFF
-DALSA=ON -DPULSEAUDIO=ON -DJACK=OFF -DARTS=OFF
-DESD=OFF -DOSS=OFF -DVDPAU=OFF -DNVENC=OFF -DXVIDEO=OFF
-DLIBVA=OFF -DVAPOURSYNTH=OFF -DX264=ON -DX265=ON
-DVPXENC=ON -DAOMDEC=OFF -DOPUS=ON -DOPUS_ENCODER=ON -DLAME=ON
-DVORBIS=ON -DLIBVORBIS=ON -DFAAD=ON -DFDK_AAC=OFF -DFAAC=OFF
-DTWOLAME=ON -DAFTEN=OFF -DDCAENC=OFF -DLIBDCA=OFF -DXVID=OFF
-DOPENCORE_AMRNB=OFF -DOPENCORE_AMRWB=OFF -DFREETYPE2=ON
-DFONTCONFIG=ON -DFRIBIDI=ON -DGETTEXT=OFF
-DTINYPY=ON -DUSE_EXTERNAL_LIBASS=ON -DUSE_EXTERNAL_LIBMAD=ON"
_part() {
cmake -S "$2" -B "$1" -G "Unix Makefiles" \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DFAKEROOT="$PKG" \
-DENABLE_QT6=True \
-DLRELEASE_EXECUTABLE=/usr/lib/qt6/bin/lrelease \
$_features "${@:3}" \
-Wno-dev
make -C "$1"
make -C "$1" DESTDIR="$PKG" install
}
_part buildCore avidemux_core
_part buildQt6 avidemux/qt4
_part buildCli avidemux/cli
_part buildPluginsCommon avidemux_plugins -DPLUGIN_UI=COMMON
_part buildPluginsQt6 avidemux_plugins -DPLUGIN_UI=QT4
_part buildPluginsCLI avidemux_plugins -DPLUGIN_UI=CLI
_part buildPluginsSettings avidemux_plugins -DPLUGIN_UI=SETTINGS
rm -rf "$PKG/usr/share/avidemux6/qt6/i18n"
cat > "$PKG/usr/share/applications/org.avidemux.Avidemux.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Avidemux
GenericName=Video Cutter
Comment=Cut, filter and re-encode video files
Exec=avidemux3_qt6 %f
Icon=org.avidemux.Avidemux
Terminal=false
StartupWMClass=avidemux3_qt6
Categories=AudioVideo;AudioVideoEditing;Video;
Keywords=video;cut;trim;encode;filter;avidemux;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.avidemux.Avidemux.desktop"
The switches, and why each is set:
-DCMAKE_POLICY_VERSION_MINIMUM=3.5— The parts’CMakeLists.txtfiles declarecmake_minimum_requiredfloors from 2.6 to 3.0, and the tree’s CMake 4 refuses any floor below 3.5 (see An old CMake policy floor).-DFAKEROOT="$PKG"— Where the later parts look for the core’s headers and CMake files. Each part is installed into$PKGbefore the next is configured.-DENABLE_QT6=True— With-DQT6=ONand-DLRELEASE_EXECUTABLE=/usr/lib/qt6/bin/lrelease: build the GUI and the Qt plugins against Qt 6, with Qt 6’slrelease.-DOPENGL=ON— and the rest of_features, the one list of features every part’s configure gets. Each is named, on or off, because a missing library otherwise drops its plugin with a configure message only. On: OpenGL, ALSA and PulseAudio output, x264, x265, libvpx, Opus with its encoder, LAME, Vorbis, FAAD, TwoLAME, FreeType, Fontconfig, FriBidi, the built-in tinyPy script engine, and the system’s libass and libmad in place of Avidemux’s copies. Off: SDL; JACK, aRts, ESD and OSS sound; VDPAU, NVENC and XVideo; VA-API, because Avidemux’s VA-API code needs libva’s X11 back end, which the libva port does not build; gettext; FDK AAC, left out so the build stays redistributable; and VapourSynth, AOM, FAAC, Aften, dcaenc, libdca, Xvid and OpenCORE AMR, which are not ports.
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/avidemux, 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 avidemux-2.8.1-1.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/avidemux, and runs the triggers its paths call for.
Contents
Installed programs: avidemux3_cli, avidemux3_jobs_qt6, avidemux3_qt6.
Installed libraries: libADM6avcodec.so, libADM6avformat.so, libADM6avutil.so, libADM6postproc.so, libADM6swscale.so, libADM_UIQT66.so, libADM_UI_Cli6.so, libADM_audioParser6.so, libADM_core6.so, libADM_coreAudio6.so, libADM_coreAudioDevice6.so, libADM_coreAudioEncoder6.so, libADM_coreAudioFilterAPI6.so, libADM_coreDemuxer6.so, libADM_coreDemuxerMpeg6.so, libADM_coreImage6.so, libADM_coreImageLoader6.so, libADM_coreJobs.so, libADM_coreMuxer6.so, libADM_coreScript.so, libADM_coreSocket6.so, libADM_coreSqlLight3.so, libADM_coreSubtitles6.so, libADM_coreUI6.so, libADM_coreUtils6.so, libADM_coreVideoCodec6.so, libADM_coreVideoEncoder6.so, libADM_coreVideoFilter6.so, libADM_openGLQT66.so, libADM_render6_QT6.so, libADM_render6_cli.so.
Installed directories: /usr/include/avidemux, /usr/lib/ADM_plugins6, /usr/share/ADM6_addons, /usr/share/avidemux6, /usr/share/licenses/avidemux.
Notes
- The build order.
_partconfigures, builds and installs one part into$PKG, and it is run in the order of upstream’sbootStrap.bash, each part against those installed before it: the core, the Qt 6 GUI, the command-line front end, then the plugins once for each interface (COMMON,QT4,CLIandSETTINGS;QT4is Avidemux’s name for its Qt interface, whatever the Qt version). - English only. The Qt translations under
/usr/share/avidemux6/qt6/i18nare removed; the interface falls back to its source strings. - The menu entry is replaced. Upstream’s runs
avidemux3_qt5, which this build does not make, and has noStartupWMClass. With no organisation domain set, Qt takes the Wayland app_id from the program name,avidemux3_qt6. It claims no MIME type: the video types belong to the players.