Skip to content

Add configurable fallback_rules system for selective local ffmpeg execution - #98

Open
jordanhillis wants to merge 2 commits into
joshuaboniface:masterfrom
jordanhillis:master
Open

Add configurable fallback_rules system for selective local ffmpeg execution#98
jordanhillis wants to merge 2 commits into
joshuaboniface:masterfrom
jordanhillis:master

Conversation

@jordanhillis

Copy link
Copy Markdown

Summary

This update adds a new configuration option, fallback_rules, that lets users define when rffmpeg should automatically use local fallback_ffmpeg / fallback_ffprobe instead of remote hosts.

Configuration Example

rffmpeg:
  commands:
    ffmpeg: /usr/lib/jellyfin-ffmpeg/ffmpeg
    ffprobe: /usr/lib/jellyfin-ffmpeg/ffprobe
    fallback_ffmpeg: /usr/local/bin/ffmpeg
    fallback_ffprobe: /usr/local/bin/ffprobe

  fallback_rules:
    - match: ["-vf blackframe", "-f null"]    # Intro Skipper
    - match: ["-f chromaprint"]               # Chromaprint

Use Case Example

In Jellyfin, the Intro Skipper plugin runs short analysis commands like:

ffmpeg -hide_banner -loglevel warning -threads 0 -ss 0 -i /FILE/NAME/HERE.mkv -to 339.945 -ac 2 -f chromaprint -fp_format raw -

Previously, these lightweight tasks were sent to remote transcode servers, adding unnecessary overhead.
With fallback_rules, such detection jobs now run locally via fallback_ffmpeg, while normal transcodes continue to use remote hosts.

Key Points

  • Uses substring matching on ffmpeg args (case-insensitive).
  • Runs matched commands locally using fallback binaries.
  • Fully backward-compatible when no rules are defined.

Example Log

[rffmpeg] Matched fallback rule: ['-vf blackframe', '-f null']

Added fallback rules for ffmpeg commands to handle errors gracefully.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant