LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Play any video as a screensaver with mpv and xscreensaver trick/hack (https://www.linuxquestions.org/questions/linux-desktop-74/play-any-video-as-a-screensaver-with-mpv-and-xscreensaver-trick-hack-4175615234/)

linux1021 10-07-2017 03:15 PM

Play any video as a screensaver with mpv and xscreensaver trick/hack
 
1 Attachment(s)
Hi! Everybody

I did a search on google an a little research, on playing any videos as a screensaver. I was getting bored with the usual ones. So, I found this little trick/hack, I did not know where specifically to put this in the forum other than here. Okay, here it goes.

1) Create a folder for your video files only in your home folder/directory, make sure you do not ERASE this folder.

2) Videos have to be 1 minute or less in duration, that means, you will have to edit the videos to 1 minute or less on a video editor.

3) Open .xscreensaver with your text editor of your choice, you do not have to be root administrator, the file is in your home folder, like this

"xed /home/Screensaver videos

And insert this lines in the programs: section like this:

programs: \
Best: "ScreenSaver Videos" mpv --shuffle --really-quiet --no-audio \
--fs --video-aspect=16:9 \
--no-stop-screensaver \
--wid=$XSCREENSAVER_WINDOW \
$HOME/"ScreenSaver Videos"/* \n\

Save the file and log out and log in again, sometimes it take a reboot to set it just in case.

I'll try to put a screenshot of mine, if I can, see screenshot attached to this. The "Screesaver videos" is the folder for the screen videos to play.

Okay, Have fun!:)

ondoho 10-08-2017 03:28 AM

if you don't like xscreensaver, there's also: https://github.com/9wm/xss

linux1021 10-08-2017 06:31 PM

Quote:

Originally Posted by ondoho (Post 5767560)
if you don't like xscreensaver, there's also: https://github.com/9wm/xss

Hi! ondoho

Thanks for the note/reply. Yes, if you want to fiddle around with commands from scratch then yes, but xscreensaver is already giving you at least 90% of the steps/tools for making it do this faster. Thanks for the hint/note about this site and program tho. Have fun my friend.:D

jefro 10-11-2017 09:55 PM

Thanks for the information.

rrivas01 07-20-2022 08:35 AM

A note on jerky transitions due to Fractional Scaling settings
 
Just a heads up for those of you using mpv through xscreensaver: ran into an issue where upon returning from the screensaver, back to where you left off before it came on, I suddenly encountered an issue where the screen became jerky, especially if when watching a movie. Specifically, I noticed that on return back to the desktop, the transition was very jerky, almost as if the monitor was jumping from one resolution to another in the transition. This change came about, when I restored my hard drive image back to a previous state, and changed the Settings, Display, Fractional Scaling. That notice right below in smaller text: "May increase power usage, lower speed, or reduce display sharpness". Didn't give it much thought, but checking this on makes a world of difference on my setup, which is already pushing it for 4K resolution: a 3rd Gen I7 Optiplex 7010, GT1030, Ubuntu 22.04. The difference is immediate. If you encounter this, bumpy transition and poor video performance afterwards, go straight there and don't do fractional.

I'm loving the setup now, booting to an SSD, and having it cycle through images and videos stored on a mechanical 500g hard drive. Had issues getting it to use a folder on the hdd, I simply could not get it to work, instead opting to have xcreensaver look for the files on the home directory, and then using a m3u playlist referencing videos on the hdd. Seems to work well this way, even with an under powered 7010.

linux1021 07-20-2022 09:30 AM

Hi! rrivas01

Yes, 4K video it is still tricky on linux to setup right, make sure your drivers are up to date, and the settings within it are setup right, and if you lower resolution on the images and videos will perform better. I use mpv, because it is light and can play 99% of files (audio or video) formats. Happy to see you got it working! And thanks for the tip or tweak. Good luck!:)

Quote:

Originally Posted by rrivas01 (Post 6368659)
Just a heads up for those of you using mpv through xscreensaver: ran into an issue where upon returning from the screensaver, back to where you left off before it came on, I suddenly encountered an issue where the screen became jerky, especially if when watching a movie. Specifically, I noticed that on return back to the desktop, the transition was very jerky, almost as if the monitor was jumping from one resolution to another in the transition. This change came about, when I restored my hard drive image back to a previous state, and changed the Settings, Display, Fractional Scaling. That notice right below in smaller text: "May increase power usage, lower speed, or reduce display sharpness". Didn't give it much thought, but checking this on makes a world of difference on my setup, which is already pushing it for 4K resolution: a 3rd Gen I7 Optiplex 7010, GT1030, Ubuntu 22.04. The difference is immediate. If you encounter this, bumpy transition and poor video performance afterwards, go straight there and don't do fractional.

I'm loving the setup now, booting to an SSD, and having it cycle through images and videos stored on a mechanical 500g hard drive. Had issues getting it to use a folder on the hdd, I simply could not get it to work, instead opting to have xcreensaver look for the files on the home directory, and then using a m3u playlist referencing videos on the hdd. Seems to work well this way, even with an under powered 7010.



All times are GMT -5. The time now is 07:51 PM.