Howto: Screensaver/Wallpaper YOUTUBE!! (Aquarium 3D,ect)

Share your own howto's etc. Not for support questions!

Howto: Screensaver/Wallpaper YOUTUBE!! (Aquarium 3D,ect)

Postby bester69 » 2015-07-06 15:55

I've got a pretty cool solution to join for all,

GOAL:
- We want to be able to have a pretty nice Screensaver such as a Real Streaming Aquearium or a Virtual 3D aquarium with relaxing sounds, or any else you can imagine.
- We also might have to have a movie as wallpapaer
So the idea is to use for example Youtube as a source to playing videos as Wallpaper or as ScreenSaver.

Take a look at some pictures and the i'll explain howto do it. :wink:

Real Auqrium (movie at the top as screensaver Youtube)
Image
Virtual Aquarium (movie youtube)
https://www.youtube.com/watch?v=5f2T-5mq_UY
Image
Virtual Aquarium (movie youtube)
https://www.youtube.com/watch?v=VMxuo4sJ7iM
Image
Virtual Fire (movie youtube)
https://www.youtube.com/watch?v=0fYL_qiDYf0
Image
Basically, we're going to enjoy by playing long streaming youtubes movies as Wallpapers or screensavers for even hours.

HOW IS IT DONE??:
0- We will use VLC to play streaming videos from YOUTUBE:
--> some VLC version can play directly youtube video, others need youtube-dl command
examples:
Code: Select all
vlc --video-wallpaper https://www.youtube.com/watch?v=5f2T-5mq_UY
vlc --video-wallpaper $(youtube-dl -g https://www.youtube.com/watch?v=5f2T-5mq_UY)


1- We will play long movie to random start times periods, for example 1 /10 lenght movie, so this way we can enjoy the long movie without to playing it from the start everytime:
--> for this we use param starttime: vlc --start-time $STARTIME
--> we'll use RANDOM linux param for starting time

2- We'll configure VLC to play as screensaver:
2.1- We'll need to install xautolock y xtrlock. http://tuxdiary.com/2015/01/07/xautolock/
--> xautolock launch command to inactivity time
--> xtrlock to locks screen keyboard and mouse, and at the same time allow to watch desktop.
sudo apt-get install xautolock xtrlock

try --> xautolock -time 10 -locker xtrlock
xautolock -time 10 myscreensaver.sh (we will use xautolock to lauch our own script,)

3- We'll set some hotkeys in VLC, so that we'll will be able to invoke them fomr the script with xdotool
sudo apt-get install xdotool
xdotool key ctrl+shift+v

--> Well invoke kotkey for Full screensave at the top
Image

xdotool key ctrl+shift+v ---> (mapping on vlc with function hotkeys: Change to mode background Desktop )
This function conmute to background or foreground movie VLC when playing with param mode --video-wallpaper.



I hope you enjoy, because its so easy and cool that i didn't now i was possible.. :) :) :) :)



-------------------------------------------------------
The script for Screensaver will follow this easy flow
0- Set a list of 10 youtube videos with their respectvly times (youll have to calculate them to seconds to play with param --start-time), so we can use their times to established periods startings times (length move/10).
1- With param RANDOM choose ramdomly one of the movies to play everytime screensaver launches (xautolock reach time)
2- With param RANDOM calculate ramdomly starting times, so we can enjoy long movies without to play it repeatly from the beginng
--start-time $STARTIME
3- Screensaver locks (launch xtrlock)--> from this time on you are locked.
4- lauch youtube movie as desktop background
cvlc --video-on-top --start-time $STARTIME --loop --autoscale --video-wallpaper --no-video-title-show $VIDEO &
5- Change VLC to playe on mode top or foreground full scrren:
--> Unlock for a microsecond, so xdotool can command to vlc to play at the front, so you can watch the movie with the desktop hidden like a porpertly screensaver. (killall xtrlock)
--> xdotool key ctrl+shift+v --> gives order to VLC to play full top screen
6- lock again once the movie play the whole screen (xtrlock) .




To launch screensaver scheduled:
xautolock -time 10 -locker wallpaperscreensaver.sh
or more complete, with suspend command after screensaver running for a while
xautolock -time 12 -detectsleep -killtime 10 -killer "systemctl suspend" -locker wallpaperscreensaver &

And Now the script wallpaperscreensaver.sh :
#!/bin/bash
#
# Lista de 10 videos
#Video DEFFAULT
#6 Hour REAL VIDEO Ocean
VV=https://www.youtube.com/watch?v=zJ7hUvU-d2Q
DD=6*3600
#-------------------#-------------------
#---------------------------------------
#Lista de video 10----------------
#-------------------#-------------------
V1=https://www.youtube.com/watch?v=VMxuo4sJ7iM
D1=5*3600
#-------------------
#Aquarium 2hr relax music
V2=https://www.youtube.com/watch?v=VIrBecB746c
D2=2*3600
# Aquarium
V3=https://www.youtube.com/watch?v=5f2T-5mq_UY
D3=2*3600
#1ho Aqu
V4=https://www.youtube.com/watch?v=tJBJp6BCVhQ
D4=1*3600
#Muy bueno 4k Aqua
V5=https://www.youtube.com/watch?v=0vYb9TcUo0Q
D5=20*60
#10min 4 K Tropical Reef Aquarium i
V6=https://www.youtube.com/watch?v=T6UTVcmxHT4
D6=10*60
#Akvaryum, Aquarium, Fish Tank
V7=https://www.youtube.com/watch?v=lfbX2PwENiE
D7=30*60
#Aquarium HD HQ All Platforms
V8=https://www.youtube.com/watch?v=C5qJgZsW8o0
D8=50*60
#Burning Fireplace
V9=https://www.youtube.com/watch?v=0fYL_qiDYf0
D9=2*3600


#----------------------------------------------------------- NO MODIFICAR DE AQUI EN ADELANTE
xtrlock &
killall vlc

#Seleccionde videl de forma aleatoria
count=1
NVIDEOS=10
echo "-----------------"
while [ "$count" -le $NVIDEOS ] # Generate 10 ($MAXCOUNT) random integers.
do
#number=$RANDOM
SELEC=$((RANDOM%$NVIDEOS+1))
let "count += 1" # Increment count.
done

#-----------------------------------------------------------

case $SELEC in
1) echo "one"
MAXLEN=$D1; VIDEO=$V1;;
2) echo "two"
MAXLEN=$D2; VIDEO=$V2;;
3) echo "three"
MAXLEN=$D3; VIDEO=$V3;;
4) echo "four"
MAXLEN=$D4; VIDEO=$V4;;
5) echo "five"
MAXLEN=$D5; VIDEO=$V5;;
6) echo "six"
MAXLEN=$D6; VIDEO=$V6;;
7) echo "seven"
MAXLEN=$D7; VIDEO=$V7;;
8) echo "eight"
MAXLEN=$D8; VIDEO=$V8;;
9) echo "nine"
MAXLEN=$D9; VIDEO=$V9;;
10) echo "ten"
MAXLEN=$D10; VIDEO=$V10;;
*) echo "INVALID NUMBER!"
MAXLEN=$DD; VIDEO=$VV;;
esac

