Continuing the Conversation

08.28.10 48 Comments

So I’d like to hear a bit more about these scanners. That wasn’t a question, but sure. They are little snippets of Python code that are invoked by the Plex Media Server when scanning a library section. They are passed a list of files, and a list of subdirectories, and return a list of media objects. They look at the list of files, convert ones they recognize into media objects, and are also allowed to remove any subdirectories they don’t want to recurse into. Also, they can be “stacked” or “pipelined”, so the Movie scanner first calls the “Video Files” scanner to eliminate all the non-video files, and ends by calling the “Stack” scanner which stacks those pesky CD1/CD2 files, for example. Modular, extensible, and flexible.

That meant absolutely nothing to me, can you tell me something cool from the end-user perspective? Sure. As written, the TV scanner and the Movie scanner both take advantage of each other so that I can actually add the same “Incoming” directory to both my Movie and TV library sections, and they each pick out just the media that they’re supposed to. It’s not perfect, but it works pretty well.

Wait, but what happens when I move my media from my Incoming directory into its final resting place? Alexandria uses “turbo hashes” to keep track of files, so it’ll detect the fact that you moved the file, and you really won’t notice, it’ll just work.

OK, riddle me this! What if I have media on an external drive, unplug it, and then scan. Surely all hell will break loose and the Media Server will crash, choke, or delete my content, right? Right?! You mistake us for amateurs, kid. We just note that the location is offline and don’t whack anything.

So I have to keep updating my library manually? Only if you want to. You can update each section manually, hit a URL (if you’re the scripting type), have the library update periodically (every hour, say), or even enable “fs_events”, which auto-magically scans your library when something changes. Doesn’t work perfectly yet, but it’s pretty magical when it does.

I made a movie section, watched some stuff, rated some stuff, and then I accidentally deleted my section, or maybe I didn’t have it configured right, or maybe I just felt like recreating and scanning from scratch. Somehow, all my view status, ratings, and even position in the file wasn’t lost. Is this magic? Yes.

But I even renamed some movies in the process. And moved them elsewhere. How the @#$%@ does that work? Magic.

I’m really not sold on this centralized server thing. A bunch of my movies are located on my “server” machine, but I also have a bunch on the machine where I have Plex. Isn’t that horrible inefficient? As long as the paths are the same on both machines, Plex will simply use the local path for media when it’s available. We call this “optimal media routing”. (It’s actually the only way that VIDEO_TS movies work now, but that’s an aside.)

But I’m a UNIX hacker and I have Chinese food in my beard. Command lines FTW! The Plex Media Scanner can actually be run from the command line and do a variety of things like scan, refresh, list sections, add new sections, etc.

What’s your favorite metadata agent? It would have to be the IMDB agent written by the brilliant and handsome Scott. It’s not perfect, but it’s almost frighteningly good. An anecdote from a recent tester explains it better than I ever possibly could: “I had a big pile of old Danish movies, some which contain certain 18+ content….Plex/Eight recognized them all as this one weird English documentary program with an innocent icon. Plex/Nine recognizes and identifies it correctly – exposing rather explicitly that I had this old and forgotten folder of movies….AMAZING“.

But when the site changes, it’ll break and I’ll complain. The new agents auto-update just like the plug-ins, so as soon as we fix it, everyone will instantly benefit.

Well, this all sounds too good to be true. Can you explain some of the rough edges? Sure! Like I said, VIDEO_TS movies need to be accessible via the local filesystem, they don’t work over HTTP yet. VIDEO_TS files don’t scan properly for TV shows yet (due to my personal hatred for the format?). Let’s see, what else? You can’t specify DVD order vs aired order at the moment. The Music Scanner is pretty slow. I’m sure there’s more, but you’ll tell us about it soon enough.

What about date-based shows? Well, I’m sure it’s not perfect, but this folder of junk scanned in perfectly. And if you haven’t seen the 2005-01-25 episode, I highly recommend it, Rob Cordry at his absolute best.

The Daily Show.jpg

