Deep Analysis not being done

Server Version#: 1.23.2.4584

Hi all,

On my Linux Server many files have not had a Deep Analysis performed on them and I’m wondering why this is the case. I’ve used the following SQL to count the items missing a Deep Analysis

select count(*) from metadata_items meta 
                        join media_items media on media.metadata_item_id = meta.id 
                        join media_parts part on part.media_item_id = media.id 
                        where part.extra_data not like '%deepAnalysisVersion=2%' 
                        and meta.metadata_type in (1, 4, 12) and part.file != ''

It found 988 items that did not have a Deep Analysis.

If I add a new Movie or TV Show and check the XML data a couple of days later no Deep Analysis information is found.

Scheduled Tasks is setup as follows:

Two questions:

  1. Any suggestions why Deep Analysis is not running?
  2. Is there a way to force a Deep Analysis on a file?

TIA

Greg

Have you verified what media type these items have? Deep analysis might be not sensible with e.g. photos or audio tracks.

I know a way using the command line:
"Plex Media Scanner" --analyze-deeply --item metadataItemIdHere
where metadataItemIdHere must be replaced by the number which appears as ratingKey="..." in the item’s Plex XML info.
However, this must be done as the user account, under which your plex server is running.

There might be other prerequisites which must be set, like environment variables. Unfortunately I don’t know which ones, since I am no Linux expert.
Maybe @ChuckPa can shed a light on that?

Yes, Photos, Music, TV shows & Movies. I’m really only concerned as to why the TV Shows and Movies are not receiving a Deep Analysis.

For what its worth I checked my logs from last night on my linux server and I can see deep analysis ran for the additional content I added within the last 24 hours.

xxxx@xxxx:/data/Personal/Scripts$ grep -a "deep analysis on" /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ Media\ Server*.log
/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.1.log:May 31, 2021 03:04:00.120 [0x7fcbfc9b6b38] DEBUG - The butler performed deep analysis on 27 files

Thanks for your answer. I ran this command and it shows files were Deep Analysed last night. However looking at some Moives and TV Shows XML Data Info shows no sign of a Deep Analysis being performed. I’m looking for deepAnalysisVersion=“4”

Here’s some additional information regarding the Plex Media Scanner options.

FWIW, I tried running this on my Synology, but never got it working. Pretty much anything other than “–help” resulted in the process crashing. Guessing there’s some additional paths, etc that must be set, in addition to what is mentioned in the document.

Plex Media Scanner via Command Line

How long does the butler (Scheduled Tasks) run for?

One major factor here is the amount of time for deep analysis to run after everything else is done.

Also, please remember, if you have a large library then it’s going to take multiple sessions to get everything done (it reads every file completely)

1 Like

Manually running Plex Media Scanner on Linux requires the PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR environment variable to be set (at least in my experience). By default on Linux (using the native package) it should be set to “/var/lib/plexmediaserver/Library/Application Support.” Something like the following should work:

PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/lib/plexmediaserver/Library/Application Support" /usr/lib/plexmediaserver/Plex Media Scanner --analyze-deeply --force --item item_id

You can try running without --force, but in my experience the scanner will return immediately without performing analysis if not included.

1 Like

I normally don’t check the xml itself as I typically trust the logs but checking a file I added yesterday I can see this morning deepAnalysisVersion=“4” was added to the xml so at least for me on my linux plex server it appears to be working correctly.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.