if [ "$VIDEO" == "" ]; then
echo "Video $SELEC no programado"
MAXLEN=$DD; VIDEO=$VV
fi

echo "Seleccionado video nº $SELEC, con duracion $MAXLEN"

count=1
echo "-----------------"
while [ "$count" -le 10 ] # Generate 10 ($MAXCOUNT) random integers.
do

TIEMPO=$((RANDOM%9+1))
# echo $TIEMPO
let "count += 1" # Increment count.
done
echo "normalizado a $TIEMPO/10"
STARTIME=$(($TIEMPO*$MAXLEN/10))
echo $STARTIME
echo "-----------------"

echo "START TIME=$STARTIME"
sleep 5

nohup cvlc --video-on-top --start-time $STARTIME --loop --autoscale --video-wallpaper --no-video-title-show $VIDEO &
amixer set Master 25% on
sleep 40
amixer set Master 25% on
killall xtrlock
xdotool key ctrl+shift+v
xtrlock &




Last edited by bester69 on 2015-07-07 00:42, edited 2 times in total.
User avatar
bester69
 
Posts: 982
Joined: 2015-04-02 13:15

Re: Howto: Screensaver/Wallpaper YOUTUBE!! (Aquarium 3D,ect

Postby stevepusser » 2015-07-06 17:57

An even easier method is to use qwinwrap and a local video instead of streaming HD video.

http://main.mepis-deb.org/mepiscr/testr ... /qwinwrap/

Video of qwinwrap in action: https://copy.com/pnLMfjMVR8JXzCB3
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Krita 3.3.2.1, Pale Moon 27.6.0, Audacity 2.2.0, mpv 0.27.0, Corebird 1.7.1, Firefox 57.0, SMPlayer 17.11.2
User avatar
stevepusser
 
Posts: 8937
Joined: 2009-10-06 05:53

Re: Howto: Screensaver/Wallpaper YOUTUBE!! (Aquarium 3D,ect

Postby bester69 » 2015-07-06 18:22

stevepusser wrote:An even easier method is to use qwinwrap and a local video instead of streaming HD video.

http://main.mepis-deb.org/mepiscr/testr ... /qwinwrap/

Video of qwinwrap in action: https://copy.com/pnLMfjMVR8JXzCB3


i tried this application before, and wasnt able to compile it for Jessie, or wasnt able to use videos, anywayas my solution is very easy to use, furthermore works. :x

My Solution starts videos from any position ramdomly, with is cooll allowing you to play long movies since any positions, because they start from anywhere ramdomly.
My solution plays youtube stream movies ramdomly from a list, which is pretty cool, so you dont have to downladed previously.


Give it a try, is very easy to use and to understand. :wink:
User avatar
bester69
 
Posts: 982
Joined: 2015-04-02 13:15

Re: Howto: Screensaver/Wallpaper YOUTUBE!! (Aquarium 3D,ect

Postby stevepusser » 2015-07-06 18:42

i tried this application before, and wasnt able to compile it for Jessie, or wasnt able to use videos, anywayas my solution is very easy to use, furthermore works. :x


Well, I was able to do it for Squeeze and Wheezy--I added the xwinwrap code into my build as a third-party library to make it even easier to install--so I'm going to check to see how it builds on Jessie. Those are my packages and ugly-butt video, after all, so I'm fairly sure it works. :)
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Krita 3.3.2.1, Pale Moon 27.6.0, Audacity 2.2.0, mpv 0.27.0, Corebird 1.7.1, Firefox 57.0, SMPlayer 17.11.2
User avatar
stevepusser
 
Posts: 8937
Joined: 2009-10-06 05:53

Re: Howto: Screensaver/Wallpaper YOUTUBE!! (Aquarium 3D,ect

Postby Head_on_a_Stick » 2015-07-06 18:57

@OP: Please use code tags for your script.

@stevepusser -- desktop cube, really?
:lol:
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 6782
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Howto: Screensaver/Wallpaper YOUTUBE!! (Aquarium 3D,ect

Postby stevepusser » 2015-07-06 19:33

Head_on_a_Stick wrote:@OP: Please use code tags for your script.

@stevepusser -- desktop cube, really?
:lol:


Ehhh---I don't really use it, i just wanted to see if the video worked on it, and give people a headache with that Google Street View time-lapse. I always have wanted to take a bike tour up that Northern California road, though.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Krita 3.3.2.1, Pale Moon 27.6.0, Audacity 2.2.0, mpv 0.27.0, Corebird 1.7.1, Firefox 57.0, SMPlayer 17.11.2
User avatar
stevepusser
 
Posts: 8937
Joined: 2009-10-06 05:53

Re: Howto: Screensaver/Wallpaper YOUTUBE!! (Aquarium 3D,ect

Postby bester69 » 2015-07-07 00:35

stevepusser wrote:
i tried this application before, and wasnt able to compile it for Jessie, or wasnt able to use videos, anywayas my solution is very easy to use, furthermore works. :x


Well, I was able to do it for Squeeze and Wheezy--I added the xwinwrap code into my build as a third-party library to make it even easier to install--so I'm going to check to see how it builds on Jessie. Those are my packages and ugly-butt video, after all, so I'm fairly sure it works. :)

I've just installed it and that is crap. lol
- You cant acces to desktop view without closing application
- You cant use it as a service, cant progamme it, etc,
- cant play youtube videos
- cant use it as a secreensaver, it just play a video on the wallpaper
- cant play long videos without playing from the zero time
- cant play list movies
- cant play random movies
- cant launch with inactivity and then launch suspend

, what i told you, a crappy gui to play a movie with mplayer running as wallpaper, No!! it has nothing to be with my almost professional Screensaver Youtube solution. :lol: :lol:
next time, please, dont give me shit :mrgreen:
User avatar
bester69
 
Posts: 982
Joined: 2015-04-02 13:15

Re: Howto: Screensaver/Wallpaper YOUTUBE!! (Aquarium 3D,ect

Postby stevepusser » 2015-07-07 18:42

Wow, you certainly convinced me with your cogent arguments. Absolutely everyone has the unlimited bandwidth and video hardware to stream and play 1080p h.264 Youtube videos as a wallpaper, right? It's not like ISPs would ever throttle Youtube, either, and certainly nobody has a clue bout how to download Youtube video and edit it into a loop!

I eagerly await a Debian package of your VLC script, certainly someone of your vast knowledge can create one for us and get it into Debian. And you have shown great taste in desktops, too, perhaps you can become the KDE advisor for some distro like Soldyk. Just tell the developers that they know shit and their desktop is shit, and I'm sure they'll see the light and let you create the desktop. After all, it's not like I know anything and am helping to develop a distro, or created the only Debian package for a KDE screensaver or anything...
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Krita 3.3.2.1, Pale Moon 27.6.0, Audacity 2.2.0, mpv 0.27.0, Corebird 1.7.1, Firefox 57.0, SMPlayer 17.11.2
User avatar
stevepusser
 
Posts: 8937
Joined: 2009-10-06 05:53

Re: Howto: Screensaver/Wallpaper YOUTUBE!! (Aquarium 3D,ect

Postby bester69 » 2015-07-08 00:52

stevepusser wrote:Wow, you certainly convinced me with your cogent arguments. Absolutely everyone has the unlimited bandwidth and video hardware to stream and play 1080p h.264 Youtube videos as a wallpaper, right? It's not like ISPs would ever throttle Youtube, either, and certainly nobody has a clue bout how to download Youtube video and edit it into a loop!

I eagerly await a Debian package of your VLC script, certainly someone of your vast knowledge can create one for us and get it into Debian. And you have shown great taste in desktops, too, perhaps you can become the KDE advisor for some distro like Soldyk. Just tell the developers that they know shit and their desktop is shit, and I'm sure they'll see the light and let you create the desktop. After all, it's not like I know anything and am helping to develop a distro, or created the only Debian package for a KDE screensaver or anything...


To use it as a Screensaver, it does the job, cos youre locked, youre not working, so its not problem the screensaver consume all the CPU, etc. You dont need to use Youtube videos, you can use anyvideo, and i think most of the users have a decent bandwith of at least 3Mb, which i think is the minimum on the internet to work propertly.

I like my solution cos it does the job, i just wanted a decent screensaver like those ones that run on Windows, Fishes Aquarium, etc. The bad thing is that we have to fake it to be able to enjoy a nice screensaver, but anyways is nice to see the fishes, when raise the screensaver. Im thinking of downlading 2,5Gb movie 1080p h264 fishes movie form youtube anda use it as a fix screensaver with the highst quality, so you dont feel the fake. Then as you already know it will play ramdomly at any time of the video, so with 2hours video, IT MAKES THE GOAL !!!!

sorry, but i dont see another solution, at least there' some way to do it with wine, which im not going to investigate., Perhaps, one day linux users can play Aquarium fishes scrrensaver that dont look crappy.

regards. :shock:
User avatar
bester69
 
Posts: 982
Joined: 2015-04-02 13:15


Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable