#17807·jellyfin

Plugin hooks for per-session FFmpeg audio filters and edit graphs

Author: mcorriganCreated Sep 6, 2026Updated Sep 29, 2026

I am willing to implement this and already have an open PR against master: https://github.com/jellyfin/jellyfin/pull/17808 (rebased onto current master).

Summary

Add optional plugin extension points so a plugin can, for a single playback session:

  1. Inject an FFmpeg -af audio filter (ISessionAudioFilterProvider)
  2. Supply a labeled -filter_complex graph instead of the stock A/V filter chain (ISessionMediaEditGraphProvider)
  3. Load session state before the first FFmpeg process starts (ISessionPlaybackPlanLoader)

If no plugin implements these (the default no-ops), encoding and playback are unchanged.

This is not a dashboard “extra FFmpeg args” field. Custom FFmpeg flags were removed in 10.8.13 after GHSA-866x-wj5j-2vf4 and declined again on features/2563. The hooks are typed plugin interfaces, not user-supplied command-line strings.

Motivation

Plugins cannot change the transcode graph today without forking EncodingHelper. That blocks server-side mute/cut (needed for Chromecast and other clients that cannot apply Media Segment Mute locally), and it also blocks optional transcode-time -af uses such as volume boost or a compressor.

Related demand (this issue does not implement those product features):

Proposed approach

  • New interfaces in MediaBrowser.Controller, with no-op implementations registered in ApplicationHost.
  • EncodingHelper keeps the original six-parameter constructor and adds an overload that takes the session providers, so existing call sites and ApiCompat stay intact while DI can inject the hooks.
  • HLS and progressive video call the plan loader, then ask for -af or a graph, before building the FFmpeg command.
  • Graph path is opt-in per session. If the plugin returns nothing, the stock filter path runs.
  • Plugin-supplied filter strings should be constrained (no free-form argument injection). Exact sanitization can be discussed in review.

I can split follow-up work (playback modifiers, subtitle cue remapping, trickplay) into later PRs. This issue is only the encode hooks.

Non-goals

  • User-configurable extra FFmpeg arguments in the UI or API
  • Forcing transcode for Direct Play
  • Implementing mute, loudnorm, EDL, or content filtering in core
  • Changing Media Segments metadata (providers already exist)

Testing

I have exercised the hooks with a plugin on a patched Jellyfin stack and rebased the PR onto current master. Hook unit tests pass locally (EncodingHelperSessionHooks, SDK 10); full PR CI is waiting on maintainer workflow approval.