GithubHelp home page GithubHelp logo

luisbocanegra / plasma-smart-video-wallpaper-reborn Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 1.0 3.76 MB

Smart Video Wallpaper for KDE Plasma 6

Home Page: https://store.kde.org/p/2139746

License: GNU General Public License v2.0

QML 95.12% CMake 3.71% Shell 1.18%
blur kde kde-plasma linux-desktop live-wallpaper lockscreen plasma plasma6 video-wallpaper

plasma-smart-video-wallpaper-reborn's Introduction

Smart Video Wallpaper Reborn

Plasma 6 Wallpaper plugin to play videos on your Desktop/Lock Screen.

demo.mp4

Features

  • Play a single video or slideshow of videos
  • Enable/disable video sound
  • Lock screen support
  • Pause Video conditions
    • Maximized or fullscreen window
    • Active window
    • Window is present
    • Never
  • Blur
    • Conditions
      • Maximized or fullscreen window
      • Active window
      • Window is present
      • Video is paused
      • Always
      • Never
    • Radius
  • Battery
    • Pauses video
    • Disables Blur
  • Pause video when screen is Off/Locked

Installing

Install the plugin from the KDE Store Plasma 6 version

  1. Right click on the Desktop > Configure Desktop and Wallpaper... > Get New Plugins
  2. Search for "Smart Video Wallpaper Reborn", install and set it as your wallpaper.
  3. Click on Add new videos pick your video(s) and apply.

To set as Lock Screen wallpaper go to System settings > Screen Locking > Appearance: Configure...

This plugin requires correctly setup Media codecs

Improve performance by enabling Hardware Video Acceleration

Hardware video acceleration makes it possible for the video card to decode/encode video, thus offloading the CPU and saving power.

First, verify acceleration you can install and run nvtop, it will show a decoding usage when Hardware acceleration is working:

nvtop hw video decoding

If nvtop is not available you can use:

  • intel_gpu_top from intel-gpu-tools for Intel GPU (video engine)
  • nvidia-smi dmon for Nvidia GPU (dec column)
  • amdgpu_top for AMD GPU (dec column)

If there is no decoding usage you will have to enable video acceleration in your system

Black video or Plasma crashes

There may be some issues with Qt Causing crashes on AMD GPUs, this is currently being investigated in QTBUG-124586 - QML video media player segmentation fault on AMD GPU with FFMPEG and Black screen with gstreamer as Qt Media backend (Recent KDE Neon update)

To recover from crash remove the videos from the configuration using this command below in terminal/tty

sed -i 's/^VideoUrls=.*$/VideoUrls=/g' $HOME/.config/plasma-org.kde.plasma.desktop-appletsrc $HOME/.config/kscreenlockerrc

then reboot or restart plasmashell systemctl --user restart plasma-plasmashell.service or plasmashell --replace if the former doesn't work.

Possible solution, switching to GStreamer as Qt Media backend

  1. Install the media codecs and qt6-multimedia and gstreamer packages if you don't have them:

    openSUSE

    sudo zypper install opi
    opi codecs
    sudo zypper install qt6-multimedia gstreamer-plugins-libav

    Arch

    sudo pacman -S qt6-multimedia qt6-multimedia-gstreamer gst-libav --needed

    If you need extra codecs see https://wiki.archlinux.org/title/GStreamer

    PRs to expand this list are welcome :)

  2. Reboot

  3. If after that the video doesn't play, fails to loop or crashes your Desktop (remove the plugin configuration using sed command above if needed), try switching the Qt Media backend to gstreamer (default is ffmpeg):

    Create the file ~/.config/plasma-workspace/env/qt-media-backend.sh

    #!/bin/bash
    export QT_MEDIA_BACKEND=gstreamer
  4. Reboot again to apply the changes, and verify it was correctly set by running echo $QT_MEDIA_BACKEND

Video still doesn't play/keeps crashing? Follow these steps

  1. Run journalctl -f > journal.txt and sudo dmesg -wHT > dmesg.txt in separate terminals
  2. While both commands are running switch from the Image wallpaper plugin to video wallpaper and reproduce the issue
  3. Then stop both commands
  4. If needed, remove the plugin configuration (sed command above)
  5. Get your system information from kinfo > sysinfo.txt command or from System settings > About this System
  6. Save the file from here as test.qml. Run the test qml with from terminal QT_FFMPEG_DEBUG=1 QSG_INFO=1 QT_LOGGING_RULES="*.debug=true" qml6 test.qml 2> qml_video_test_log.txt , (qml6 may be qml-qt6 or /usr/lib/qt6/bin/qml please confirm is qt6 one with --version) this file will play some public test videos from internet in fullscreen. If it doesn't crash immediately, try clicking the pause/next buttons a bunch of times.
  7. Run lspci -k | grep -EA3 'VGA|3D|Display' > lspci.txt
  8. Create a new new issue describing the problem and how to reproduce, and attach those files including wether running the test.qml also crashes or not.

Acknowledgements

This project a rewrite based on adhec/Smart Video Wallpaper and PeterTucker/smartER-video-wallpaper projects.

plasma-smart-video-wallpaper-reborn's People

Contributors

adhec avatar luisbocanegra avatar schlaefer avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

kostek001

plasma-smart-video-wallpaper-reborn's Issues