So I added some sections, and now I’m totally mesmerized watching the Media Manager. Can you explain what it’s doing? Yes, the Core Animation viewer is quite fun to watch. Obviously, the starting point is the gray Plex icon. When it starts looking for a match, it gets an “atom” icon overlaid. If it finds a match, it goes dark while the metadata loads, which can actually take a while. After it’s loaded, it flips over with the poster. Also, since the media analysis happens in parallel, sometimes the gray icon turns into a thumb before the metadata is loaded as well, just depends on the order in which things happen. This image below shows the three stages.

Plex Media Manager.png

It takes forever! I’m impatient! The posters don’t show up in Plex! WTF? BBQ! There’s an easy solution for this one. Get a nice cold microbrew, put on some good music, and watch the Media Manager, while sitting in Lotus position. Watch it. Become one with it.

It doesn’t do movie collections yet! I can’t edit the metadata manually! I’m pissed off. I want my money back. Remember what I said about this being the ground floor level of the building? Give us a chance to add a few more floors, you won’t be disappointed.

I’ll leave you with Barkley, enjoying a lilikoi. Namaste.


Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedIn
Share this


  • @Russ Off the top of my head, it makes firefly play in an order that completely doesn’t make sense, because fox screwed the pooch on it. and i know i have at least 1 other show in my library that had a problem with aired order, although i can’t for the life of me remember what it was. I’ll stick with plex 8 til this gets fixed.

  • Elan – will this work?

    A NAS hosts all the media PLUS the Alexandria database. My MacPro adds all the media to the database but is not involved in hosting the database. My iMac plays the media using the database that’s on the NAS.

    Boy – THAT would be AWSOME!!!


    • @Boots/James: Hmm, sounds like you’d need PMS for your NAS. Which doesn’t exist. Today.

  • Spoken with the tone of someone who knows >exactly< what they're doing.

    My NAS is a Netgear ReadyNAS so I doubt PMS will run on it… you guys are good but there's lots of NAS hardware out there to support! I have all the Macs at home set up mounting the NAS shares with AFP/autofs. They show up as a folder somewhere in the file system. I'm hoping I'll be able to wangle it that way – but it sounds like you have a better way planned anyhow. Ahhh dang it! Hows about you just send me the installer!!! Pretty Please?


  • Will the current plex just update for Alexandria or do we have to DL separate?

    • @Ajgoyt: New download since it’s a new series.

  • Thanks 12:00 PST or?

  • elan, one last question and i’ll quit harping… is the aired vs. dvd order toggle planned on being added into the second release of plex 9, or is it further down the line? i’m really interested in 9, especially with the iOS app coming, but i’m happy to stick with 8 for a bit longer if i know that the feature i need is being added to 9 in the near future.

  • Great news! Keep up the excellent work!

  • I don’t know if you do this already, but I’d really like to have the metadata right in my video files. I know it’s quite a bunch of work to sync files Alexandria but when switching to another system–without Plex but the capability the read this metadata–it would really kick ass. A while ago I considered converting all my files to use mkv as container which would allow pretty much anything about metadata but I guess I had no software to actually use anything new mkv offered (compared to mp4 or even avi).

  • Just to clarify. The server does not stream content to the client right? The server hands of a pointer to a media file to the client and the client opens the file (from a network location if necessary)?

    Great stuff this anyhow and thank you for all your hard work.

    • @Nes: The Plex Media Server streams content to the iOS client. Plex for Mac gets its content from the server via HTTP only if it can’t find it locally (this is Plex’s Optimal Media Routing feature).

  • Why not go with standard UPnP instead of your own HTTP based network protocol for the Plex Media Server?

    If you went with standard UPnP then we could use Plex Media Server and Media Manager with the Xbox360, PS3, NMT Popcorn Hour and all other UPnP clients out there :)

    • @Jim: In a word, metadata. I don’t think UPnP has rich enough metadata. There are other reasons, but that’s the biggest one in my mind.

  • This has been an huge change in spirit. You are getting more and more apple-izer with time: no raw folders, “many one-more-things”, surprises after long silences… But although I like it a lot (it is amazing the work you have done both in Plex and in the scanner-server, that has made me felt stupid having bought “air video” some weeks ago :/

    But at the end i miss the “Delete item” I had in contextual menues, since it helped me keep my disk in shape.

    Is there any way to have it back?

    Tx. (I am absolutely amazed)


  • I just signed up to your blogs rss feed. Will you post more on this subject?

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>