PosterPi (Raspberry Pi-based Digital Poster/Picture Display)

PosterPi is a solution I created for turning a flat screen television into a virtual poster display. The script was written in Bash for Linux and designed to run on a Raspberry Pi. Although I designed PosterPi to display pictures of movie posters, it could easily be modified to display digital pictures, digital signage, or just about anything else.

Once PosterPi is set up, it should automatically boot up, launch the script, read a list of posters (digital pictures) from a predetermined location, and begin displaying them in random order. My intention was for the entire process to begin without human interaction once the Raspberry Pi was powered on.

In this post, I will walk through how I created PosterPi. Feel free to use my solution exactly as it appears, or modify it any way you see fit. If you already have a Raspberry Pi loaded with Raspian Lite, you should be able to set up PosterPi in less than an hour.

01. WHY I CREATED POSTERPI
02. IT WOULD HAVE BEEN BETTER IF YOU HAD…
03. MATERIALS
04. RASPBERRY PI CONFIGURATION
05. CREATE A FOLDER FOR YOUR POSTERS
06. POSTERPI.SH
07. FINAL STEPS
08. RANDOM THOUGHTS

01. WHY I CREATED POSTERPI

When I began planning my home theater, I thought it would be neat to have movie posters hanging outside the room in a theater-quality poster frame. Some quick research revealed that theater-quality poster frames and authentic movie posters are pretty expensive. Additionally, the thought of buying, storing, and rotating physical posters in and out of the frame didn’t sound like much fun to me. Instead, I came up with the idea of using a flat screen television instead of a physical picture frame to display movie posters.

02. IT WOULD HAVE BEEN BETTER IF YOU HAD…

There are a bazillion different ways to display digital images on a television. In fact, most modern televisions have the ability to display pictures right from a USB stick, and some even have the ability to create slideshows from those pictures. Unfortunately not all televisions (and no computer monitors) have this feature built in, the features vary between models and manufacturers, and they usually aren’t very configurable. I wanted the ability to add and remove posters remotely from my desktop, control the speed at which the posters changed, and a solution that would work with any television. That is why I decided to use a Raspberry Pi to run PosterPi. I am not presenting this as the best solution or pretending that it is the only solution, merely as the solution I came up with.

03. MATERIALS

To get PosterPi up and running, all you need is a Raspberry Pi, a television, and some digital pictures.

— Raspberry Pi: I used a Raspberry Pi 3B for this project, because that was what I had available. PosterPi requires minimal processing power, and I’m sure older models or less expensive models like the Nano can handle running it.

— Television: The standard size of a poster is 24″ x 36″, which (according to Pythagoras) has a corner-to-corner measurement of 43.4″. One-Sheet movie posters are typically 27″ x 40″, with a diagonal stretch of 48.25″. If you are tying to display posters close to their actual size, you should use a 42″ to 50″ television. HD televisions in this range can be found new for $200 or less, and used models can be often be found for half that or less. Before purchasing a display, make sure that the model is designed to be mounted vertically (portrait mode). Some televisions, due to mounting holes and heating/venting issues, are not designed to be hung vertically. Additionally, make sure any wall television mount you purchase is designed to hold a television vertically, as not all are. I only wrote the code for PosterPi — safely mounting your television is your responsibility.

— Movie Posters: There are literally hundreds of websites where movie posters can be downloaded. The trick is finding poster images that aren’t watermarked and are large enough to display without distortion. I downloaded a lot of my posters from JoBlo.com and FFF Movie Posters, and found many others through Google Image Search by setting the desired image search to large. For those who torrent there are a few large collections of movie posters available in the usual places, although keep in mind that by downloading 50,000 movie posters in a single zip file, you’ll be spending several hours weeding out all the ones you don’t want.

04. RASPBERRY PI CONFIGURATION

01. Load Raspian (Lite). You do not need a GUI desktop environment for this project

02. Rename the password on the default Pi account (always a good idea)

  • type sudo passwd pi to change the password for the default account named “pi”

03. Verify networking (either wired or wireless) is working

04. Enable auto login in raspi-config so PosterPi can automatically start

05. To access the Pi remotely, enable SSH in raspi-config

