Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

207.1. ffmpeg-9.0.2

Record, convert and stream audio and video

Version 9.0.2, release 2
Shelf media-frameworks — Multimedia frameworks, capture, and media inspection
Phase 42_graphics (Graphics Stack), 37 of 189 in build order
Licence GPL-3.0-or-later
Homepage https://ffmpeg.org/
Build time 7.8 SBU
Installed size 43.4 MiB in 232 files
Recipe ports/core/media-frameworks/ffmpeg/kpkgbuild

About

FFmpeg records, converts and streams audio and video: the ffmpeg and ffprobe programs and the libav* libraries (codecs, formats, filters, devices, scaling and resampling) that mpv, GStreamer’s gst-libav, PipeWire, OBS Studio, Blender and most other media programs here are built on. It is built with the full codec set: H.264, HEVC, VP8/VP9 and AV1 encode and decode, JPEG XL, MP3, Opus, Vorbis, FLAC and LC3, with subtitle burn-in, HDR tone mapping, high-quality resampling, time-stretch, OCR, QR codes, the OpenCL filters, DVD and Blu-ray input, and hardware acceleration through VA-API and Vulkan. What a user gets from it is in Media, colour and time.

The binary and libraries are GPL-3.0-or-later. LICENSE.notice, beside the recipe, is the record of that choice and of every component’s licence, and the notice a redistributor should read.

Sources

Dependencies

Depends on: nasm, alsa-lib, zlib, bzip2, xz, gnutls, libdrm, libxml2, freetype2, fontconfig, harfbuzz, fribidi, libwebp, x264, x265, libvpx, svt-av1, dav1d, opus, libvorbis, libogg, lame, libass, libva, perl, vulkan-headers, glslang, spirv-headers, libplacebo, lcms2, liblc3, rubberband, libjxl, zimg, soxr, ocl-icd, opencl-headers, tesseract, qrencode, librsvg, libbluray, libdvdnav, libdvdread, vidstab.

Required by (50): audacious-plugins, audacity, baresip, blender, blind, calibre, celestia, chromaprint, cmus, ddnet, digikam, dosbox-x, dragon, ffmpegthumbs, firefox-esr, freerdp, glaxnimate, gst-libav, haruna, k3b, kdenlive, kfilemetadata, kpipewire, krita, librewolf, minidlna, mlt, mpd, mpv, mpv-mpris, obs-studio, opencv, openimageio, pencil2d, pipewire, ppsspp, qt6-qtmultimedia, ripgrep-all, schismtracker, sdrangel, shotcut, swayimg, thunderbird, timg, vlc, waypipe, whisper.cpp, wine, wlvncc, yazi.

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.

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/42_graphics/phase.env && kpkg install ffmpeg'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/media-frameworks/ffmpeg.

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/ffmpeg
echo '8c3850283eb25fa026482078a04051e0be17347b09ef81a0849bec15a96e002e  ffmpeg-9.0.2.tar.xz' | 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/ffmpeg
SRC=$SRC_ROOT/ffmpeg-9.0.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf ffmpeg-9.0.2.tar.xz -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:

export CFLAGS="$CFLAGS -frandom-seed=ffmpeg"
./configure \
	--prefix=/usr \
	--mandir=/usr/share/man \
	--disable-static \
	--disable-debug \
	--disable-stripping \
	--enable-shared \
	--enable-pic \
	--enable-lto=auto \
	--enable-pthreads \
	--enable-version3 \
	--enable-gnutls \
	--enable-libdrm \
	--enable-libfontconfig \
	--enable-libfreetype \
	--enable-libfribidi \
	--enable-libharfbuzz \
	--enable-libwebp \
	--enable-libxml2 \
	--enable-gpl \
	--enable-libx264 \
	--enable-libx265 \
	--enable-libvpx \
	--enable-libsvtav1 \
	--enable-libdav1d \
	--enable-libopus \
	--enable-libvorbis \
	--enable-libmp3lame \
	--enable-libass \
	--enable-libbluray \
	--enable-libdvdnav \
	--enable-libdvdread \
	--enable-vaapi \
	--enable-vulkan \
	--glslc=glslang \
	--enable-v4l2-m2m \
	--enable-alsa \
	--enable-bzlib \
	--enable-zlib \
	--enable-lzma \
	--enable-iconv \
	--enable-libplacebo \
	--enable-lcms2 \
	--enable-liblc3 \
	--enable-librubberband \
	--enable-libjxl \
	--enable-libzimg \
	--enable-libsoxr \
	--enable-opencl \
	--enable-libtesseract \
	--enable-libqrencode \
	--enable-librsvg \
	--enable-libvidstab \
	--enable-manpages \
	--disable-htmlpages \
	--disable-txtpages \
	--disable-sdl2 \
	--disable-vdpau \
	--disable-sndio \
	--disable-ffnvcodec \
	--disable-cuda-llvm \
	--disable-amf \
	--disable-libxcb \
	--disable-xlib
grep -q '^#define CONFIG_FFV1_VULKAN_ENCODER 1' config_components.h || {
	echo 'ffmpeg: no SPIR-V compiler was usable; the Vulkan filters are missing' >&2
	exit 1
}
make
make DESTDIR=$PKG install

The switches, and why each is set:

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/ffmpeg, 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 ffmpeg-9.0.2-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/ffmpeg, and runs the triggers its paths call for.

Other files in the port directory, read by build.sh: LICENSE.notice.

Contents

Installed programs: ffmpeg, ffprobe.

Installed libraries: libavcodec.so, libavdevice.so, libavfilter.so, libavformat.so, libavutil.so, libswresample.so, libswscale.so.

Installed directories: /usr/include/libavcodec, /usr/include/libavdevice, /usr/include/libavfilter, /usr/include/libavformat, /usr/include/libavutil, /usr/include/libswresample, /usr/include/libswscale, /usr/share/ffmpeg, /usr/share/licenses/ffmpeg.

Short descriptions

ffmpeg ffmpeg media converter
ffprobe ffprobe media prober
libavcodec.pc FFmpeg codec library
libavdevice.pc FFmpeg device handling library
libavfilter.pc FFmpeg audio/video filtering library
libavformat.pc FFmpeg container format library
libavutil.pc FFmpeg utility library
libswresample.pc FFmpeg audio resampling library
libswscale.pc FFmpeg image rescaling library

Notes

Every autodetected library is named on or off, so what ships does not depend on which ports happen to be installed first. FFmpeg’s --enable-libjack is off unless named, and it stays off: pipewire links FFmpeg, so FFmpeg cannot have PipeWire’s JACK, and its jack capture device is not built (see JACK programs on the host).

Everything that links FFmpeg, among them pipewire and gst-libav, takes on its GPL with it.