Plex Movie Poster Display v3

V3 is still in development. The code, and this page, are still a work in progress.

Version 3 [ DEV - Pre-release ]
A BIG 'thank you' to everyone who is helping with this project!
Honorable mentions: ZeroCoolGOS
Please provide feedback, suggestions, or issues. 
The comments are open.

About

Plex Movie Poster Display (PMPD) is a side project I started a few years ago. I always thought it would be cool to have a display outside my media room that would show the poster of the movie or TV show that was currently playing. I searched the internet and found similar projects, which were all windows programs.  There was just one problem… I wanted to run this project on a Raspberry Pi. So, unsatisfied with the solutions I found online, I decided to build my own.

Scene that time PMPD has grown. Many people have provided suggestion, contributed code, helped with test hardware, and spent hours helping make this project better than I imagined.

How PMPD Works

PMDP scraps http://IP_ADDRESS_OF_PLEX_SERVER>:32400/status/sessions and displays the poster, current progress, and description of the currently playing movie or TV show on a screen. If the client is not playing any media the script shows random movie posters from the Plex Server.

Items Used

Prerequisites

A working Plex Server.
Your X-Plex-Token.
Raspberry Pi OS with desktop running on your Raspberry Pi.

Download and install Raspberry Pi OS with desktop onto SD card.
(This is outside the scope of this how-to. If you need help please follow the installation instructions here.)

To enable wireless and ssh on your Raspberry Pi without a monitor, check out my how-to here.

Install Required software packages

sudo apt update && sudo apt upgrade -y
sudo apt-get install nginx php-fpm php-xml php-curl git unclutter -y

Setup PHP with NGINX

Update: Remove index.nginx-debian.html from config. Sometimes when Nginx is upgraded it would load the default index.nginx-debian.html Nginx file (not the index.php file we want to load).

Add index.php to index line (Around line 44)
Before:
index index.html index.htm index.nginx-debian.html
After:
index index.html index.htm index.php;

cd /etc/nginx
sudo nano sites-enabled/default
index index.html index.htm index.php;

Scroll Down, uncomment the following lines, and save the file.

location ~ \.php$ {
  include snippets/fastcgi-php.conf;
  fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}

Save Changes.

CTRL + O to write changes
CTRL + X to exit

Increase NGINX File Size Limitation

By default NGINX limits the file size you can upload (I think it defaults to 1MB). I recommend increasing the allowed file size so you can upload larger custom images.

sudo nano /etc/nginx/nginx.conf

- Add the follow in the http section after types_hash_max_size 2048;
client_max_body_size 25M;

- Save Changes.
CTRL + O to write changes
CTRL + X to exit

Increase PHP upload_max_filesize.

sudo nano /etc/php/7.3/fpm/php.ini

- Change upload_max_filesize (Around line 845)
upload_max_filesize = 25M

- Save File
- Reboot Raspberry Pi (Might not need to reboot, but I had to for change to work).

Setup PHP information file.

cd /var/www/html/
sudo mv index.nginx-debian.html index.php
sudo nano index.php
  - Add <?php echo phpinfo(); ?> to top of file.
  - Save Changes.
CTRL + O to write changes
CTRL + X to exit

Restart / Start NGINX and Test

sudo /etc/init.d/nginx reload

Opening a browser to http://<ip_address_of_your_raspberry_pi> . If everything is installed correctly. you should see the php information screen similar to this ( PHP 7.3.19-1 has been tested and works ).

Installing PMPD

Clone Dev Branch (Future v3)

cd /your_preferred_git_directory
sudo git clone --branch dev https://github.com/MattsShack/Plex-Movie-Poster-Display.git
cd Plex-Movie-Poster-Display
sudo cp -R * /var/www/html
  - You can replace index.php used for in the testing above.

Fix Permissions

sudo chmod -R 774 /var/www/html/
sudo chown -R pi:www-data /var/www/html/

First Time Use

Open Browser to http://<ip_of_raspberry_pi>/settings/login.php and login with username admin and password password1 .

Once logged into the admin page, you will need to update the Plex Server IP, Plex Token, and Plex Movie Sections in “Server Configuration” before PMDP will work properly.