Video black screen on desktop

2024-03-17.15-54-14.mp4

This is what I get from journalctl -f:

plasmashell[3069178]: vaExportSurfaceHandle failed

Contributing Guide

Hey this applet you made is awesome. Could you add some documentation on how to contribute? I have a similar project I have been using that is a webpage equivalent of this and I think you have a good codebase but I also really like some of the small features my current solution has and was wondering about the best way to try and incorporate code or suggestions into the project. Maybe adding a short CONTRIBUTING.md or something like that would be good, or maybe you don't mind me sharing javascript code in an issues thread. Please let me know.

Enable Hardware Acceleration.

The instructions for enabling hardware acceleration are unclear/insufficient. I've gone through the linked Arch Wiki, and I believe I have everything installed. Nvidia 2070 Super. (Also Fuck Nvidia) From my research enabling hardware acceleration isn't just something you do on an OS level like your instructions make it out to be (but i'm also retarded though, so maybe it is). The following instructions to enable hardware acceleration in FFMPEG and Gstreamer seemed to make sense at first, but after digging on how to do that, it appears that you don't just enable hardware acceleration in FFMPEG, but instead specify for the program to use it when you're encoding a video, for example. Honestly i'm not very familiar with FFMPEG and always use a gui wrapper. I was hoping you could make it more clear what specific underlying program is running the video, and what specific changes your end users would need to make to enable it to run on the GPU.

For me specifically i'm running Nvidia proprietary drivers on the latest Endeavour OS. (That's basically Arch, btw)

As it stands my CPU runs around 20% from KDE when video wallpaper is on.

Ps. This reimplimentation of smart video wallpaper is fucking phenomenal. the video start stop on window maximize is instant! infinitely smoother than the original that would sometimes take up to 5 seconds to restart the video. You must have done some serious code optimization. This plugin is better than the original, and smartER video wallpaper. I was very upset when I saw it wasn't ported to plasma 6 when Endeavour updated. So, seriously man... thank you. I like the interface a lot more too, and it seems simpler to use as a whole and more powerful, as well. multi video support is badass!

So again, Thanks. Seriously.

hardware video acceleration for discrete graphics failed

Hi.
I'm using a PC with integrated gpu and discrete gpu (Intel UHD 770 and AMD radeon rx 6950XT), and monitor connected via discrete gpu.
I've installed the intel-media-driver and libva-mesa-driver.
I verivied them via ffmpeg cli with -vaapi_device and both of them worked (encode without error and I can obtain the progress using 'enc' or 'video' resource in amdgpu_top and intel_gpu_top)

If I keeps everything as default, the video-wallpaper plugin uses iGPU as vaapi device, and it works perfect in x11. But once I switch to wayland backend, the video decoding corruption. Looks like moving blurred screen. (Intel_cpu_top shows the plasmashell is using video)

If I set environment variables LIBVA_DRIVER_NAME=radeonsi , the video play normally in both x11 and wayland. but I see 0% in amdgpu_top.

Per-Video Settings

I have an idea for the video list, it would be good if the videos that I add have some basic settings, in this case, loop/repeat and a loop count, there are videos that are short and when using multiple videos they do not last long, it would be great to add loop counts before switching, another way could be to set a total run time, like run each video for 2 minutes(can be adjusted) before switching then using a crossfade(would like to see this regardless of this feature) effect to smooth the transition between current and next video, another option would be to make a randomizer, it should take the list order, randomize then play it at the randomized order.

Black Screen on Reboot

Odd, boot-related issue here. On rebooting, both wallpapers (I have two monitors) will be black, but if I change them to some other wallpaper type and then set it back to smart wallpaper, they'll work normally--is there potentially some configuration or startup option missing?

This is after changing to gstreamer as ffmpeg as a backend seemed to be even worse about this, sometimes never starting at all regardless of how things are toggled.

sysinfo.txt

Or is it that some other dependency is oddly missing? Trying to run the test file with qml6 simply returns command not found, and replacing it with plain qml prompts a suggestion to install qt5-qtdeclarative-devel, which seems odd.

Videos Won't Unpause

If a pause condition is triggered (e.g. window is maximised on that screen), then when the condition is no longer true, the video in question doesn't resume playback. This includes setting the condition to 'never' afterwards and clicking apply--only restarting entirely or resetting the wallpaper to some other option then back to a smart video will cause it to play normally.

sysinfo.txt

As noted, have something of the same unpausing issue running the test scripts, don't know if the debug trace will contain anything about that:
testout.txt

KDE crash

I can't enable the video itself because my shell will freeze and crash with a black screen completely. I deleted my video file to be able to boot again. In this logs, I switched to plain color and back (but with no video selected). I use gstreamer.

journalctl: https://pastes.dev/t4bVZsvxOK
dmesg (was too long): https://pastes.dev/MrQzajhEz5

System info:

Operating System: openSUSE Tumbleweed 20240321
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.8.1-1-default (64-bit)
Graphics Platform: X11
Processors: 8 ร— AMD Ryzen 5 2400G with Radeon Vega Graphics
Memory: 29.3 GiB of RAM
Graphics Processor: AMD Radeon Vega 11 Graphics
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B450M H

My video file: https://www.upload.ee/files/16434350/train-station-rainy-day-moewalls-com.mp4.html

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.