06. Disable screen blanking so that the Raspberry Pi’s display doesn’t go to sleep

  • type sudo nano /boot/cmdline.txt
  • verify that the following line exists: consoleblank=0
  • if the line does not exist, add it

    07. Install FBI (a free command line picture viewer)

    • type sudo apt-get install fbi

    08. Rotate the display on the Raspberry Pi.

    • type sudo nano /boot/config.txt
    • Change display_rotate=0 to 1, 2, or 3 depending on which way your display is rotated
      • display_rotate=1 (this will rotate your display 90 degrees)
      • display_rotate=2 (this will rotate your display 180 degrees)
      • display_rotate=3 (this will rotate your display 270 degrees)
      • If there is no entry for “display_rotate”, you can add it

    05. CREATE A FOLDER FOR YOUR POSTERS

    There are three location/sources I can think of for storing movie posters and/or images: locally (on the Raspberry Pi’s SD card), a network share, and on a USB stick. PosterPi is only designed to use one poster source, although it could be tweaked to support more than one.

    01. Storing Images Locally on the Raspberry Pi’s SD card (easiest)

    This is by far the simplest solution. Create a folder (mine is called Posters) in your home directory. Copy all your posters to this folder. The end. If you previously set up SSH, you should be able to use something like WinSCP to connect to your Raspberry Pi over the network and upload/update your posters remotely without having to remove the SD card. You can add or remove posters while the script is running. The list is updated each time the script runs.

    02. Storing Images Remotely on a Windows Share (advanced)

    If you want to stream your posters from a Windows server, you will need to create an account for the Raspberry Pi, share the folder, and grant the account permission to the share (I recommend read only permissions). The easiest way to connect to the share is by using your host’s IP address. This method assumes you have a working knowledge of your home network. After creating the share and account on your Windows machine:

    • Install the necessary samba/smb tools
      • type sudo apt-get install samba-common smbclient samba-common-bin smbclient cifs-utils
    • Create a mount point for your posters
      • type sudo mkdir /mnt/PosterPi
    • Set up the mount point manually to make sure everything is working.
      • type sudo mount -t cifs -o username=USERNAME,password=PASSWORD //IP/SHARE /mnt/PosterPi
        • USERNAME is the name of the Windows account
        • PASSWORD is the password of the Windows account
        • IP is the IP address of the machine with the poster share
        • SHARE is the name of the share
      • To mount the share automatically each time the Raspberry Pi boots
        • type sudo nano /etc/fstab and add the following line at the end:
        • //IP/SHARE /mnt/PosterPi cifs defaults,username=USERNAME,password=PASSWORD,domain=DOMAIN 0 0
          • As before, change IP, SHARE, USERNAME, PASSWORD, and DOMAIN to match your local network

    03. Storing Images on a USB Stick

    Images can also be stored on a USB stick. If the Raspberry Pi is not going to be connected to a network, this is a simple way to add and remove posters to PosterPi. I have not personally run PosterPi in this manner, but here is a general overview:

    • Install usbmount (Instructions)
    • The link above includes instructions on creating a mount point that points to the USB stick. Create a mount point called PosterPi or Posters and remember what it is because you’ll need to point to it in PosterPi.sh

06. POSTERPI.SH

Here are the contents of the actual PosterPi.sh script. You can either cut and paste the contents of this script into a file on your workstation and copy the file over to your Raspberry Pi, or you can use NANO and either type or paste the contents of the script directly into the file and save it.

#!/bin/bash

#Start Loop Process
while true; do

#Delete old files
rm /home/pi/PosterPi.txt
rm /home/pi/PosterPi.tmp

#Find all files, inc subdirs, add to PosterPi.txt
find /home/pi/Posters -name "*.*" > /home/pi/PosterPi.txt

#Shuffle first 50k lines, write to PosterPi.tmp
shuf -n 50000 /home/pi/PosterPi.txt > PosterPi.tmp

#Launch FBI viewer, read from PosterPi.tmp
fbi -a -1 -t 5 --noverbose -l /home/pi/PosterPi.tmp

#When FBI reaches the end of the list, begin again.
clear
done

Walking through the script:

  • PosterPi.sh begins with an infinite loop that reads through a text file full of images. When it reaches the end of the text file, the script restarts. Each time it restarts it regenerates and reshuffles the list of images
  • The script removes two temporary files: PosterPi.txt and PosterPi.tmp
  • The script uses FIND to search your poster folder for all files that contain a period (this is a cheap way to exclude lines that only folder names and no file names) and writes it to a file called PosterPi.txt
  • The shuf command takes the first n amount of entries (I set it to 50,000) in PosterPi.txt, randomly shuffles them, and writes them to a temporary file (PosterPi.tmp). There are a lot of different ways to skin this cat; this is just the one I chose
  • FBI reads the files from the temporary file (which should be all of your posters, now in random order) and displays them. FBI has a lot of different switches available so feel free to experiment. Note that in the above example I have set the time (-t) between pictures to be 5 seconds. This is a good setting to make sure the script is working and cycling through your pictures. Once you have everything working, you will probably want to increase this value.

