ghostlexly / gpu-video-wallpaper Goto Github PK
View Code? Open in Web Editor NEWUse your GPU for rendering low CPU usage video animated wallpaper.
License: MIT License
Use your GPU for rendering low CPU usage video animated wallpaper.
License: MIT License
On my computer vlc plays 4k videos utilizing only 6% of one core, while mpv uses about 60%. My pc is built on Ryzen 5 3400G. Can this script run with vlc as the backend?
I tried myself but I think vlc does not have a thing similar to -wid
parameter.
OS: Linux Mint 21.1 x86_64
Host: Dell G15 5520
Kernel: 5.15.0-60-generic
Resolution: 1920x1080
DE: Cinnamon 5.6.7
WM: Mutter (Muffin)
WM Theme: Numix-Cinnamon-Transparent (Mint-Y)
Theme: Adapta-Nokto [GTK2/3]
Icons: Mint-Y-Aqua [GTK2/3]
CPU: 12th Gen Intel i5-12500H (16) @ 4.500GHz
GPU: NVIDIA GeForce RTX 3050 Mobile
GPU: Intel Alder Lake-P
Memory: 2700MiB / 31789MiB
When, either in the GUI or from the command line, if I start the application I get it running on all three monitors, however, stop will only kill it on one. I took a look at the code and found that one PID was stored in the settings file. I created a branch and fixed the code to store the PIDS in an array and made the stop function iterate over the array to kill multiple PIDS - It will even store and source the array successfully in the settings file. I also restructured the bash code to flow a little more easily, added the use of GNU getop, and modified the python script accordingly. I have the code committed locally on the new branch and just need permission to submit a pull request.
Let me know if you're interested in my modifications and I'll send you my public key so I can set my branch upstream.
Just opens a window (mpv) that plays the video, not as background.
(dwm)
Kernel: 6.3.6-artix1-1
arch: x86_64
Desktop: bspwm v: 0.9.10
Distro: Artix Linux
video-wallpaper.sh --start ~/Videos/<video>
The wid option must be an integer: WID
Error parsing option wid (option parameter could not be parsed)
Setting commandline option --wid=WID failed.
Exiting... (Fatal error)
mpv died, exit status 1
I have one monitor.
If I understood correctly these are the commands that will be executed:
xrandr | grep " connected\|\*" | pcregrep -o1 '([0-9]{1,}[x]{1,1}[0-9+]{1,}) \('
3840x2160+0+0
xwinwrap -g 3840x2160+0+0 -fdt -ni -b -nf -un -o
xwinwrap: Error: couldn't create command line
...
I installed this app from the AUR:
aur/ghostlexly-gpu-video-wallpaper 2021.11.26.r9.g8773e95-1 [installed]
In the install script, it checks if python3-pyqt5 (among other things) is on the system, and requests to install them if they are not.
Of course, on non-Debian platforms, apt does not work, so it cannot possibly install on the operating system.
There is another issue, which is that on Arch Linux, python3-pyqt5 actually goes by python-pyqt5-- so even if the dependency is met, the installer can't find it.
If you respond with 'n', the install script stops, which means that a non-Debian user won't be able to install the program. I argue that the install script should allow the user to continue the installation even if dependencies aren't met-- let the python program throw an error if issues arise.
Of course, the easy workaround for non-Debian users is just to respond with 'y'. The script attempts to install with apt, fails, but carries on (which I would guess is unintended behavior). If you do meet the dependency, the rest of the install script won't have any issues.
The script uses:
confdir="/home/$USER/.config/video-wallpaper"
But sometimes it is not there, e.g. in my case it would be /$USER/.config/video-wallpaper
.
Can you use $HOME instead?
confdir="$HOME/.config/video-wallpaper"
This results in a broken GUI as well with the following error message: "missing dependencies: ['xwinwrap']. Please run the installer again." I'm quite certain that the installer doesn't install anything at all, and only displays the first error message it gets to.
I often need to work from my laptop without access to my charger, and so running mpv in the background with default settings all the time is a serious battery drain.
Fortunately, mpv can be easily configured to reduce power-- especially in this case, when one does not need to worry about things like video/audio desync, cutting out some of the superfluous mpv features goes a long way.
I'm just opening this issue to share my mpv config optimized for this script in particular, in case other users have the same needs. In your local mpv config location (either ~/.config/mpv/mpv.config or /etc/mpv/mpv.config), add to your config the following profile:
[lowpower]
profile-desc = "Profile designed to run mpv and minimize battery usage, perfect for using mpv for backgrounds and whatnot. Set for files with no audio"
deband=no
gpu-dumb-mode=yes
hwdec=auto-safe
hwdec-codecs=all
interpolation=no
osc=no
terminal=no
video-sync = display-desync
vo=gpu
vd-lavc-fast
vd-lavc-skiploopfilter=all
ytdl=no
Of course, you have to enable the profile for this to work. In the video-wallpaper.sh script, adding the --profile=lowpower flag to the xwinwrap call will do exactly this.
Obvious caveat: I can't guarantee this profile will work on all computers. If mpv does not work with this profile, try removing the hwdec-codecs=all line or the vo=gpu line. In terms of performance, this reduced my power usage to 3% of the original power usage (even lower than my compositor!), and I didn't notice a significant drop in quality.
I don't think I could in good faith suggest adding any of these flags to the default behavior in the repo. That being said, these options can be toggled directly by just adding the flag to mpv. The safest options are:
I think vd-lavc-skiploopfilter is also safe too.
I hope this helps!
Hello!
I installed this on my older Ubuntu 20.04 LTS and it worked beautifully with little hiccups (sometimes it wouldn't autostart but it was no big deal).
On my fresh install of Ubuntu 21.10 using default Wayland instead of X11 (not sure if this is the issue) 3 things happen:
Hello when I run this command ./install.sh --distro-agnostic
i got this error bash: ./install.sh: cannot execute: required file not found.
Can you fix this please?
I like what this can achieve, however when I run this it is using 65-80% of each four cores on my cpu. I am running an i-5 6600k, 16GB RAM and GTX1070. I don't know if this is expected behaviour.
It opens the video file in MPV.
I have created an AppImage which launches the GUI front-end.
This has the following benefits:
1. Adds support for non-Debian based distributions.
2. No need to install dependencies so install.sh
is no longer needed.
3. User-friendliness.
You can download the AppImage here, I have attached all the files namely the .AppDir and the AppImage itself:
https://drive.google.com/drive/folders/1JPhaRby7Rjx3fO53JrH37a3wVKuT6O-8?usp=sharing (link is outdated, use my fork)
Edit: Python3-Pyqt5 dependency is not resolved. Please install it on your system, I'll try to fix this later (this is now fixed)
AppImage is not feasible for this project. Please close this thread.
For example this is what the startup command looks like:
bash -c '"/home/ryan/.local/bin/video-wallpaper.sh" --start "true /home/ryan/Videos/2160p.mp4"'
Which was throwing this error:
The legacy option syntax ('-wid value') is deprecated and dangerous.
Please use '--wid=value'.
[file] Cannot open file 'true /home/ryan/Videos/2160p.mp4': No such file or directory
Failed to open true /home/ryan/Videos/2160p.mp4.
Exiting... (Errors when loading file)
mpv died, exit status 2
The work-around is of course to remove the true
from the video file path
I am getting the following error when trying to run from command line (bash).
~/gpu-video-wallpaper$ The wid option must be an integer: %WID
Error parsing option wid (option parameter could not be parsed)
Setting commandline option --wid=%WID failed.
Exiting... (Fatal error)
mpv died, exit status 1
By changing %WID
to WID
in video-wallpaper.sh
it will run, but just in a normal, tiny mpv window with video controls, not as a wallpaper.
hi all, when i start the video wallpaper all my icons are gone, i guess this happens because the video is loaded in a similiar way as VLC does, is there a way to keep the icons on the desktop as wallpaper engine does?
When setting it up with KDE, it does work correctly untill I click the background. At that moment the plasma reloads, and the video wallpaper is dead; instead regular wallpaper is shown.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.