Monday, July 4, 2022

TV Wallpaper

Several friends and guests asked me about the Video wallpaper running on my TV. It's pretty cool - a video of short segments flying over cities around the country. It's actually just one of several I have on my TV, and this is how it's done.

In general, this is a video called "flying over the USA", which you can find on YouTube (BTW, thanks to my darling Raven for cluing me in to it!). If your TV supports YouTube, you can simply play that video, which is 12 hours long (It's actually a 45 minute video, looped 16 times). There are many other "scenery" videos. Many come with soothing music, which might like, or prefer to mute.

If you have a simple TV, like mine, you can use a "stick" PC, like this (*) as I do, running Windows and using VLC as a video player, as well as some custom code I wrote using AutoIT. On the computer, I put 12 videos of different subjects, like an art slideshow, the Matrix code, views of Nebula in space, and more. The custom code (below) shows buttons to select and play any of the videos. 

* This stick is the cheapest Amazon has, and costs $93, and I've seen them "pre-owned" cheaper on eBay. You can also find Android-based ones for as low as $40, but you'll have to write some scripts to make that work nicely (I built such a thing once, but wasn't able to figure out a nice-enough user-interface to pick the movie on-screen).

The code I wrote for AutoIT is below. It simply shows 12 big buttons. Each will launch VLC, adding a parameter for the video file name, and parameters to play it in full-screen, in an endless loop and SILENT (because the TV is in my living room, which is a party space). Here's the code:

#include <ButtonConstants.au3>
#include <GUIConstantSex.au3>
#include <WindowsConstants.au3>
$StartX = 20
$StartY = 20
$ButSizeX = 150
$ButSizeY = 120
$ButInterX = 20
$ButInterY = 20

$Button1Action = "Apple"
$Button2Action = "Art"
$Button3Action = "Earth From Space"
$Button4Action = "Fireplace"
$Button5Action = "LG"
$Button6Action = "The Matrix"
$Button7Action = "Nature"
$Button8Action = "Satisfying"
$Button9Action = "Scenery"
$Button10Action = "Snow Mountains"
$Button11Action = "Space Nebulas"
$Button12Action = "Flying over USA"
$theGUI = GUICreate("formWithButton", 1200, 500, 50, 50)
$button1 = GUICtrlCreateButton($Button1Action, $ButSizeX*1+$ButInterX*1, $StartY+0, $ButSizeX, $ButSizeY)
$button2 = GUICtrlCreateButton($Button2Action, $ButSizeX*2+$ButInterX*2, $StartY+0, $ButSizeX, $ButSizeY)
$button3 = GUICtrlCreateButton($Button3Action, $ButSizeX*3+$ButInterX*3, $StartY+0, $ButSizeX, $ButSizeY)
$button4 = GUICtrlCreateButton($Button4Action, $ButSizeX*4+$ButInterX*4, $StartY+0, $ButSizeX, $ButSizeY)
$button5 = GUICtrlCreateButton($Button5Action, $ButSizeX*1+$ButInterX*1, $StartY+140, $ButSizeX, $ButSizeY)
$button6 = GUICtrlCreateButton($Button6Action, $ButSizeX*2+$ButInterX*2, $StartY+140, $ButSizeX, $ButSizeY)
$button7  = GUICtrlCreateButton($Button7Action,  $ButSizeX*3+$ButInterX*3, $StartY+140, $ButSizeX, $ButSizeY)
$button8  = GUICtrlCreateButton($Button8Action,  $ButSizeX*4+$ButInterX*4, $StartY+140, $ButSizeX, $ButSizeY)
$button9  = GUICtrlCreateButton($Button9Action,  $ButSizeX*1+$ButInterX*1, $StartY+280, $ButSizeX, $ButSizeY)
$button10 = GUICtrlCreateButton($Button10Action, $ButSizeX*2+$ButInterX*2, $StartY+280, $ButSizeX, $ButSizeY) 
$button11 = GUICtrlCreateButton($Button11Action, $ButSizeX*3+$ButInterX*3, $StartY+280, $ButSizeX, $ButSizeY)
$button12 = GUICtrlCreateButton($Button12Action, $ButSizeX*4+$ButInterX*4, $StartY+280, $ButSizeX, $ButSizeY)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $button1
Run ("c:\Program Files (x86)\VideoLAN\VLC\vlc.exe ""c:\Sync\Videos\TV stick\" & $Button1Action & ".mp4"" -f --loop --no-audio" , "" , @SW_MINIMIZE)
Case $button2
Run ("c:\Program Files (x86)\VideoLAN\VLC\vlc.exe ""c:\Sync\Videos\TV stick\" & $Button2Action & ".mp4"" -f --loop --no-audio" , "" , @SW_MINIMIZE)
Case $button3
Run ("c:\Program Files (x86)\VideoLAN\VLC\vlc.exe ""c:\Sync\Videos\TV stick\" & $Button3Action & ".mp4"" -f --loop --no-audio" , "" , @SW_MINIMIZE)
Case $button4
Run ("c:\Program Files (x86)\VideoLAN\VLC\vlc.exe ""c:\Sync\Videos\TV stick\" & $Button4Action & ".mp4"" -f --loop --no-audio" , "" , @SW_MINIMIZE)
Case $button5
Run ("c:\Program Files (x86)\VideoLAN\VLC\vlc.exe ""c:\Sync\Videos\TV stick\" & $Button5Action & ".mp4"" -f --loop --no-audio" , "" , @SW_MINIMIZE)
Case $button6
Run ("c:\Program Files (x86)\VideoLAN\VLC\vlc.exe ""c:\Sync\Videos\TV stick\" & $Button6Action & ".mp4"" -f --loop --no-audio" , "" , @SW_MINIMIZE)
Case $button7
Run ("c:\Program Files (x86)\VideoLAN\VLC\vlc.exe ""c:\Sync\Videos\TV stick\" & $Button7Action & ".mp4"" -f --loop --no-audio" , "" , @SW_MINIMIZE)
Case $button8
Run ("c:\Program Files (x86)\VideoLAN\VLC\vlc.exe ""c:\Sync\Videos\TV stick\" & $Button8Action & ".mp4"" -f --loop --no-audio" , "" , @SW_MINIMIZE)
Case $button9
Run ("c:\Program Files (x86)\VideoLAN\VLC\vlc.exe ""c:\Sync\Videos\TV stick\" & $Button9Action & ".mp4"" -f --loop --no-audio" , "" , @SW_MINIMIZE)
Case $button10
Run ("c:\Program Files (x86)\VideoLAN\VLC\vlc.exe ""c:\Sync\Videos\TV stick\" & $Button10Action & ".mp4"" -f --loop --no-audio" , "" , @SW_MINIMIZE)
Case $button11
Run ("c:\Program Files (x86)\VideoLAN\VLC\vlc.exe ""c:\Sync\Videos\TV stick\" & $Button11Action & ".mp4"" -f --loop --no-audio" , "" , @SW_MINIMIZE)
Case $button12
Run ("c:\Program Files (x86)\VideoLAN\VLC\vlc.exe ""c:\Sync\Videos\TV stick\" & $Button12Action & ".mp4"" -f --loop --no-audio" , "" , @SW_MINIMIZE)
EndSwitch
WEnd

No comments:

Post a Comment