Remember that the file list is built (and randomized) each time the script runs. If you want to add or remove images, just place them in your folder. The next time the script runs, it’ll add them to its list. If you want to force an update, reboot the Pi.

07. FINAL STEPS

With these final steps in place, every time your Raspberry Pi is turned on it should automatically log in and run PosterPi.

01. Make PosterPi.sh executable

  • type sudo chmod 755 ./PosterPi.sh

02. Make PosterPi.sh run automatically

  • Change to your home directory by typing cd ~
  • type sudo nano .bashrc
  • add a line to the end of the file that reads ./PosterPi.sh

08. RANDOM THOUGHTS

— There are lots of different ways to decorate your new digital poster frame. You could build a wooden frame to surround your television, or make one out of foam core. If you are going to add a frame, make sure that you cut holes for ventilation, especially in the top (heat rises). You could surround the frame with flashing lights, or add a strip of LED backlighting. I added LED backlights to mine, and plan to add a small “NOW PLAYING” sign mounted at the top.

— One thing I have considered doing is grouping my movie posters into different folders based on genre (sci-fi, horror, comedy) and then rotating them in and out as needed. You could store these in separate folders just above your media folder, and drop/drag then into the shared folder as desired.

— It is easier to mount a Raspberry Pi and sticky LED light strips when the television is off the wall. Just sayin’.

— On my first attempt, I added every poster I could find. Each time I walked past the television, I found myself waiting for “a good one.” I have since changed my approach. My personal setup now contains approximately 700 posters, and all of them are “good ones” to me, meaning every one is of a movie I enjoyed and have seen multiple times.

— Be sure to explore the settings on your television. I was able to greatly improve the overall effect by slightly turning down the brightness, for example. My television also contains setting to ensure pictures display in the proper aspect ratio, and centered in the screen.

— I played with the idea of changing the poster on the screen to whatever movie I was watching at the time. This was relatively easy to do when I was using Windows as my media player. (Find the matching movie poster, replace the list on PosterPi with only that picture, etc.) Kodi supports Python scripts and could potentially do this, but when I realized I would be inside the theater and never know if it worked or not, I gave up.

That’s it! If you set up your own PosterPi or have any feedback on this tutorial, please let me know!

8 comments to PosterPi (Raspberry Pi-based Digital Poster/Picture Display)

  • Maury Estabrooks

    Rob,
    Great post and share. That took some time to put together. Your blog is appreciated. Keep it up. The theatre looks like a fun project. I tried Pi for what seemed like 5 minutes in life and gave up. I may have to try again.

  • AArdvark

    That looks SO cool!

  • Chris

    Nice job! I decided to use old video game and arcade ads instead of movie posters for my setup. Hey, any idea if there is a way to do this but with mini video clips (like mp4s)?

  • smitty

    Really great work you did here. I do have a question, but if fbi is running the script, how does one stop the script? I try to quit, killall fbi processes, but the script just seems to launch itself again.

  • TulsaTV

    Which directory do you put PosterPi.sh in?

  • TulsaTV

    I got everything set up as described, but when the script runs, it is denied permission to write the .tmp file. (It was able to write the .txt file, and the contents were right).

    I know this must have to do with where the .sh is run from, and ownership of the folder, but I’m not enough of a Linux guy to safely start chown-ing around.

    Any suggestions on a location? (e.g., /usr/local/bin, /home/pi/bin… I’ve tried those and others, they are all in the $PATH…)

  • Tim

    Love the Build, thank you for posting! I tried this out tonight and it works great. I’ve got a few questions:

    (1) Is there a way to lengthen the time spent on each image – I think it’s about 5 seconds or so right now, but how can you change it to, for instance, 60 seconds or 120 seconds?

    (2) Is there a way to alter the change between images? Right now, it’s a hard cut, but could you do a fade between images & if so, can you put a timer on that as well?

    Thanks!

  • Bill

    I was a big fan of MovieNow, but sadly it has sufferred neglect and no longer works. This was a far easier build. Thank you for the excellent walkthrough. No need for a Pi4, extra memory, full window environment, etc. Brilliant.

.xX[ MY INFO/LINKS ]Xx.

My EMAIL
My RSS FEED
My SUBSCRIPTION (Blog)
My Twitter
My YouTube

My Books
My Portfolio
My Podcasts
Review-O-Matic (Reviews)

.xX[ SUB-PAGES ]Xx.

My ARCADE GAMES
My SOFTWARE
My PHOTO GALLERY
My WRITING ADVICE
Every CAR I'VE OWNED
Every STATE I'VE VISITED

Latest Tweets