Skip to content

background: add support for video wallpapers#908

Open
AteebXYZ wants to merge 39 commits intocaelestia-dots:mainfrom
AteebXYZ:video-wallpapers
Open

background: add support for video wallpapers#908
AteebXYZ wants to merge 39 commits intocaelestia-dots:mainfrom
AteebXYZ:video-wallpapers

Conversation

@AteebXYZ
Copy link

@AteebXYZ AteebXYZ commented Nov 12, 2025

Changes

  • Wallpaper.qml is now modularized into ImageWallpaper.qml and VideoWallpaper.qml, Wallpaper.qml handles the double-buffered switching between these 2 depending on filetype.

  • Added config options so that the user can chose to have audio playback with the video wallpaper or not.

  • filesystemmodel.cpp in Caelestia.Models has been edited to create 2 new filters called "ImagesAndVideos" and "Videos", services/Wallpapers.qml now uses the new "ImagesAndVideos" filter.

  • Added a C++ VideoThumbnailer backend used for caching video thumbnails to videothumbcache in the caelestia cache dir.

  • Dynamic colours for the shell are compatible with video files if paired with this pr in the caelestia cli: background: add support for video wallpapers cli#69

  • Video wallpapers are paused when the lock screen is active, and are completely unloaded and replaced with a placeholder when game mode is active

Side Effects

  • Noticible stutter on wallpaper change that includes a high quality video file
  • Stuttering, and wallpaper switching is slow

@AteebXYZ
Copy link
Author

I just realised that gifs can also be played in MediaOutput, I really dont know the side effects of doing this and if there are any problems, but for now it solves some part of this pr #889

@AteebXYZ AteebXYZ changed the title background: adds support for video wallpapers background: add support for video wallpapers Nov 13, 2025
@AteebXYZ
Copy link
Author

Transitions arent FULLY fixed, cant seem to figure out why MediaPlayer emits the media loaded signal even though some frames of black are being displayed in the beginning, also there is a noticeable lag when switching between video to image vice versa

@AteebXYZ AteebXYZ marked this pull request as ready for review December 13, 2025 12:32
@AteebXYZ
Copy link
Author

Just discovered that because i use MediaPlayer and VideoOutput for displaying the thumbnails of the videos in the wallpaper selector, gpu memory takes a huge hit, ill have to implement a way to cache the first frame of the video

@soramanew
Copy link
Collaborator

This looks great! It does have a few issues which you pointed out though, so I'll keep off merging it until you're done fixing those.

@AteebXYZ
Copy link
Author

AteebXYZ commented Jan 4, 2026

Okay i managed to fix the GPU memory spike but now the wallpaper menu is VERY unstable, things like opening the bottom right menu repeatedly (causes wallpaper selector to resize) crashes the shell. I have no idea whats causing this, my best guess is my c++ code not being optimal.

@soramanew
Copy link
Collaborator

There is a compiler warning, please fix it.

plugin/src/Caelestia/Models/filesystemmodel.cpp:313:17: warning: c++11 range-loop might detach Qt container (QList) [-Wclazy-range-loop-detach]
  313 |                 for (const auto& fmt : QImageReader::supportedImageFormats())
      |                 ^
1 warning generated.

Also, I ran into a few issues with certain wallpapers not having an animation when transitioning to/from them. Idk if it's dependent on the wallpaper, or an issue with something in the code (probably the latter cause without this pr they are fine). Also, when scrolling through the list quickly, the wallpapers are extremely slow to change, and at a certain speed do not change at all.

@AteebXYZ
Copy link
Author

There is a compiler warning, please fix it.

plugin/src/Caelestia/Models/filesystemmodel.cpp:313:17: warning: c++11 range-loop might detach Qt container (QList) [-Wclazy-range-loop-detach]
  313 |                 for (const auto& fmt : QImageReader::supportedImageFormats())
      |                 ^
1 warning generated.

Also, I ran into a few issues with certain wallpapers not having an animation when transitioning to/from them. Idk if it's dependent on the wallpaper, or an issue with something in the code (probably the latter cause without this pr they are fine). Also, when scrolling through the list quickly, the wallpapers are extremely slow to change, and at a certain speed do not change at all.

Hmm i didn't get this warning when compiling, but i fixed it regardless, could you provide me the correct cmake build command? And about the slow wallpaper switching, I probably have to come up with a way to load the videos in real time without blocking the GUI thread. Thanks for the input though, ill tell you when things are fixed.

@AteebXYZ
Copy link
Author

Now im considering to switch to mpvpaper to display videos instead of the Qt mediaplayer, ill probably have a c++ backend that will allow me to communicate with mpvpaper with IPC calls

@soramanew
Copy link
Collaborator

There is a compiler warning, please fix it.

plugin/src/Caelestia/Models/filesystemmodel.cpp:313:17: warning: c++11 range-loop might detach Qt container (QList) [-Wclazy-range-loop-detach]
  313 |                 for (const auto& fmt : QImageReader::supportedImageFormats())
      |                 ^
1 warning generated.

Also, I ran into a few issues with certain wallpapers not having an animation when transitioning to/from them. Idk if it's dependent on the wallpaper, or an issue with something in the code (probably the latter cause without this pr they are fine). Also, when scrolling through the list quickly, the wallpapers are extremely slow to change, and at a certain speed do not change at all.

Hmm i didn't get this warning when compiling, but i fixed it regardless, could you provide me the correct cmake build command? And about the slow wallpaper switching, I probably have to come up with a way to load the videos in real time without blocking the GUI thread. Thanks for the input though, ill tell you when things are fixed.

You probably aren't using clazy to build it, which is why you aren't getting those warnings.

@soramanew
Copy link
Collaborator

Now im considering to switch to mpvpaper to display videos instead of the Qt mediaplayer, ill probably have a c++ backend that will allow me to communicate with mpvpaper with IPC calls

Ehhhhhh, I don't really like the idea of using an external wallpaper display... Also I've heard that mpvpaper had some problems with memory leaks?

@AteebXYZ
Copy link
Author

AteebXYZ commented Jan 20, 2026

Now im considering to switch to mpvpaper to display videos instead of the Qt mediaplayer, ill probably have a c++ backend that will allow me to communicate with mpvpaper with IPC calls

Ehhhhhh, I don't really like the idea of using an external wallpaper display... Also I've heard that mpvpaper had some problems with memory leaks?

yeah an external tool feels unintuitive, but i had another idea, what if the wallpaper selector had 2 tabs, one for image wallpapers and the other for video wallpapers, that solves like 90% of the issues that are present

@soramanew
Copy link
Collaborator

The thing is, it's much more intuitive to only have one unified display for both video and image wallpapers. We could also do filtering, but that's a separate feature. I'll take a look at it and see what I can do in a bit.

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