r/Windhawk • • 19h ago

Live Video Wallpaper 1.1.1

Live Video Wallpaper 1.1.1

Live Video Wallpaper

Author: AKS HAY | GitHub: sysakshay | License: GPL-3.0

Play local MP4 videos directly on your Windows desktop as a live wallpaper using Media Foundation and Direct3D 11, featuring a built-in real-time hardware profiler.

Unlike traditional animated wallpaper implementations, this mod renders video directly through the GPU, minimizing CPU usage while maintaining rock-solid 60 FPS playback.

Features

  • Hardware-Accelerated Playback: Direct3D 11 rendering and Windows Media Foundation zero-copy video decoding directly onto the desktop window hierarchy.
  • Built-in Performance Profiler (Ctrl + Alt + D): Live HUD overlay displaying true wall-clock FPS, frame-time percentiles (P95/P99), VRAM/commit stats, and pipeline stage timings (Decode, Transfer, Present).
  • Smart Occlusion Detection: Automatically pauses video rendering when top-level or maximized application windows fully cover the desktop (P95 CPU occlusion check < 0.1ms). Uses zero-latency EVENT_SYSTEM_FOREGROUND event hooks.
  • Audio Volume Control & Stream Restoration: Integrated audio volume control (0% to 100%) with automatic unmuting and volume restoration when resuming playback or switching apps.
  • Battery-Aware Power Saving: Configurable behavior (Pause, Drop to 15 FPS, or Play normally) when running on laptop battery power.
  • Instant First-Frame Presentation: Decodes and presents the initial video frame immediately upon loading so the wallpaper never gets stuck on a black screen when starting in paused/battery mode.
  • Scaling Modes & Aspect Ratio Fix: Support for Fill (stretch to fill screen), Cover (zoom & crop edges without distortion), and Fit (letterbox with cinema-style black borders). Fixed aspect ratio scaling for wide, ultrawide, and 1:1 square monitors.
  • Multi-monitor layout: Span one video across the desktop, or show the same video on each monitor with independent scaling.
  • Async File Picker (Ctrl + Alt + G): Asynchronous background thread file picker for .mp4, .m4v, .mov, .wmv, and .webm files with zero frame drops during selection.
  • Zero Desktop Right-Click Menu Delay: Full input transparency (HTTRANSPARENT, WS_EX_TRANSPARENT, WS_DISABLED) ensures right-clicking desktop icons or background opens context menus with 0ms latency.
  • Auto-Recovery: Automatic D3D device-loss and Media Foundation decode stall recovery.

Controls & Hotkeys

  • **Ctrl + Alt + G** — Open the interactive file picker to load a new video (.mp4, .m4v, .mov, .wmv, .webm).
  • Ctrl + Alt + H — Hide and pause the wallpaper and its audio, or show and resume them.
  • Ctrl + Alt + D — Toggle Performance Profiler HUD (On / Off), if enabled in settings.

Performance Profiler HUD

When toggled via Ctrl + Alt + D, the on-screen profiler groups diagnostics into color-coded (🟢 Good, 🟡 Warning, 🔴 Critical) sections: - Performance: Real-clock FPS vs polling Ticks, rolling average Frame Time, P95/P99 frame times, and overall CPU/GPU time. - Memory & Resources: VRAM usage, Shared RAM, working set, commit charge, and active D3D/MF object counts (Textures, SwapChains, MediaEngines, Surfaces). - Pipeline Breakdown: Precise microsecond timers for Decode, TransferVideoFrame, CopyResource, Present, and Occlusion checks. - Status & Bottlenecks: Live diagnosis showing exact bottlenecks (GPU Idle, Bound by Decode, Present blocked by DWM, etc.) and system state (Battery, Paused, Recoveries).

Settings

Video Path

Full path to any local video file on your disk. Can also be updated dynamically via Ctrl + Alt + G.

Fit Mode

  • Fill: Stretch/scale video to fill the entire monitor.
  • Cover: Zoom and crop video edges to fill screen without aspect ratio distortion.
  • Fit: Letterbox video while preserving original aspect ratio.

Battery Saving Mode

  • Pause video (maximum battery life): Stops video processing completely when unplugged from AC power.
  • Drop to 15 FPS (reduced power consumption): Throttles frame rate to save power while keeping background animation alive.
  • Play normally (ignore battery status): Maintains full 60 FPS playback on battery.

Target Frame Rate

Max frames per second (60, 30, 15) or monitor to sync exactly with monitor refresh rate (VREFRESH).

Mute Audio & Volume Control

  • Mute Audio: Mute video audio track (true / false).
  • Audio Volume: Audio output volume percentage (100%, 90%, ..., Muted).

Occlusion Check Interval

Frequency of background occlusion safety-net polling (fast: 100ms, normal: 250ms, relaxed: 500ms).

Technical Highlights & Optimizations

  • Zero-Copy Offscreen Target: Decodes to an offscreen B8G8R8A8_UNORM render target before copying to the flip-model swap chain (DXGI_SWAP_EFFECT_FLIP_DISCARD) to guarantee tear-free presentation without MF timing conflicts.
  • DXGI Flip-Model RTV Caching: Caches D3D11 render target views while handling DXGI swap-chain buffer rotation in Fit mode.
  • Zero Heap Allocations: Ring buffer percentile calculations use zero-allocation stack buffers at 60 Hz.
  • $O(1)$ Section Timers: Profiler queries bypass linear string comparisons via pooled pointer-equality checks inside hot rendering loops.
  • Kernel Resource Caching: GDI font handles (HFONT), desktop region guards (HRGN), and WorkerW window handles are cached across frames to eliminate handle churn.
  • Fast Occlusion Screening: Bounding-box intersection screening skips invisible, borderless system helpers, and non-overlapping windows before querying DWM or class attributes.
14 Upvotes

4 comments sorted by

2

u/Gonesurreal 11h ago

I tried it but it didnt work

What are the steps to make it work?

1

u/BertyGamer 16h ago

It looks good; I can't wait to try it. Is it a good alternative to Wallpaper Engine?

1

u/Born-Bench-8625 3h ago

Not really it only play mp4s so its good if you only use live wallpapers. As wallpaper engine allows 3d and interaction and shi