Skip to content

[feature-request] [patch] Enable libxml2 and enable DASH demuxer (MPD manifests) #256

@PhiSYS

Description

@PhiSYS

Background

I tried to feed a MPD manifest as ffmpeg input file (-i), as some real time capture utilities enabled for streaming use this format.
Ffmpeg errors because it's an unsupported file.

In my case it was a game clip recorded with the Steam built-in recordings feature, but it also enables to process MPD streaming manifests from the net.

Patch

Including this code in the build-ffmpeg script just did the trick (if you willing to incorporate):

if build "libxml2" "2.15.1"; then
  download "https://gitlab.gnome.org/GNOME/libxml2/-/archive/v$CURRENT_PACKAGE_VERSION/libxml2-v$CURRENT_PACKAGE_VERSION.tar.gz"
  execute ./autogen.sh --prefix="${WORKSPACE}"
  execute ./configure CFLAGS="-O2 -fno-semantic-interposition ${CFLAGS}" --prefix="${WORKSPACE}" --enable-static --disable-shared
  execute make -j $MJOBS
  execute make install
  build_done "libxml2" $CURRENT_PACKAGE_VERSION
fi
CONFIGURE_OPTIONS+=("--enable-libxml2" "--enable-demuxer=dash")

Checking:

ls
chunk-stream0-00001.m4s  chunk-stream0-00003.m4s  chunk-stream1-00002.m4s  init-stream0.m4s  session.mpd
chunk-stream0-00002.m4s  chunk-stream1-00001.m4s  chunk-stream1-00003.m4s  init-stream1.m4s
ffmpeg -i "session.mpd" -c:v libsvtav1 -preset:v 4 -svtav1-params "tune=0:film-grain=8:film-grain-denoise=1:enable-variance-boost=1:variance-boost-strength=2:variance-octile=6:crf=36" -g 720 -c:a libopus -b:a 96k "session.webm"
ffmpeg version 8.0 Copyright (c) 2000-2025 the FFmpeg developers
  built with gcc 13 (Ubuntu 13.3.0-6ubuntu2~24.04)
  configuration: --enable-nonfree --enable-gpl --enable-libxml2 --enable-demuxer=dash --enable-openssl --enable-libdav1d --enable-libsvtav1 --enable-libx264 --enable-libx265 --enable-libvpx --enable-libxvid --enable-libvidstab --enable-libaom --enable-libzimg --enable-lv2 --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libtheora --enable-libfdk-aac --enable-libsoxr --enable-libjxl --enable-libwebp --enable-libfreetype --enable-vapoursynth --enable-libsrt --enable-libzvbi --enable-libzmq --enable-vulkan --enable-libglslang --disable-ffnvcodec --enable-amf --enable-opencl --disable-debug --disable-shared --enable-pthreads --enable-static --enable-version3 --extra-cflags='-I/app/workspace/include -Wno-int-conversion -I/app/workspace/include/lilv-0' --extra-ldexeflags= --extra-ldflags=-L/app/workspace/lib --extra-libs='-ldl -lpthread -lm -lz' --pkgconfigdir=/app/workspace/lib/pkgconfig --pkg-config-flags=--static --prefix=/app/workspace --extra-version=
  libavutil      60.  8.100 / 60.  8.100
  libavcodec     62. 11.100 / 62. 11.100
  libavformat    62.  3.100 / 62.  3.100
  libavdevice    62.  1.100 / 62.  1.100
  libavfilter    11.  4.100 / 11.  4.100
  libswscale      9.  1.100 /  9.  1.100
  libswresample   6.  1.100 /  6.  1.100
Input #0, dash, from 'session.mpd':
  Duration: 00:00:06.00, start: 0.000000, bitrate: 2 kb/s
  Program 0 
  Stream #0:0: Video: hevc (Main) (hev1 / 0x31766568), yuvj420p(pc, bt709), 1920x1080, 138741 kb/s, 60.67 fps, 60 tbr, 1000k tbn (default)
    Metadata:
      variant_bitrate : 12000000
      id              : 0
  Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 314 kb/s, start 0.010542 (default)
    Metadata:
      variant_bitrate : 128000
      id              : 1
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> av1 (libsvtav1))
  Stream #0:1 -> #0:1 (aac (native) -> opus (libopus))

# ...

Success!

BTW I did not make a new Pull Request, because I didn't care for GPL & non-free conditions... and to avoid forking and stuff 😅 Sorry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions