Plex Movie Poster Display

Version 2
Please provide feedback, suggestions, or issues.
The comments are open.

About

Plex Movie Poster Display 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 3 running Linux. So, unsatisfied with the solutions I found online, I decided to build my own.

This script 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

Plex
Raspberry Pi 3 B+
Raspberry Pi 3 B+ Case (With Fan)
SD Card
Wireless Keyboard
2 Pack 1.5 Ft HDMI Cables
A display to show the posters.
Plex Movie Poster Display Code (GitHub)

Prerequisites

A working Plex Server.
Your X-Plex-Token.

PMPD Installation

Sorry, there is no upgrade path from PMPD version 1 to version 2. There
are just to many changes. Please backup your PMPD directory and
install fresh.

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

To enable ssh you will need to create a blank file called ‘ssh’ on the SD Card before installing it into you Raspberry Pi.

Install Required software packages

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

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)

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

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

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 file.

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.

Example PHP Info Page

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;

- Restart NGINX
sudo /etc/init.d/nginx reload

Opening a browser to http://<ip_address_of_your_raspberry_pi> and make sure NGINX is still working properly .

Increase PHP upload_max_filesize

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

- Change upload_max_filesize (Around line 809)
upload_max_filesize = 20M

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

Install Plex Movie Poster Display

Get Code from GitHub

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

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>/admin.php and login with username Admin and password password1 .

Login Page

Chromium Kiosk Mode on Startup

Create a .desktop file with the correct configuration to hide the mouse pointer (needs unclutter installed), start chromium in kiosk mode, and display posters.

sudo nano /etc/xdg/autostart/chromium.desktop

-Add the following to the file
[Desktop Entry]
Type=Application
Exec=/usr/bin/unclutter & /usr/bin/chromium-browser --noerrdialogs --disable-session-crashed-bubble --disable-infobars --kiosk http://IP_ADDRESS_OF_RASPBERRY_PI
Hidden=false
X-GNOME-Autostart-enabled=true
Name[en_US]=AutoChromium
Name=AutoChromium
Comment=Start Chromium

-Save File
-Reboot to Test

Raspberry Pi Boot Config Settings

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

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

- Rotate Screen 90 Degrees
display_rotate=1

- Remove Raspberry Pi Power Warning
avoid_warnings=2

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

Description Scrolling Example

Change Logs

v2 Beta 1
PHP7 compatibility.
Support for multiple Movie Sections.
Completely new admin page.
Basic username and password protection of admin page.
New options for font size and colors.
New options for font outline size and colors.
New poster stats and cache clearing.
New custom image stats and cache clearing.
New options for multiple custom images uploaded. (Can still only select one for now).
First try at installation documentation.

v2 Beta 2
Login page now shows message if username / password does not match.
New Progress bar for Movies and TV Shows.
New options for Progress Bar size and colors.
Add menu to admin page with links to sections.
Optimized some code. Still need to do more…

v2 Beta 3
Add custom poster transition timer.
Changed font size from select to input. (This will allow for a lot more customization.)
Fixed “Use of undefined constant” error.
Clean up unused assets.
More optimization.

v2 Beta 4
A lot of changes in this release. Prior Beta releases refresh the top, middle, and bottom divs every time the Poster Transition Speed timer expired. This would cause scrolling bottom text to refresh also, cutting off text or causing bad transition. I am working on a solution, but so far I am not happy with it.
Code optimization.
– Movies and TV Show parsing is no longer two different sections.
– Rearranged some code.
Add status.php to keeps status / stats of script. Will be used more in the future.
Add Scrolling bottom text.
– Using jquery.marquee and jquery.easing
Move Poster Transition Speed location.
Change Free space is now shown in GB.
Logging into admin page and saving config, even without changing anything, will upgrade the config file.

v2 RC1
Recommend a fresh Plex Movie Poster Display install with this release.
Add Username and Password change to admin page.
Add change font size and color for bottom text while scrolling is enabled.
Add Coming Soon selection for UnWatched, All, Recently Added, and Newest.
Fix more typos.
Fix clean cache directory error message.
More optimization.

