Skip to content

feat: raw MPEG-TS proxy, VA-API hardware decode, native video player#395

Closed
wowitsjack wants to merge 3 commits intoFredolx:mainfrom
wowitsjack:feat/mpeg-ts-native-player
Closed

feat: raw MPEG-TS proxy, VA-API hardware decode, native video player#395
wowitsjack wants to merge 3 commits intoFredolx:mainfrom
wowitsjack:feat/mpeg-ts-native-player

Conversation

@wowitsjack
Copy link

Summary

  • Raw MPEG-TS streaming proxy: Replace double-HLS architecture (ffmpeg → HLS segments → warp file server → HLS.js) with direct MPEG-TS streaming (ffmpeg stdout → tokio broadcast channel → warp HTTP endpoint → native <video>). Eliminates manifest caching issues and reduces latency.

  • VA-API hardware video decode on Linux: Set WEBKIT_GST_ENABLE_LEGACY_VAAPI=1 and boost vaapih264dec/vah264dec decoder ranks to MAX so GStreamer actually selects hardware decoders. Add HardwareAccelerationPolicy::Always for WebKitGTK. CPU usage drops from ~80% to ~10% on Intel GPUs.

  • NVIDIA-only DMABUF disable: WEBKIT_DISABLE_DMABUF_RENDERER=1 was being set for all GPUs. Now only set for NVIDIA (where it's actually needed), allowing other GPUs to use hardware rendering.

  • Native video player: Drop HLS.js dependency entirely, use native <video> element with video.src pointed at the MPEG-TS stream. Simpler pipeline, fewer failure modes.

  • Redirect resolution: HEAD request follows 302 chains to detect HLS streams behind redirects (e.g. tvpass.org → .m3u8), enabling direct playback without the proxy.

  • Mute fix: Use video.muted property instead of video.volume = 0, persist mute state across stream changes.

Test plan

  • Play a channel that requires the proxy (non-HLS, custom headers)
  • Play a direct HLS channel (.m3u8 URL)
  • Play a redirect chain channel (e.g. tvpass.org URLs that 302 to .m3u8)
  • Verify mute button works and persists when switching channels
  • Check CPU usage during playback on Linux (should be ~10-15% with VA-API)
  • Verify NVIDIA GPUs still get DMABUF disabled
  • Verify non-NVIDIA GPUs get VA-API decoders enabled

wowitsjack added 3 commits March 8, 2026 03:08
Add HLS.js-based web player and embedded MPV engine for in-app
video playback. Local MPEG-TS proxy via ffmpeg+warp for streams
that need transcoding. Engine selection in settings.
Add HEAD-request URL resolution for redirect streams. Broadcast-based
ffmpeg lifecycle with proper cleanup. VA-API hardware decode support
via inline player. Local proxy monitor for automatic restart.
WebKitGTK GPU compositor spins constantly when forced to Always,
causing ~30% idle CPU. Leave at default OnDemand so it only
activates during video playback.
@wowitsjack wowitsjack force-pushed the feat/mpeg-ts-native-player branch from 6bbe47b to 0c4edc7 Compare March 7, 2026 17:11
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


wowitsjack seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@wowitsjack
Copy link
Author

Superseded by #396 + #397 which contribute the full FredTV-Next codebase as a proper 2-part stack.

@wowitsjack wowitsjack closed this Mar 7, 2026
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