Skip to content

Add an option to play live streams via inputstream.ffmpegdirect#709

Open
magne4000 wants to merge 1 commit into
anxdpanic:masterfrom
magne4000:feature/ffmpegdirect-live
Open

Add an option to play live streams via inputstream.ffmpegdirect#709
magne4000 wants to merge 1 commit into
anxdpanic:masterfrom
magne4000:feature/ffmpegdirect-live

Conversation

@magne4000

Copy link
Copy Markdown

Summary

Adds an optional, off-by-default live-playback backend. When enabled (and inputstream.ffmpegdirect is installed/enabled), live streams play through inputstream.ffmpegdirect instead of inputstream.adaptive / Kodi's direct player.

Motivation

ffmpegdirect uses ffmpeg's own demuxer and manages realtime buffering itself, which some devices and setups handle more reliably for Twitch live — for example it avoids the inputstream.adaptive live-HLS demuxer issues seen on some Kodi 22 / CoreELEC builds, and the occasional "cache full 100%" buffering stall.
This gives users an alternative without changing the default for anyone.

Changes

  • New setting Use inputstream.ffmpegdirect for live streams (General), default off.
  • utils.use_ffmpegdirect_for_live() — gated on the setting and on the add-on being
    installed/enabled.
  • routes/play.py — when enabled, sets the inputstream.ffmpegdirect properties for live
    playback (both a specific quality via the variant URL, and "Adaptive" via the master URL
    with auth headers passed through the ffmpeg |Header= suffix).

Backward compatibility

Purely additive. The setting defaults to off, so existing playback is unchanged unless the user opts in. Applies to live only — VODs and clips are untouched. The inputstream.adaptive path (including manifest_headers and the 1440p chooser) is preserved unchanged.

New strings

  • #30333 "Use inputstream.ffmpegdirect for live streams"

Testing

  • Live plays with the option off (unchanged behaviour)
  • Live plays with the option on, both "Adaptive" and a specific quality
  • Option on but add-on missing/disabled → falls back to default behaviour
  • VOD and clip playback unaffected in both modes

Adds an optional, off-by-default live-playback backend: when enabled (and
the add-on is installed/enabled), live streams play through
inputstream.ffmpegdirect instead of inputstream.adaptive / Kodi's direct
player. ffmpegdirect uses ffmpeg's own demuxer and manages realtime
buffering itself, which some devices and setups handle more reliably for
Twitch live -- for example it avoids the inputstream.adaptive live-HLS
demuxer issues seen on some Kodi 22 / CoreELEC builds and the occasional
"cache full 100%" buffering stall.

It is purely additive: the setting defaults to off, so existing playback is
unchanged unless the user opts in, and it applies to live streams only --
VODs and clips are untouched. Covers both a specific quality (variant URL)
and Adaptive (master URL, with auth headers passed via the ffmpeg |Header=
suffix); the inputstream.adaptive path (including its manifest_headers and
1440p chooser settings) is preserved for everyone who doesn't enable it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@apo86

apo86 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

I only tested for like 20 minutes, but so far it looks great.
This finally fixed the issue with "Enhanced Broadcast" streams as described here. For a good while now, none of the workarounds were working on my OSMC (Which is Kodi version 21.3 with Inputstream Adaptive 21.5.18).
With your new addon version and Inputstream FFmpeg 21.3.8 (which was already installed but disabled, no clue if it came like that with OSMC or I installed it manually at some point), I can now watch:

  • Regular streams with adaptive or fixed resolution in h264 up to 1080p
  • Enhanced broadcast streams with adaptive or fixed resolution in h264 or HEVC up to 1440p

So far no issues with buffering or drops.

Good stuff!

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.

2 participants