v2 RC2
Add no-cache, no-store, must-revalidate options to admin.php page.
Fix blank image while playing media with no art (Example: Live TV).

v2 Final
RC2 is now v2 Final.

Website Changes
5.6.2019
Add Increase NGINX File Size Limitation to page.
Add Screenshots.
Fix some Typos.

5.7.2019
More Typos.
Add Increase PHP upload_max_filesize to page.

5.10.2019
Add unclutter to required software packages. This will hide the mouse.
Move Raspberry Pi Settings ( Use at own risk ) to Raspberry Pi Boot Config Settings.
Add Uncomment disable_overscan to Raspberry Pi Boot Config Settings.
Add Chromium Kiosk Mode How-to|

5.12.2019
Beta 4 Release
Add jquery.marquee to credits.

5.13.2019
Add Beta 5 Section. Maybe the last beta with new features. Need to move to RC1 and do some polish / optimizations before final 2.0 release.

5.14.2019
Beta 4 now RC1.
Updated First Time Use section.
This maybe the final release before the final.

5.18.2019
Update About Section
Add Description Scrolling Example video.

5.24.2019
Change v2 RC2 to v2 Final.
Change To Do to v2.1 To Do.
Add Future To Do.
Add Ideas for Future Releases.

5.29.2019
Update Ideas for Future Releases

v2.1 To Do

Font Outline Size and Color for the Bottom Text.
Installation script for Raspberry Pi.

Ideas for Future Releases

Art mode.
Options to display audio and video information.
Aspect ratio detection / fix (Example 3:2).
Information from items being played from music section.

Credits

Plex Movie Poster Display is built using Bootstrap , JQuery, Popper.js, jQuery – Marquee and bootstrap-colorpicker. The admin page is based on the Bootstrap “Checkout Example“.

PLEX, PLEX PASS, myPLEX, PLEX MEDIA SERVER, PLEX MEDIA CENTER, PLEX MEDIA MANAGER, PLEX HOME THEATER, PLEX TV, PLEX.TV, the Plex Play Logo (“>” in stylized format) are trademarks that are the exclusive property of Plex, Inc.

