How do i get plex to use the cover art embedded in my files?

My movie files contain working embedded movie posters but they dont show up in plex libraries. Plex displays some covers fetched from the internet, but disregards any embedded images.

These are my settings:

Is there more to set up? How do i get plex to show the embedded images?

plex server: Version 1.1.4.2757
client: Web interface of the plex server Version 2.8.1
os server: linux
os client: osx,w10,linux

  1. Plex reads only embedded metadata from mp4 / m4v files. For other file formats you may need to resort to external ‘sidecar’ posters.

  2. seek for CRITICAL errors in the com.plexapp.agents.localmedia.log after Refreshing one of the movies

Thanks for your answer.

  1. The files i try to index are mp4s

  2. There are critical errors in com.plexapp.agents.localmedia.log:
    CRITICAL (sandbox:298) - Function named 'Start' couldn't be found in the current environment

CRITICAL (agentkit:1067) - Exception in the update function of agent named 'Local Media Assets (Movies)', called with guid 'local://79' (most recent call last): File "/usr/lib/plexmediaserver/Resources/Plug-ins-24ffd60/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1065, in _update agent.update(obj, media, lang, **kwargs) File "/usr/lib/plexmediaserver/Resources/Plug-ins-24ffd60/LocalMedia.bundle/Contents/Code/__init__.py", line 59, in update localmedia.findSubtitles(part) File "/usr/lib/plexmediaserver/Resources/Plug-ins-24ffd60/LocalMedia.bundle/Contents/Code/localmedia.py", line 265, in findSubtitles if os.path.isfile(os.path.join(path, file_path_listing)) and not RE_METAFILES.search(file_path_listing): File "/data/jenkins/pms-deps-universal-v2/BUILD_TAG/linux-ubuntu-x86_64/output/pms-depends-linux-ubuntu-x86_64-release-08b2c10/lib/python2.7/genericpath.py", line 29, in isfile UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 47: ordinal not in range(128)

Following that error i tried this: https://forums.plex.tv/discussion/123677/python-unicode-error-when-trying-to-update-metadata

But an update still wont load the local images and the error is still showing up.

EDIT: The problem is the german Umlaute. If i scan a Folder without them its working like expected. I have
export LC_ALL=“de_DE.UTF-8”
export LANG=“de_DE.UTF-8”
in my /etc/init.d/plexmediaserver. What else could i do?

@zzk_admin said:
EDIT: The problem is the german Umlaute. If i scan a Folder without them its working like expected. I have
export LC_ALL=“de_DE.UTF-8”
export LANG=“de_DE.UTF-8”
in my /etc/init.d/plexmediaserver. What else could i do?

Ah, that issue. Yes, unfortunately this plagues many NAS and Linux users. Any special characters in path and file names will cause an exception in the LMA agent, causing any local assets to be ignored.

@ChuckPa do you have an idea about the proper codepage settings?
I am not well versed in Linux, but I think you investigated this issue in Linux before.

OK here follows a highly inofficial fix, which may cause your computer to spontaneously catch fire, so tread carefully: :wink:

  1. quit Plex server

  2. go to /usr/lib/plexmediaserver/Resources/Plug-ins-???????/LocalMedia.bundle/Contents
    in there, edit first the Info.plist file and insert the following

<key>PlexPluginDevMode</key>
<string>1</string>

then edit the Code/helpers.py (create a backup first!)
Use an editor which is aware of proper indenting for Python. If your working platform is Windows, I recommend ‘notepad++’.
and replace the def unicodize(s): (lines 20-30)
with this:

def unicodize(s):
  filename = s
  try: filename = unicodedata.normalize('NFKC', unicode(s.decode('utf-8')))
  except:
    try: filename = unicodedata.normalize('NFKC', unicode(s.decode(sys.getdefaultencoding())))
    except:
      try: filename = unicodedata.normalize('NFKC', unicode(s.decode(sys.getfilesystemencoding())))
      except:
        try: filename = unicodedata.normalize('NFKC', unicode(s.decode('ISO-8859-1')))
        except:
          try: filename = unicodedata.normalize('NFKC', s)
          except Exception, e:
            Log(type(e).__name__ + ' exception precomposing: ' + str(e))
  try:
    filename = re.sub(RE_UNICODE_CONTROL, '', filename)
  except:
    Log('Couldn\'t strip control characters: ' + filename)
  return filename

These changes are overwritten when you install a new server release.
Let’s hope thse changes are officially confirmed soon and get into an official release.

  1. start Plex Media Server
  2. see if it changes anything for you, especially if the error messages continue or not

Thank you for the code - I edited both files and started plex, but it would not fix the problem. Also i noticed that some files with Umlauts in their name will show up but others wont - even some without Umlauts in the title (maybe there are Umlauts in the meta description?)

Error still is:

2016-09-15 10:13:51,740 (7fc45a7fc700) : CRITICAL (agentkit:1067) - Exception in the update function of agent named 'Local Media Assets (Movies)', called with guid 'local://76' (most recent call last): File "/usr/lib/plexmediaserver/Resources/Plug-ins-24ffd60/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1065, in _update agent.update(obj, media, lang, **kwargs) File "/usr/lib/plexmediaserver/Resources/Plug-ins-24ffd60/LocalMedia.bundle/Contents/Code/__init__.py", line 59, in update localmedia.findSubtitles(part) File "/usr/lib/plexmediaserver/Resources/Plug-ins-24ffd60/LocalMedia.bundle/Contents/Code/localmedia.py", line 265, in findSubtitles if os.path.isfile(os.path.join(path, file_path_listing)) and not RE_METAFILES.search(file_path_listing): File "/data/jenkins/pms-deps-universal-v2/BUILD_TAG/linux-ubuntu-x86_64/output/pms-depends-linux-ubuntu-x86_64-release-08b2c10/lib/python2.7/genericpath.py", line 29, in isfile UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 35: ordinal not in range(128)

Heres the File that causes the error

INFO (__init__:54) - Error finding media for movie Tom & Jerry Collection 1: 'ascii' codec can't encode character u'\xf6' in position 31: ordinal not in range(128)

To add some complexity :slight_smile:
If i put this movie in a directory and index that folder as a library the cover is shown correct.

@zzk_admin said:
Error still is:

Sorry about that. I relayed the error message to the guy who cooked the fix up.

To add some complexity :slight_smile:
If i put this movie in a directory and index that folder as a library the cover is shown correct.

I don’t think I understand.
Is the file now not in a folder?

If the file is in a folder with the other files (with and without Umlaute) the cover is not shown - if its in a folder by itsself the cover is there.

Also why is there an error in position 31 - Is this part of the textual metadata?

Please show the file names exactly as they exist?

I have sent you a list of the files in the folder via pm.

In the future, please only send via PM if I request. I am on holiday and the other ninjas should see them as well.

Most of the names you’ve provided are not named correctly. The naming format to use for movies is Name (Year) not Name (resolution)

I have attached a few here which demonstrate where your names are incorrect.

Edited by dane22: image removed

Thanks for your answer. Sorry for sending the file via pm, but it was a privacy concern.

I have cleaned all ( x ) from the files. Now most movies have images, but there are still some left without. I am also not shure if the images are fetched locally or from the internet.

To enlight my pickieness about that:
The library contained a file called “unplugged - the corrs.mp4” - a live concert cut. The scanner fetched metadata for a movie called “porn unplugged” though - a porn movie with explicit cover. The library in question is available to small children and something like that cant be happening again. Thats why i like to make shure covers get read locally.

The online databases do rarely deliver correct metadata for videos which are not ‘Movies’. The Corrs Unplugged DVD you probably need to put into a Home Video library and put in some metadata yourself.

I use a separate library for live concert content, which by default doesn’t even try to fetch metadata from online.
You may want to read about local movie extras.

