Ever wanted to mix videos and pictures in a slideshow on the cheap? I found this useful for 3 different purposes:
1) Projecting a 6 hour dynamic slideshow at my wedding reception
2) Making a picture frame TV with endless amounts of pictures and videos of my kid for Grandma
3) Broadcasting music videos 24/7
The challenge of this project was to combine video and photos into a slideshow for cheap and to have some control over how long the photos are displayed.
The benefits of this method are:
Low power potential (depending on the display you use)
Ability to be always on
Highly customizable
Works on old TV’s, regular flatscreens, projectors, anything with HDMI in or composite. VGA is also possible with an HDMI to VGA converter.
Can be shuffled, ordered, or scheduled.
instruvctions for setting up a new slideshow + video that I sent dad:
Here are the basic steps for creating a new slideshow pi:
1. Install openelec
2. Configure openelec (hostname, wifi, enable ssh, zeroconf)
3. Add scripts / settings
4. Add media
The trick is to use the slideshow function as opposed to the playlist function, so that it gives more control over how the photos are displayed.
============================
More details:
1. Install Openelec
This is pretty straightforward, there are a couple ways to do it but that’s out of the scope of this post. unfortunately, they changed the way slideshows were created and didn’t allow for making a interfaceless slideshow that mixes video and photos using this method, so to do this you;ll need
Openelec 7.0.1
I use:
OpenELEC-RPi2.arm-7.0.1
Because I have a rapsberry pi 2
2. Configure
This is slightly tricky if you are using a Pi that only has one usb port. The easiest thing is to have a keyboard and wifi adapter plugged in, then just use the menus to set up wifi and enable ssh. It would be theoretically possible to pre-configure it during the install stage, but I didn’t figure that out. I used an old Pi with 4 usb port to set everything up. Once you have SSH and internet everything else can be done remotely. One thing you might want to do is disable auto updates or checking for updates, because that will create an annoying pop up and ruin the moment. I also like using zeroconf, which I think is what causes it to show automatically on the network. I’d also suggest setting up a hostname so it’s easier to ssh/FTP. I find using the mac finder to deal with it remotely to be more frustrating than FTP, but in theory you should be able to manage all the files from Finder on your mac.
3. Add scripts / more configuring
From here on, you can choose to move files to the PI via FTP or using the Finder in Mac. I’m pretty sure enabling zeroconf lets your mac see it automatically, but there might be another option you have to enable. If you can’t see it, then FTP should still work.
I’ll assume you know how to create and edit text files in SSH. I use nano. Don’t use Textedit on the mac, even if you’re using it in plain text mode it still adds funny characters for line breaks or something that will break the scripts.
Scripts / files you need to create:
a) ==========================
/storage/.config/autostart.sh (executes on startup – doesn’t exist by default)
Here’s my autostart.sh. Kodi on the Pi has problems with the clock so I set it to reset it’s clock everytime it starts.:
>>
nano /storage/.config/autostart.sh
<<
copy and paste this into the autostart.sh
>>
#!/bin/sh
(sleep 30; \/usr/sbin/ntpdate pool.ntp.org; \
kodi-send –action RunScript”(/storage/videos/scripts/EVERYDAY.py)”
) &
<<
First line resets the system clock in case it lost sync (important for scheduling/ cron jobs!)
Second line runs a script.
Now I never have to modify this file again, I can just update the script it's referencing.
b) ==========================
<<
nano /storage/.kodi/userdata/advancedsettings.xml
>>
(control the look of the slideshow – doesn’t exist by default) Here’s what I added:
.5
1.1
100
c) ==========================
Edit GUIsettings.xml to control speed of stills
NOTE: this file cannot be saved while kodi is running. in order for changes to take effect, you have to stop kodi first with
<<
systemctl stop kodi.service
>>
The screen will go black, but you can still access the filesystem.
<<
nano /storage/.kodi/userdata/guisettings.xml
>>
(control the timing – exists by default)
since you’re using nano, hit control-w to search. type in slideshow. replace the slideshow entry with this one
This will keep pics on screen for 60 seconds
true
true
60
d) ==========================
yourscript.py
mkdir /storage/videos/scripts
nano EVERYDAY.py
I call it everyday, because this will be the daily main playlist. I’m making a really long slideshow of videos and images, and I want them to just always play everything on random.
I’m not doing it now, but eventually I’ll add playlist like XMAS.py to play things on christmas. So once I add additional scripts, I’ll probably point autostart.sh to a main.py, which follows some logic and decdes what playlist to play when. for instance here I might have it play things based on hplidays or times of the day.
This script can be stored anywhere and should be told to execute by the autostart.sh
I found it tricky to get the command right based on the documentation, but this works well:
That will play everything in the folder Videos as well as any subfolders and set the slideshow to random. It’s also possible to run this directly in the autostart.sh, but I thought it was cleaner to put this in its own script since you might want to run other things in the autostart.sh and might not want to constantly tweak it.
xbmc.executebuiltin(“SlideShow(/storage/videos/Marcus,[,recursive,random,])”)
[should this be kodi instead of xbmc?
4. Add media.
Pretty straightforward. Just put it wherever you told the script to look:
mkdir /storage/videos/slideshow/
Now you should be able to dump files in their from finder.
note: you might need to turn the zeroconf preference on to see it in the finder automatically
I use FTP (an app called Cyberduck) because it seems less likely to get interrupted than when I was using Finder.
after that you’ll have to reboot
if everything works and you put some videos/pic in the slideshow folder, then after it boots your slideshow should start playing automatically.
take care of it and i’ve had it run for months without needing a reboot.
enjoy!
I might have forgotten something so let me know if you have any troubles!