Conversation
Add libavcodec, libavformat, libavutil, and libswscale to the pkg_check_modules dependency list to support native video decoding in the background widget.
Extend the background widget to natively decode and display video files (mp4, mkv, webm, avi, mov, gif, and more) using FFmpeg, with no external tools required. - Detection is extension-based; existing image paths are unaffected - A background decode thread paces frames to their PTS timestamps and publishes them to the render thread via an O(1) mutex-swap, avoiding any memcpy per frame - sws_getCachedContext handles codecs that only report their pixel format after the first decoded frame - Videos loop seamlessly via av_seek_frame at EOF - blur_passes works on video frames the same as on images - No new config keys: path = /path/to/video.mp4 is sufficient
Move FFmpeg decode thread, frame buffering, and lifecycle management out of CBackground into a dedicated CVideoBackend class. Background.hpp no longer includes FFmpeg headers. CBackground interacts with video purely via open(), swapFrame(), and frameW/H().
ffmpeg is included conditionally via withVideoBackend (default true), allowing packagers to opt out by passing withVideoBackend = false, which also passes -DVIDEO_BACKEND=OFF to cmake.
Add VIDEO_BACKEND cmake option (default ON) that controls whether FFmpeg is required and video playback is compiled in. When OFF, VideoBackend.cpp is excluded from the build and all video code paths in Background are gated by HYPRLOCK_HAS_VIDEO, allowing a no-FFmpeg build for packagers who want to ship without the dependency.
|
build failure is just lack of ffmpeg dependency, I have two commits that will resolve it
|
Upstream hyprutils uses Log::log(Log::ERR, ...) rather than the older Debug::log(ERR, ...) pattern. Update VideoBackend.cpp to match.
Follow upstream change (4e4f03c) which migrated from Debug::log to Log::logger->log via Hyprutils::CLI.
Log::LOG does not exist in the Hyprutils::CLI log level mapping. Use Log::INFO instead.
|
apologies for commit spam, the change in log::log arrived mid work on this. hyprlock-demo-trimmed.mp4video of what this allows, as eye candy |
|
I have nothing against it in particular. But I have been telling people to use this method with Hyprland, which allows for this feature without support in hyprlock:
index 2e28cb5a2e..5807e4ea04 100644
--- a/assets/example.conf
+++ b/assets/example.conf
@@ -35,8 +35,9 @@
background {
monitor =
- path = screenshot
- blur_passes = 3
+ path =
+ blur_passes = 0
+ color = rgba(00000000)
}
input-field {
The PR has some minor style issues, e.g. Single line if's, too much code in the Background widget. I am also a bit worried about memory safety in the decode thread. Otherwise it looks ok from a first glance. |
|
yea I appreciate that works, but it didn't seem to me to be the way a lock screen should work with a transparent background and then requiring another programs overlay. I can keep this maintained for personal use, and if you want it upstream I am happy to push |
|
I did build this version and is working great. I have been using this for over a week and haven't run into any issue. Edit 1: |
|
I'll maintain it for the foreseeable, but as we all know that's not forever as I get into other work streams |
given this another stab, hopefully this will make it easier to merge in future