see here for added detail http://forums.plex.tv/discussion/comment/1122252/#Comment_1122252

I’d also remove all the other content which is not ‘movies’.

Those comedy recording have the same problems. There are rarely metadata for these types of videos available. So I’d store them separately and treat them like explained above for the concert videos.

Ok, I understand the logic behind sorting these files and naming them right but in my assumtion it seems to be possible to also get all the metadata from the files themselves? In my first screenshot you can see that i put Local Media Assets up front. I did this with all the agents. So whatever i configure in my library the agents should prefer the local metadata?

If i use Home Videos as a library only screenshots from the movies are shown.

@zzk_admin said:
In my first screenshot you can see that i put Local Media Assets up front. I did this with all the agents. So whatever i configure in my library the agents should prefer the local metadata?

It will prefer them, but: the number of embedded metadata tags Plex reads is limited.
And, more crucial, Plex only reads embedded metadata from mp4/m4v files.

If i use Home Videos as a library only screenshots from the movies are shown.

If you edit your library, go the the ‘Advanced’ tab and change the Scanner to ‘Plex Movie Scanner’ but leave the Agent as ‘Personal Media’ you get exactly what you need for these “special cases” or for use with embedded metadata only.
As soon as the Scanner is set to ‘Plex Movie Scanner’, this library supports again all the local extras described here.

@OttoKerner @ChuckPa Mind if I step in here as well :wink:

@zzk_admin I wrote some changes to the LMA, to make it better cope with extended characters, aka the fix that Otto gave you, but it seems like you stumbled over yet a special case, that needs to be worked on :frowning:

As such, and since neither of us Ninja’s can replicate, I was wondering if you would be willing to work with me on this?

It’s going to take a lot of work from both you and me, and most done via PM’s, since we’ll be swapping code, that is not intended for lurkers to put on their PMS installations, before they get the okay stamp by Plex.

Your media will not be harmed, and neither your database, since we’ll simply take a backup of it before starting on this, and doing so req. that we take your PMS offline briefly though, while doing so, so are you up for the task?

And FUI, LMA did detect your media okay, but is now, with my code change, failing with detection of subs, so that’s the part we need to look into

Best Regards

Tommy

Hi Tommy,
i had to talk this through with my customer and its ok for him - i am ready :slight_smile:
So please pm what i have to do.

@zzk_admin Are you perhaps on Ubuntu 14.04 ?

/T

Hello all,

By OttoKerner suggestion I am following this post and I can help with logs or anything you need to debug the problem.

I use Ubuntu 16.04 LTS and PMS Version 1.1.4.2757.

I have set the permission correctly. I changed the user Plex use to run to my own user so permissions are not a problem and all the media is being correctly identified. Agents are configured for Local Media Assets as the first in the list.

I have local srt files with the same name as the TVShow or Movie and plex does not display the local subtitles.
Example:
├── Game of Thrones
│ ├── Season 5
│ │ ├── Game.of.Thrones.S05E03.HDTV.x264-KILLERS.mp4
│ │ ├── Game.of.Thrones.S05E03.HDTV.x264-KILLERS.srt
│ └── Season 6
│ ├── Game.of.Thrones.S06E01.HDTV.x264-FLEET.mkv
│ ├── Game.of.Thrones.S06E01.HDTV.x264-FLEET.srt
│ ├── Game.of.Thrones.S06E02.HDTV.x264-FLEET.mkv
│ ├── Game.of.Thrones.S06E02.HDTV.x264-FLEET.srt

I have attached a screenshot from Plex where you can see GoTS06E01 where subtitles state NONE and there is no way to change that!

The only subtitles I can see are the ones being fetch from Opensubtitles agent. everything that is local is not displayed

All the best,
Rui

Do the fix that Otto suggested here

Since on 16.04, you should be fine with that, and after making the changes, restart PMS, and refresh the library again

/T