At some point in the last few days, all of my music that had previously had the loudness analysis done on them just…don’t have that anymore. They all had the waveforms up to this point, but now they don’t. New songs I have added since then have the waveforms though. Is there any way I can have that loudness analysis done on the rest of my library, or restore the previous analysis, without removing and re-adding everything?
You can use the Plex Media Scanner on a command line.
You can wait for scheduled tasks to do it.
You could probably use Tatulli.
After I add an album, I have a BASH shell script that uses the Plex scanner like this:
"$pscan" --analyze-loudness -o $albumID && echo 'album analyzed for loudness'
It probably works on a whole library too. Have you seen the scanner article?
I did see that article. It didn’t mention anywhere the analyze-loudness command, and I didn’t think to just try that command.
I ran a test case with one album (after struggling to get its ID because the music doesnt give the option to view XML) and that worked, but only after using the analysis in Plex on the album beforehand (the command line analysis didn’t seem to work despite it running).
I ran the same analysis on my whole music library, and then tried the loudness analysis but that doesn’t seem to work. It only seems like that command can be used on albums and smaller.
Gonna be a pain to do this but better than removing and adding again. Thanks for the help
Ok, got everything fixed! Here’s how I did it for anyone who needs the info:
I realized when you run the analyze function from the command line at the library level, it runs per artist instead of per album. I fixed this by using the python api to get each album and then run regular analysis on it. After that, I went back to the command line and was successfully able to use the analyze-loudness command on the whole library.
That’s great to hear you got it sorted with some python.
I struggled with IDs too. What I do is pick any track of an album and click the vertical …
That’s where you’ll find the Get Info that leads to View XML.
Here I’m looking at track 10 of an album, and using the elipses:

And here is the View XML for that track. You’ll recognize the Item ID for the track circled on the left, and you’ll see the parentRatingKey which is the Album ID.
I’ll let you discover the grandparent ID ![]()
Hi @Mjsciarabba,
The bigger part of my library is missing the loudness data too for some reason.
I am struggling with the command to analyze the complete library.
Can you share your solution in more depth so I can do the same with my music library?
Thanks,
Paul
Sure thing! Sorry for the delayed response.
The command line argument to analyze, when run at the library level, scans the artist folders since that is how they were organized through Lidarr. What I figured out through some testing in the app is the analysis needed to be run at the album level instead.
I’m sure there is a way to make that happen on the command line, but it was easier for me to use the python API instead to access that information:
from plexapi.server import PlexServer
baseurl =
token =
# Set baseurl and token above
plex = PlexServer(baseurl, token)
# Insert Library name in the ''
music = plex.library.section('')
# This runs through each album and analyzes it
for album in music.albums():
album.analyze()
Once I used that python script to make Plex do analysis on the albums, they are technically queued up for loudness analysis by default since it has re-read all of the info. This brings you to two options:
- Let your server run analysis at the normally set time like it would any other file
- Use the command line argument to run loudness analysis manually:
/path/to/Plex Media Scanner --analyze-loudness --section <sectionID>
I’m not sure why the loudness command isn’t on the wiki page mentioned above. Though when it does get added, there definitely needs to be a disclaimer about where the analysis can apply.
I hope this helps! Sorry again for the delayed response. Let me know if you need anything else!
~Matt
Thanks @Mjsciarabba!
Much appreciated! No problem and thanks for taking the time to work it out.
Yesterday I decided to do the Plex dance, and it seemed to start and complete the loudness analysis right.
But the Sonic Analysis is progressing very slow on my NAS, a few albums in an hour. With more than 6000 to go I calculated it will take almost 30 days to complete.
Tonight I revert to the backup before the Plex dance and will let your script run.
Thanks again Matt.
Paul
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
