# Local http:// site as my desktop wallpaper



## Phishfry (Sep 21, 2020)

I have an IP camera with a wide angle view that I would like to make my Xfce4 wallpaper.
I dont want to run a maximized browser but probably a MJPEG stream viewer like mplayer or mpv.

Has anyone done this before?
I have this as a reference:








						Video Livestream Wallpaper For Your GNOME, Xfce Or bspwm Desktop
					

This article explains how to use a livestream as a desktop wallpaper on GNOME, Xfce or bspwm with X11 (it does not work with Wayland). The live video stream can be any stream you like, as long as it's supported by Streamlink.




					www.linuxuprising.com
				



We have streamlink and xwinwrap in ports along with mpv.

I have mplayer playing back the stream currently.
`mplayer -cache 8000 -cache-min 90 http://192.168.1.101/mjpeg`

Any suggestions? The Linux tutorial above seems valid but it seems like too many components for this small task.


----------



## marcelbonnet (Sep 21, 2020)

Days ago I tried a script to move an image at certain interval.

Maybe you can extract the images from the stream (I can't remember right now how) at certain interval and change the Desktop background wallpaper.

Here's how I did with a static image:


```
while true; do for i in {1..20} ; do x=$((i*8)); display -geometry +${x} -window root sgt_peppers-yellow_bg.jpg ; sleep 1; done;done
```


----------



## marcelbonnet (Sep 21, 2020)

I tried something here. Except for the fact that I haven't tried with http stream and that I need to figure how to extract the frames as a background job, it worked:


```
cd /tmp/
interval=3
# seems not to work in the background:
mplayer -really-quiet -nosound -ss ${interval} -vf screenshot -frames 30 -vo png:z=9 ~/Ela#2-2.mpg

for i in {00000001..00000030}; do    display -geometry +0 -window root /tmp/${i}.png ; sleep $interval ; done
```

It is really fun and there's a lot we can do if we add processing to those frames; like adding labels  or one could use opencv to detect objects and whatever...


----------



## olli@ (Sep 21, 2020)

Phishfry said:


> I have mplayer playing back the stream currently.
> `mplayer -cache 8000 -cache-min 90 http://192.168.1.101/mjpeg`


Mplayer supports the option `-rootwin` for using the root window (i.e. the screen background) for playback. This has some restrictions, though, see the mplayer(1) manual page for details. In particular, it’s not supported by all output drivers, for example the VDPAU driver does not support it. Try `-vo xv` to use the XVIDEO driver, or `-vo x11` to use the generic X11 driver, both of which support playback in the root window.


----------



## marcelbonnet (Sep 21, 2020)

olli@ said:


> Mplayer supports the option `-rootwin` for using the root window


Great, never knew about it. Really cool. It works.

BTW, I'm using Fluxbox, not Xfce.


----------

