Skip to content

feat: Layer live proxy media info on Stream Monitor + failover channel name#1089

Merged
sparkison merged 2 commits into
m3ue:devfrom
Warbs816:feat/stream-monitor-live-media-info
May 2, 2026
Merged

feat: Layer live proxy media info on Stream Monitor + failover channel name#1089
sparkison merged 2 commits into
m3ue:devfrom
Warbs816:feat/stream-monitor-live-media-info

Conversation

@Warbs816
Copy link
Copy Markdown
Contributor

@Warbs816 Warbs816 commented May 2, 2026

Summary

Builds on the Stream Monitor media badges added in 0146613. Layers two things on top:

  1. Live ffmpeg media info from the proxy overrides the stored ffprobe data per-field, so badges reflect what's actually being streamed right now rather than what was probed at sync time. Probe data still fills in fields the proxy doesn't expose (video profile, audio language, audio bitrate) and remains the sole source for plain HTTP-proxy streams that don't transcode.
  2. Failover channel name in the title — when on a failover URL the title renders as Primary → Failover with the failover name in orange, matching the existing Failover Active badge.

Closes #1085. Pairs with the proxy-side PR that publishes the live data: m3ue/m3u-proxy#54.

Supersedes #1088 (which was based on the previous dev HEAD before badges had landed there).

What changed

Live data layering (app/Filament/Pages/M3uProxyStreamMonitor.php)

The existing block that pulls getEmbyStreamStats() for media_info now also reads media_info from the proxy stream payload. Proxy keys are mapped to the editor's existing field shape:

Proxy field Editor field
resolution resolution
video_codec video_codec
fps source_fps
bitrate_kbps video_bitrate_kbps
audio_codec audio_codec
audio_channels audio_channels

array_filter strips empty live values so the merge only overrides where the proxy actually has data, keeping video_profile, audio_language, and audio_bitrate_kbps from the probe path. The blade renders unchanged keys, so no UI rework was needed.

Failover channel resolution

The active failover is identified by URL-matching current_url against PlaylistUrlService::getChannelUrl() for each candidate in failoverChannels. Static-list mode falls back to index lookup if the URL match fails. The dynamic resolver case (where the resolver skipped earlier candidates and current_failover_index doesn't line up with the candidate's slot) is the reason for the URL-match path — covered by a dedicated test.

failoverChannels is eager-loaded on the channel pre-fetch to keep this from regressing the page's N+1 budget.

Title display (blade)

Drops a Primary → Failover line into the existing title block when failover_channel.title is populated. Reuses the existing orange used by the Failover Active badge.

Test plan

  • Open Stream Monitor with a transcoded stream that has stored probe data — badges populate immediately from probe, then live values overlay on resolution/fps/bitrate within ~1-3s
  • Plain HTTP proxy stream — badges still show from probe data only (no live data path)
  • Stream with no probe data and no transcoding — no badges (as before)
  • Trigger failover — title shows Primary → Failover in orange; badges repopulate from the failover stream's live data once the new ffmpeg starts emitting Stream lines
  • Dynamic failover resolver with the first candidate skipped — title resolves to the actually used candidate, not the first one in the list

Warbs816 added 2 commits May 2, 2026 12:34
…ailover channel name

Builds on the existing Stream Monitor media badges by overlaying live ffmpeg
data (resolution, codec, fps, bitrate, audio codec/channels) from the proxy's
new media_info field on top of the stored emby/ffprobe stats. Live values win
where present; probe-only fields like video_profile and audio_language are
preserved. Plain HTTP-proxy streams that don't transcode keep using the probe
data, so badges still show.

Adds the failover channel name to the title in orange (Primary -> Failover),
identifying the active candidate by URL match. Static-list mode falls back to
index lookup; dynamic resolver mode (where current_failover_index doesn't
line up with the candidate's slot) is handled by the URL match.

Companion to the m3u-proxy live media_info work.
@sparkison
Copy link
Copy Markdown
Member

Looks great!

@sparkison sparkison merged commit 7cf1d6b into m3ue:dev May 2, 2026
4 checks passed
@Warbs816 Warbs816 deleted the feat/stream-monitor-live-media-info branch May 2, 2026 18:49
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