53 Replies to “Plex Movie Poster Display”

  1. So, I get to the new PMPD Login page and after having changed my username and password info in admin.php, when I login with those credentials, I get the green checkmarks for the username and password but it doesn’t actually move onto another page, stays at the login page.

    1. Well, That is not good.

      1. Does your username or password have special characters? If so, does the login work if you remove the special characters?
      2. If you change the username / password back to default does it work?
      3. Is the path to the files in the root of /var/www/html/ ?
      4. Would you mind sending me an example of your config? If so I will send you an email directly (No need to post here).

      Thank you for testing. I am getting close to releasing beta 2 and would like to fix the issue as soon as possible.

      Thank you again,
      -Matt

  2. Nevermind Matt, I got it working. I’d like to make a couple requests for future updates…
    1. the option to be able to add the Font Outline Size and Color for the Bottom Text as well.
    2. a dropdown or field box to change the amount of time between poster transitions. I prefer 10000-15000 milliseconds.
    3. Custom Image State – Enabled by default (recommend: Disabled) messed me up for quite a few minutes as to why my posters weren’t displaying after updating all the settings.
    4. Fingers crossed that future updates will be simpler!

    Thank you for the improvements and continued work on this project!
    Love being able to use multiple movie sections and the Stats section!

    1. Glad you got it working.
      1. Adding it to the list.
      2. That is in the works already. 🙂
      3. I think it should be disabled by default. I will check and fix if necessary.
      4. What do you suggest?

      Also I just released Beta 2, so when you want to try the update let me know if you have any issues. I would appreciate it.

      Thank you,
      -Matt

  3. I like the sound of the Text Scrolling for long descriptions. Look forward to trying that out when available. What I meant by simpler updating is… LOL I’m not sure now what to type into terminal to make the update to Beta 2 that you released. Honestly, I shock myself every time I work on this that I am able to find ways to get this working! LOL Thanks again. Also, FYI even though I’m selecting at the bottom of this form to Notify me of new posts by email, I am not getting anything and I only realize you responded by coming back to this page and refreshing. Not going into Spam, checked there. Thanks again Matt!

  4. The progress bar is beautiful!
    1. Note that default color for the Now Showing Bottom Font color text was black #000000 so the text wasn’t visible at first. I like the description in white #FFFFFF (manually changed it on the admin page).
    2. Recommend adding up to 75px for Font Sizes for those using larger screens. I am currently using the max 60px for most of the sizes except Now Showing Bottom text.
    3. And for the same reason maybe adding up to 25px for the Progress Bar height.
    4. Adding on the admin page the max photo size for the Custom Image upload.
    5. Option to show ALL movie posters within the sections, instead of just Unplayed ones.

    Hope that’s some helpful advice!

    1. Thank you. I think the progress bar feature that was needed. Glad you like.

      1. Noted. Added to list.
      2. Beta 3 will fix this. I was not happy with the select options, so I changed them.
      3. Beta 3 or 4 will fix this.
      4. I think this is a NGINX configuration option. I need to write up how to edit NGINX to allow larger file uploads.
      5. Good idea.

      Yes. I appreciate all the feedback. Thank you for taking the time to leave it. 🙂

      1. Addition of the Increase PHP upload_max_filesize stepsnow allows me to use photos that are 2.5MB and 3MB.

      2. Suggestion… Ability to add multiple Plex Client IP addresses that would cause the Now Showing to enable. It’s very rare that multiple instances of Plex would be running at the same time in my household but I guess if that were the case then which ever came 1st in the order of the IP addresses would display the Now Showing poster. Could this be possible Matt?

  5. Sounds great Matt, I’ll keep an eye out for Beta3.
    If I think of anything else, I’ll be sure to post it here.

  6. Beta 3 trial… Great improvements!

    Poster transition speed… I set mine to 10 secs and I timed the transitions and they’re still about 29 secs between switching. I also tried 5 and 15 secs and it still switches around 29 secs.

    Aesthetically on the PMPD Admin page, I would suggest moving the Poster Transition Speed to be the 1st selection under the Coming Soon Configuration, but that’s minor and no big deal.

    Now Showing settings and display look perfect. Hoping for scrolling text descriptions which would make it FLAWLESS!

    I ran the Increase NGINX File Size Limitation as posted and reloaded Nginx, it still did not allow me to upload a 2.2MB photo but this time I didn’t get the warning message that the file was too big so it just looked like it didn’t do anything.

    WOW! This keeps getting better Matt!
    Looking forward to the Font Outline Size and Color for Coming Soon and Custom Image Bottom Text.

    1. Thank you.

      Poster Transition Speed: I checked mine and it looks like it is working correctly. Can you make sure that you have the latest index.php file. The main changes for poster transition speed where in that file. Also you will need to restart / refresh the main page on your display to reload the index.php file for the change to take effect. (This only needs to be done if that file is edited. Usually only after an upgrade).

      Aesthetics: Not sure the location you are referring too. I had it in Server Configuration originally, but thought that seemed wrong.

      Now Showing: Thank you. Glad you like. I will be working on scrolling text next. Shooting for Beta 5.

      NGINX File Size Limitation: I think php.ini might also need a change. I will look for that setting and add it to the page.

      Thank you for testing and providing feedback. Beta 4 is already in the works.

      -Matt

      1. Thanks Matt, the reboot worked and the poster transition is switching at the correct intervals. I noticed that after changing the seconds and using the Update Settings button, it still requires a reload or the amount of time will not take immediate effect.

        What I meant regarding aesthetics of the admin page was moving the Poster Transition Speed above the Coming Soon Top Text Title and field box as seen described here: https://i.imgur.com/5bD0BEt.png

        I’ll await Beta 4!

  7. Question about Text Scrolling, when Enabled it will display at font size 30 (I believe that’s the size) and that can’t be changed when scrolling enabled, only when disabled, correct?

    I noticed that in order to get the scrolling to work for me the first time, I had to Enable & Update, Disable & Update, and Enable & Update. A Pi reboot did not help after the first Enable & Update, but it’s working for me now.

    Typo on Admin page: Scolling Text… missing the ‘r’

    Awesome sauce!!! Just keeps getting better.
    Reminder of the ALL movies selection, as opposed to just Unplayed movies for a future update. Thanks again for all the work on this.

    1. Just learned that this is also the case with the username and password change. The login will only go into effect for me after I login with the default username & password, then Logout and use my new login credentials. A reboot of the Pi did not help this issue either.

        1. Glad you like it. I like the clip you uploaded :). It was a lot of work and needs some more tweaking, but I think it is 90% the way there.
          I am going to try to figure out a way to allow font size changes without disabling and re-enabling.

          Thank you for testing.

          -Matt

      1. This will be fixed in the next release. There will be an option to change username and password from the admin page.

        -Matt

  8. Not sure if u saw this reply, it mistakenly posted at the top…
    Suggestion… Ability to add multiple Plex Client IP addresses that would cause the Now Showing to enable. It’s very rare that multiple instances of Plex would be running at the same time in my household but I guess if that were the case then which ever came 1st in the order of the IP addresses would display the Now Showing poster. Could this be possible Matt?

    1. Thank you for the suggestion. Not sure how to do this.. yet. I might work on it soon as Version 2 is complete.

      -Matt

  9. PMPD2 RC1 Trial…
    Huge thanks for the ability to change the font size for the scrollable text… Works great!The username and password change was much simpler this time around. I really like the options of Newest, Recently Added, All, & Unwatched, however I haven’t been able to get Newest to work. I tried a fresh install of everything and multiple reboots. I would think Newest would be films from 2019 and maybe 2018 but even a movie like Matrix showed up as well. Where does Newest get it’s movie list from in Plex? Does it mean Newest to Plex or newest out? Unwatched seems to work properly. Unfortunately, my Plex Recently Added list has over 1500 movies that somehow include movies I added along time ago to Plex so it’s hard to tell if that option is working properly. ALL is definitely working cause even movies Marked as Played are displaying. Great stuff Matt!

  10. Holy smokes… I just realized this works with Plex Client IP addresses for remote users! Swwweeet! Did you know this Matt?
    Wow, now I really wish it would allow multiple client IP addresses separated by a comma. I tried already yesterday, it didn’t work. LOL 😉

    1. Yes. 🙂 It works with any client IP address, but only one client IP address can be assigned. I may look into changing this once the final version 2 is out.

  11. Hey Matt, just noticed an issue. I use trailers and a pre-roll before every unplayed film starts, while those are playing, PMPD2 will display Now Showing, the progress bar with a blank black display with a tiny image icon like an image is missing. LMK if you need a video to see what I mean if you’re not able to test it yourself.

    1. That is good to know. I don’t us pre-roll, I have always wanted too but never found a good place to make one for me… , but I think I can test with a random short video. Now that you bring this up, this issue might also happen while watching Live TV. I will test both.

      Thank you!
      -Matt

      1. Trailer and pre-roll blank image fixed on Now Showing as noted in RC2.
        Not sure I understand the other update/fix:
        “Add no-cache, no-store, must-revalidate options to admin.php page.”
        Thanks once again Matt!

  12. Hey,

    This is really cool, I’d been meaning to set this up but never got around to it. Awesome work.

    Quick question though. Is there a specific screen size this is meant for because it doesn’t seem to scale properly on either of the displays I’ve tried it on.

    On one the bottom summary text is a single line, on another the poster fills right to the bottom.

    Cheers!

    1. It should work on most screen sizes. The middle div, the div that is used to show the poster, is set to scale to %100 width. This usually helps the poster display properly while minimizing distortion.
      What sizes are the screens you are using? Are they TVs or computer monitors? Also do you know what resolution they are running at?

      -Matt

      1. The only one I can say for sure was 1920×1200. The other was a Raspberry Pi plugged into a 34″ ultrawide (but didn’t use the full resoltion) that I’ve since unplugged so can’t say for sure.

        The tablet I used, once changed to 1920×1080, showed the scrolling text properly.

          1. I will see what I can do about different aspect ratios. I have an idea, but I am not sure it will work. Adding it to my to do list :).

            -Matt

  13. Thanks for working on this Matt. I’ve set this up, and most of it works great, however when nothing is playing, it doesn’t cycle through random posters, it’s just black.

    I’m not sure if it’s related, but I did have to make some small tweaks when installing. The guide doesn’t reflect it, but I needed to change a few instances of PHP 7.0 and 5.0 to 7.3 in order for it to work. Let me know if you have any suggestions. Thanks again!

    1. Sorry that you are having trouble.

      Assuming you followed the installation on the site; Can you please ssh to the box, change directory to /var/www/html, and run php -f getData.php when you are seeing the blank screens? Are there any errors? Is the image path valid in the middle div?

      Are you running this on a Raspberry Pi with fresh install of the latest Raspbian?

      -Matt

    1. Ahh, I think I might know the issue. The Plex Movie Sections is the section number (Example: 2) not name. I need to make that clearer in the instructions. Please try setting the correct section number for your movie section(s) and let me know if that helps

  14. love for the ability to have the Custom Images rotate every few posters at random
    i have made a poster for my “theater” https://imgur.com/6elx1UM

    also think that having it rotate every x posters would be great. being able to set it
    that way you hcan have to go in between posters
    like
    sherk 1 – custom – popeye – custom –
    sherk 1 – sherk 2 – popeye – custom – bttf

  15. Hope all is well Matt… Just a friendly reminder of the Font Outline Size and Color for the Bottom Text update to have matching text on the PMP display.

  16. Hi Matt,

    Love the script! I’ve put it into my Grafana display in my kitchen and it looks awesome – see it here:
    https://ibb.co/SBMyypK

    Quick question – My Recently Added Movies posters go back quite a while, I’m thinking 90 days or more, and I’d like to recude that to maybe 7 days. Is there a particular line of code I can edit that allows me to reduce the scope of time?

    Thanks bunches!

  17. Hi, I’m trying to set up one of these displays for myself. I followed your instructions up to opening up the web server page, and nothing showed up. I noted that when I rebooted nginx, it resulted in a failure. I thought perhaps rebooting would fix the issue, but apparently not. Perhaps the tutorial would be easier to follow if there was a video walkthrough of it and/or you showed what the code looked like after being altered? Because surely I did it wrong somehow and I’m not entirely sure where (although I have a feeling it was either adding index.php or when uncommenting that one section of code).

    Thanks in advance.

    1. Never mind, I realized I misread the instructions. But now I’m stuck on another part, where you have to edit /etc/php/7.0/fpm/php.ini. My Raspberry Pi is saying that that directory doesn’t exist.

      1. Glad you got it figured out. If there is something I can do to help make the instructions clearer, please let me know.
        What version of PHP do you have installed? I have not updated my Pi in a few months so maybe Raspbian is installing a newer default PHP version.

        From CLI type php -v or php -version.
        Try editing file /etc/php/7.X/fpm/php.ini (replace X with 1, 2, or 3)

        1. Thanks, that worked. I have version 7.3 by the way.

          I followed all the directions, but something’s still off. I have the web server running, but the display shows no posters and the admin page crashes with a “Unable to open file!” message. Reloading the page brings you back to the admin page with no changes saved. My only thought is it might be the directory (the Plex Movie Poster files are just in a folder on the desktop). Perhaps I could circumvent this by editing the config file directly? Either way it should be displaying something, yet it isn’t.

          Oh, and autostart for Chromium didn’t work either. Not the end of the world, I’ll just bookmark the IP address and leave a wireless keyboard attached.

    2. Sorry for the late reply.
      I agree a video how-to would be nice, however I currently do not have time or the expertise to make one. I am interested in learning some editing software, but that is low on my priority list. If anyone wants to make a video, post it / send it to me, I will give credit and link to it.

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.