Coder Social home page Coder Social logo

gpu-video-wallpaper's People

Contributors

ghostlexly avatar greenhandzdl avatar nayamamarshe avatar swallowyourdreams avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gpu-video-wallpaper's Issues

Vlc based version

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.

"stop" only kills 1 of three monitors

Setup:

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

Issue and solution

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.

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.

mpv died, exit status 1

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]

Install script not cross-platform compatible

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.

environmental variable $HOME for home dir

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"

xwinwrap is not installed after running ./install.sh

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.

Tips for Battery Optimization

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:

  • interpolation=no
  • video-sync=display-desync (disables audio/video syncing, which is unnecessary for this anyway)
  • hwdec=auto-safe (enables hardware decoding, the "safe" aspect is supposed to prevent issues if codecs aren't available)
  • vd-lavc-fast (uses optimizations which make small sacrifices in video quality)

I think vd-lavc-skiploopfilter is also safe too.

I hope this helps!

wallpaper does not zoom to fit screen

using a wallpaper without a resolution matching that of the monitor results in large black bars appearing instead of simply zooming in the wallpaper. this could be a problem for setups with multiple monitors of differing resolutions

image

21.10 Fresh Ubuntu Install Wayland - 3 Malfunctions

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:

Screenshot from 2022-03-10 22-41-34

  1. I get two videos on top of each other on my main laptop screen (I use dual screen - 1 extra attached to my laptop)
  2. No autostart
  3. Everytime I move my mouse there is a media player top and bottom that shows up (see attached)
    In Ubunbut 20.04 this never happened.

CPU usage high

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.

[Suggestion] Adding support for other distros via AppImage.

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.

When selecting auto start the video path has `true` inserted before the actual path

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

Program throwing error on Ubuntu 22.04.3 LTS

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.

icons disappers when starting the video 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?

KDE Error: Kills video on click

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.