Important: The Movie Sections input is expecting the ID (#) of the Plex library you want PMPD to use for posters. You can add multiple sections as long as they are comma separated and contain no spaces.

How to find your Plex sections ID(s):

  • Open your Plex web interface via the browser of your choice.
  • Select the desired section(s) from menu on the left. (Example: Movies)
  • Once the section is loaded… Look towards the end of the URL in the browser. You should see something like “source=2”.

Slideshow of my Newest Build

Misc Raspberry Pi OS Steps

Full Buster / Raspberry OS Upgrade:

sudo apt update
sudo apt full-upgrade
sudo reboot

Disable Screen Blanking: 

Click on the Raspberry Pi (Menu) icon. Select Preferences, Raspberry Pi Configuration, and then the Display tab. Choose Disable next to Screen Blanking.

Enable SSH:

Click on the Raspberry Pi (Menu) icon. Select Preferences, Raspberry Pi Configuration, and then the Interfaces tab. Choose Enable next to SSH.

Rotate Screen:

Click on the Raspberry Pi (Menu) icon. Select Preferences, and Screen Configuration. Right click on the screen you want to rotate and select orientation.

Chromium Kiosk Mode on Startup

Raspbian Buster / Raspberry OS

With Raspbian Buster / Raspberry OS I was not able to use the .desktop file method to auto start Chromium. Instead I had to create a directory and file. I am not sure if this method needs unclutter installed so I left it in the instructions.

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

- Add the following 
/usr/bin/chromium-browser --kiosk  --disable-restore-session-state http://[PMPD IP Address]/index.php

-Save File
CTRL + O to write changes
CTRL + X to exit

-Reboot to Test

Work in progress…

Raspberry Pi Boot Config Settings 

                                 ( Use at your own risk ) 
sudo nano /boot/config.txt

-Remove black border from around screen. Uncomment 
disable_overscan=1

- Rotate Screen 90 Degrees (May NOT work. Use instructions above instead)
display_rotate=1

- Remove Raspberry Pi Power Warning
avoid_warnings=2

- Fix color depth on Raspberry Pi
framebuffer_depth=32
framebuffer_ignore_alpha=1

27 Replies to “Plex Movie Poster Display v3”

  1. Everything about V3 has been straight forward and awesome thus far. I’ve got it working on a pi w and it works great.

    Suggestion:
    I know people suggested this in v2 – video and audio stats in the “bottom” sections for coming soon and now playing would be cool.

    By the way, I am very much a beginner at these sorts of projects, your instructions were clear and concise. Looking forward to v4 and beyond!

    1. Thank you for the feedback. 🙂
      Video and audio stats in the “bottom” sections is already in the works… my goal is to have it complete for the final v3 release.

      -Matt

  2. Thank you for the instructions about moving over to this dev branch, Matt. I ended up wiping the SD card for the Pi and starting fresh, just in case.

    I’ve followed the instructions here and although I can access the new (and very cool looking) Plex-themed configuration page, I’m left with a blank black screen on the Pi. I navigated to /var/www/html and ran php -f getData.php. This is what I got, seems like there are permissions issues:

    pi@raspberrypi:/var/www/html $ php -f getData.php

    PHP Warning: include(/assets/plexmovieposter/tools.php): failed to open stream: No such file or directory in /var/www/html/getPoster.php on line 3
    PHP Warning: include(): Failed opening ‘/assets/plexmovieposter/tools.php’ for inclusion (include_path=’.:/usr/share/php’) in /var/www/html/getPoster.php on line 3
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Notice: Undefined variable: comingSoonTop in /var/www/html/assets/plexmovieposter/PlexLib.php on line 285
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMovieData.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMovieData.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMovieData.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMovieData.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMovieData.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: array_rand(): Array is empty in /var/www/html/getData.php on line 288
    PHP Notice: Undefined index: in /var/www/html/getData.php on line 289
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Warning: file_put_contents(../../cache/logs/PMPD_Log_getMediaURL.txt): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/tools.php on line 38
    PHP Warning: mkdir(): Permission denied in /var/www/html/assets/plexmovieposter/CacheLib.php on line 28
    PHP Notice: getimagesizefromstring(): Read error! in /var/www/html/getPoster.php on line 37
    Invalid Image

  3. I finally ordered a new Pi4 with 8GB ram, case fan and a 64 GB SD card specifically for PMPD and with it I wanted to test out the Dev branch updates of PMPD. My old Pi3 was always suffering from 100% swap memory and slow WiFi issues. The new setup and installation went very well yesterday especially since I’m very familiar with using PMPD since January 2017! I know some aesthetic changes are still being made and there were a few new options for me to get used to or learn about but WOW… Music, TV Shows, SSL, font imports… Impressive! Truly appreciate the time that goes into a project like this. Kudos and thank you!

  4. Would definitely love to see a few Apple like gaussian blur capabilities to fix the font/text to poster contrast ratio going on. Any similar techniques to what Apple/Plex/Infuse currently use to resolve these issues would be greatly welcomed.

  5. Hey Matt,

    I followed step by step and when I got up to the part ‘Installing PMPD’ I was not sure what the last part of each install meant: – You can replace index.php used for in the testing above

    What am I replacing it with and where exactly? Sorry if this is a noob question.

    I ignored that part and continued on. I tried launching http:///settings/login.php on the web browser and ended up with a 404 Not Found page

    1. In the instruction you were asked modified the default nginx installed index.php to test that your PHP installation is working correctly. After cloning the DEV branch you will then overwrite that index.php file with the one from the Github repo.

      You will need to go to http:///settings/login.php to access the login / settings pages (only if you are using the DEV branch). I am going to remove the ‘Clone Master Branch (v2)’ section so it is not so confusing. The instruction on this page are about the DEV branch (future v3 release)… not the older Master branch (older v2 release).

      I do recommend you run the DEV branch. ZeroCoolGOS has really fixed / added a lot of good features.

      -Matt

  6. Hi,

    What does – ‘You can replace index.php used for in the testing above’ mean exactly? Where am I replacing this and replacing it with what? Sorry confused on this bit when going through the install PMPD steps.

    1. Use the instructions from V2

      “Setup PHP with NGINX
      cd /etc/nginx
      sudo nano sites-enabled/default
      – Add index.php to line with index index.html index.htm index.nginx-debian.html;
      (Around line 44)”

    2. In the “Setup PHP information file” step the instructions have you moving the index.nginx-debian.html file to index.php (basically renaming the file). We then use that index.php to test PHP.

      Once the PHP test is complete, that index.php file is no longer needed and can be / should be replaced by the index.php from the PMPD installation.

      I hope that is clearer 🙂
      -Matt

  7. Matt – I have been using your v2 for sometime now… but I also have a way currently with my home assistant to see upcoming TV show downloads and such… is there a way you could allow me to point to a URL to display in the rotation (the URL will have the Columns showing the Upcoming TV programs, Upcoming Movies and Recently Downloaded from SONARR or RADARR

  8. qq for you I am running v3 “now showing” works great. However, I get nothing after I stop the movie for “coming soon”. It just shows the title of the last movie I played with a blank screen.

    1. Do you have cache images enabled? If so, please try disabling it. Do you see any errors if you run the scripts from cli?

      -Matt

      1. I disabled cache it didnt help. I see the following errors

        PHP Warning: include(/assets/plexmovieposter/tools.php): failed to open stream: No such file or directory in /var/www/html/assets/plexmovieposter/getPoster.php on line 3
        PHP Warning: include(): Failed opening ‘/assets/plexmovieposter/tools.php’ for inclusion (include_path=’.:/usr/share/php’) in /var/www/html/assets/plexmovieposter/getPoster.php on line 3
        PHP Warning: file_get_contents(http://192.168.1.52:32400/library/sections/source=1/recentlyAdded?X-Plex-Token=8hhxGsnDzeCDyEgptMvh): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
        in /var/www/html/assets/plexmovieposter/PlexLib.php on line 903
        Creating: cache/posters/ Debug (GeneralCache_Prep): cache/posters/ Creating: cache/art/ Debug (GeneralCache_Prep): cache/art/ Creating: cache/custom/ Debug (GeneralCache_Prep): cache/custom/ Creating: cache/fonts/ Debug (GeneralCache_Prep): cache/fonts/ Creating: cache/logs/ Debug (GeneralCache_Prep): cache/logs/ feed not loadingpi@NowPlaying1:/var/www/html $ cd assets

  9. Hi Matt, love this project and have it installed and running, but am having trouble getting my second monitor to work. I have added in display settings, and even tried in web view settings, but when I hit save, it reverts back to one screen.

    1. Sorry, I am not sure about the dual monitor setup. My setup is connected to a flat screen tv mounted in a home made poster frame. Maybe someone else here has experience with a dual screen setup and can help.

      -Matt

  10. Hey Matt,

    Just wanted to say awesome update! I’ve had the V2 for a long while now and this is a massive improvement to something that was already awesome!

    I was wondering if there were a way to set how recent the Show Media: Recently Added option could be set to? (as in an additional box to select Added Within: then set a date, or select amount of days/weeks.)

    Thanks again for the updated version!
    -Andrew

    1. Thank you for the feedback. Most of the credit goes to ZeroCoolGOS for all their updates.

      As far as the Recently Added within a date range… I am not sure that is possible. The PMPD script simply queries Plex for the recently added media and it returns the result(s). I am not sure there is an option within Plex to return media only within a date range. I am working on a few more small updates and will add this to my list to look at once complete.

      -Matt

  11. Ah that’s fair enough, I just assumed there might be something in there seems you can sort the movie (or TV) libraries By Date Added

    Still super happy about the new update, especially love the “Presented In” graphics!

  12. Set this up yesterday. Fantastic stuff, well done! I am getting the wrong audio data with the “Presented Info” it always shows 2.0 Stereo despite being played in 5.1 or 7.1 (verified by Tautulli). Any ideas where to look?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.