The Road to Plex/Nine - Plex Blog

The Road to Plex/Nine

| 27 Aug 2010 | by 55 Comments

It’s been a long time in development, and we’re finally putting the finishing touches on the first public release. An incredible amount of effort has been spent developing this new version, and I’d like to take a bit of time introducing you to it. I’ll start by answering a few frequently asked questions:

Are you guys being bought by Apple? If you pay attention to how previous acquisitions have gone, you’ll already know the answer to this one. An Apple acquisition is usually followed by immediate disappearance of the service/product in question, sequestered away no doubt to a secret sub-basement in Cupertino. The fact that we’re still here talking and the website is still running is a sure sign that we have not been acquired by Apple. (The date is entirely coincidental, we went “one week out” and ended up there.)

Will my favorite new feature/bug be added/fixed in this release? Probably not. We’ve been uniquely focused (much to the surprise of some, who think we’ve just been playing Angry Birds) on getting the Alexandria library up and running. The only new feature in this release is the official inclusion of Ryan’s hardware-accelerated video decoding.

Can I run the new version alongside the old version? The answer is “mostly”. When you install Plex/Nine it will set aside your old Application Support directories so as not to step on anything. If you hate it and want to go back to Plex/Eight, you can just rename the directories, whack Plex/Nine, and crawl back into that comfortable old pair of Plex/Eight jeans.

Is this new release completely bug free? Um, no. This is the first release of a massive from-scratch rewrite of the library, and it’s safe to say there will be bugs, and even things that used to work that don’t work yet with the new version. However, we hope some of the cool new stuff coming your way will more than make up for it. This release has been through 17 (really!) builds which have gone out to our elite group of super-testers, but there are certainly lots of bugs. Remember what your mom told you: “Hope for the best, expect the worst, and take what comes with a smile.”

Why the @$%#%$ did you guys have to rewrite all that stuff? I’m really glad you asked. Our vision for the future of Plex is a distributed architecture, as opposed to one giant monolithic program. A simple picture might help here:

Untitled.png

In order to realize this vision, we had to effectively do two things: (1) rip out massive amounts of code in the client and make it into a “thin client” (essentially just player and skin), and (2) design and build the Alexandria library system into the Plex Media Server.

We consider these major changes to be fundamentally important to the future of Plex. We’re building the foundation for some truly incredible things, and building a strong foundation takes a lot of time and work. Continuing the metaphor, the first release really only shows you the foundation and perhaps a few ground-level floors. However, once you see the speed at which we can add amazing new features, you’ll better understand why we had to take so much time to get this right.

Can you walk me through an example of how this new library is so much better than the old one? One thing I really like is the decoupling of the scanning from the metadata. The scanners are responsible for looking for media, usually on disk, and performing “structural identification” (e.g. Lost, season 3 episode 14″). Media analysis is also performed to get the resolution of the file, pull out a thumbnail, etc. The media is added to Alexandria right at the start of scanning. Note that at no point yet has TVDB or any other Internet site been required. So you can scan new episodes into your library even if the site is down, and see them next to other episodes. What’s more, you can write a custom scanner in a few lines of Python code, which you might want to do if you have a custom filesystem layout for your media. Flexible!

Untitled-1.png

Now the agents, in my opinion, is where things get incredibly cool. They elegantly solve the problem of “how do I bring metadata from the Internet and connect it with my media?”. The agent functionality, along with the other parts of the new plug-in Framework coming in Plex/Nine was designed by James, and I have to be honest, he’s kicked some serious ass.

Plex/Eight used the XBMC scrapers to accomplish that task, and if you’ve ever tried to write one (or even modify an existing one), you’ll know that it’s not an easy task. As Jamie Zawinski once said: “Some people, when confronted with a problem, think ‘I know, I’ll use regular expressions.’ Now they have two problems.” (The only thing worse than regular expressions, mind you, is regular expressions encoded in XML.)

Plex/Nine’s metadata agents use the same (well, an enhanced) version of the Plex Plug-in Framework you’ve come to know and love. This means that powerful XPATH, Unicode, and HTTP functions are available in an easy-to-use manner, and you can write an agent in as little as a few dozen lines of code.

One of the other fundamentally neat things about agents is that multiple agents can contribute to a piece of media. I might want to get my ratings from Rotten Tomatoes and my descriptions from IMDB, for example. The other day Scott said “the movie descriptions on Wikipedia are really good!” and an hour later, this is what my own configuration looked like after I dropped his new agent in:

Info Provider Settings.png

The “Local Media Assets” agent is the one responsible for finding posters, banners, fanart and such sitting around next to your media. The Wikipedia one is the next highest priority agent, which means that the metadata combiner will prefer its summaries over others.

I think I fell asleep during that last answer. Yeah, I don’t blame you.

How open and extensible is this awesome new library? Well, you tell me. The database is stored in SQLite format, and there is a really nice REST-ish HTTP/XML interface for all areas of the library (which is what the Plex client uses). Want to build a dashboard widget which displays your recently added movies? Easy! Fun! And given that the Alexandria scanners are completely written in Python and support custom-written ones, this new library is much more easily customizable and user-tweakable than the old one. We’re really excited to see what interesting agents and scanners you come up with!

I think I’m out of questions. Good, because I need to get back to Angry Birds.

FacebookTwitterGoogle+LinkedIn
Share this

55 Comments so far

  1. Gary August 27th, 2010 1:30 am

    Awesome. Awesome to the max.

  2. Dracorubio August 27th, 2010 1:37 am

    How very awesome!!!! Can’t wait to get my hands on it! The new architecture looks very promising!

  3. Vinnie Terranova August 27th, 2010 1:38 am

    Elan,

    You must be excited and thrilled judging by your latest blogpost! I can imagine why you would be, after all: you guys have been putting in a lot of hours work and finally you get to show ‘your baby’ to the public… Looking forward to the rebirth…

    Cheers!

  4. MTI August 27th, 2010 1:38 am

    So good! Thanks alot, Elan! Looking forward to September 1st! :)

  5. Chris B August 27th, 2010 1:39 am

    Thanks so much for all your hard work.

  6. Maarten August 27th, 2010 1:41 am

    Sounds like some really cool things are coming up! Great!

  7. mungler August 27th, 2010 1:45 am

    Just curious… is the API ‘REST-ish’? Or ‘REST-ful’? Ie is it actually proper REST or is it only ‘sort of’ REST?

  8. Nudgenudge August 27th, 2010 1:50 am

    I didn’t fall asleep, and it was mighty interesting.
    Also, nice features for the extensibility; definitely some good stuff could happen.

    September cannot come soon enough.

  9. Ian August 27th, 2010 1:54 am

    Thanks guys, this really sounds like a fantastic release, and I can’t wait to get my hands on it.

  10. Jimmy August 27th, 2010 1:55 am

    Thank you for making this ridiculous good media system!

  11. elan August 27th, 2010 1:56 am

    @mungler: Right now it’s only REST-ish :-)

  12. Kasper August 27th, 2010 2:04 am

    Oooh I can’t wait! Plex 8 is GREAT, by all means, but the improvements you talk about is AWESOME!

    As a fellow nerd, I almost get goose bumps when you present the re-construction of the application and framework – and I fully understand the need to have a solid bullet proof foundation for future improvements / add-ons! SO GOOD!

    Thank you all for your excellent work! :)

  13. Tom Clarke August 27th, 2010 2:05 am

    Nice update! Looking forward to the new version of what is a very fine piece of software indeed.

  14. GFTU August 27th, 2010 2:25 am

    I just peed my pants a little.

  15. sunnyhd August 27th, 2010 2:32 am

    Good news!!
    Is there some example code for creating a remote app / query the database directly?

    http://www.youtube.com/watch?v=JTyD6gRU_iA

  16. Matthias August 27th, 2010 2:40 am

    That sounds fantastic! Can not wait!

  17. Ozgur Gungor August 27th, 2010 2:46 am

    All I can is this; Thank You, Thank You, Thank You, Thank You…

  18. Pascal August 27th, 2010 2:49 am

    This is just pure awesomeness! I’m so excited right now!

    Not only do I really want to use that new library for organizing, I also wanna develop something for it! OMFG, this is Python, XML and a brilliantly new structure!

  19. Kevin August 27th, 2010 2:51 am

    Looks great – I can’t wait to take it out for a spin.

    I gotta say – whichever program (between you and Boxee) figure out well integrated HD Homerun and PVR front end support, I’ll be a user for life!

  20. damon5334 August 27th, 2010 2:52 am

    I’m not sure the last time I’ve been so excited for an application. Great job devs, I might need to take Wednesday off work :)

  21. jax sedrin August 27th, 2010 3:59 am

    Eeeeeeeeeeeeeeeeeeeeeeeeeeeeee so exciting!!! Can’t wait!!!

  22. Martin August 27th, 2010 4:12 am

    I’ll go one step further than the comment above, – I’ve never been so excited over an application update, I’m sure the new features will be well worth the wait.

    I’m really glad that the rude and obnoxious comments made by some of the more impatient plex users did not get to you guys. They don’t deserve this update.

    Just need a new unibody mac mini now!

  23. chander August 27th, 2010 4:19 am

    The most incredible thing about this awesome upgrade ?

    Plex Nine is still FREE!

    Count me in for a little donation.

  24. maersk August 27th, 2010 4:26 am

    This looks awesome and i’m looking forward to use this Plex 9 version. Would thank all developers for their hard work and efforts for making this excellent piece of FREE software. Thanks again guys you’re great and my girlfriend wants to kiss you all.

  25. xain09 August 27th, 2010 4:26 am

    Thanx for the info. Looking very much forward to Mr. Nine.
    Now all I need is a Plex Client for the iPad ;)

  26. Ron August 27th, 2010 4:33 am

    Thanks for the explanation! You crack me up! Now get back to Angry Birds already!!! ;)

  27. Clamdee August 27th, 2010 4:55 am

    I will be taking Wednesday off so I can fool around with every single part of the new Plex. I really want to make short videos of it showing it’s excellence as well. Thanks for all the hard work!

  28. Slappy August 27th, 2010 5:03 am

    Yes, I think I’ll be calling in sick one day next week in order to test out some new software.

  29. PK August 27th, 2010 5:05 am

    First law of a major new release: there will be bugs. Second law: the very people who screamed impatiently for the release to come sooner will be astounded and upset that there are bugs, and will scream even more loudly.

    Everyone needs to go into this with eyes open, seeing the benefits and recognizing that it’ll be a shaking out process.

  30. Chris August 27th, 2010 5:29 am

    Could the team comment on the status of the source code for Plex/9? What, if any, components of the system will be open source? Where will said source (if any) be available?

  31. Steve August 27th, 2010 5:43 am

    So, by separating the client from the server, it opens up the possibility for new clients, right? Say, an iOS (and rumored iTV) app or web front-end (serving videos in HTML5)? Would that come out of the @plexapp camp or the community?

  32. Mo August 27th, 2010 5:45 am

    Can not wait to come up with custom apps and widgets to make use of the api. Just thinking about it gets me pumped up.

    Would you guys be willing to work with a developer trying to get some of these things out for free and some( more awesome) for commercial use?

  33. Bushy August 27th, 2010 5:52 am

    Looks great – I really like the fact that you take the time to explain how it works. Very interesting to read.

    But seriously, wheres Barkley? There should always be a picture of Barkley on your blogposts ;)

  34. mav3r1ck August 27th, 2010 6:09 am

    Thanks for making the media life even more fun and enjoyable!

    I’ve got deep respect for you guys!

  35. Peter August 27th, 2010 6:25 am

    When we upgrade will any information from the Plex 8 libraries be preserved (like watched/unwatched)?

  36. Michael August 27th, 2010 6:44 am

    Hey! Regular expressions are a solution, not a problem! Sure the syntax looks like chicken scratching and isn’t consistent from one program to the next, and their terse pass/fail mentality makes troubleshooting a pain, and embedding them in a “host” language requires hideous amounts of escapes, and they can’t parse nested data, and they can’t “count”, and… ok I see you’re point. But what alternatives are you using to interpret file names?

  37. adriandb August 27th, 2010 6:54 am

    That’s it, I’m donating. You all should do the same if you haven’t yet.

  38. Egils August 27th, 2010 7:16 am

    Elan,

    What, no Barkley picture? :) Thanks for awesome news and all you r hard work!

  39. 0zon3 August 27th, 2010 7:44 am

    Are you considering creating Linux or Microsoft versions of the frontends since you have split up the frontend and the backend. As much as I love running on apple products $699 for a mac mini vs shuttle x350 ($380) or EeeBox PC EB1501 ($450) is a tough pill to swallow just to watch streams to you TV.

  40. pv_bain August 27th, 2010 8:07 am

    tatatataaaaaaaaa good good good, i’m turning all my media to x.264 mkv and jump to 9.

    thanks for all elan and others.

    for sure ypu’ll have a lot of bear rounds for you guys ;)

  41. 41john August 27th, 2010 8:13 am

    Simply amazing, and cant wait to see it next week. Well done to all of the Devs! Donation coming your way soon without doubt.

  42. Russ August 27th, 2010 8:51 am

    Easy to say: this is just the beginning :D PLEX has a bright future!

  43. JPer August 27th, 2010 9:20 am

    I am so pumped for the new release! This sounds incredible!

  44. Anna August 27th, 2010 9:31 am

    This is really exciting news! Congratulations Plex team!

  45. Greg August 27th, 2010 11:49 am

    With the library decoupled from the front end, am I correct in assuming that Plex 9 will allow multiple front ends to access the same library?

    Meaning, if I store my files on a networked server, will I be able to access the same library data from a Mac Mini hooked up to a TV in my living room and a Macbook Pro in my bedroom?

    Looks beautiful!

  46. elan August 27th, 2010 11:51 am

    @Greg: Yes, yes, and YES!

  47. iD4G August 27th, 2010 1:09 pm

    @elan – and will the backend be multiplatform?
    OS X is not known to be the best Fileserver ;-)

    So it would make sence to have the backend running on a fileserver for example, instead of the client Mac.

    Any plans on doing so?

  48. elan August 27th, 2010 2:26 pm

    @iD4G: This is the sort of thing the new architecture would make a lot easier.

    @Michael: I’m not saying we don’t use regular expressions, I’m just saying we try to use them judiciously :)

    To everyone: Thanks so much (from the whole team) for your incredibly kind words. Really.

    P.S. Does anyone know how to get that last @#$%#$ golden egg?

  49. Joe August 27th, 2010 2:43 pm

    thanks team. looks amazing. ill be here at midnight the 31st!!

  50. dev August 27th, 2010 2:59 pm

    i <3 you :D

  51. Johnny August 27th, 2010 10:09 pm

    Amazing this is great !!

  52. Julien Angeli August 27th, 2010 11:13 pm

    There are 14 golden eggs in total

  53. Menteb August 28th, 2010 5:28 am

    - Getting 3 stars in the first chapter
    - Getting 3 stars in the second chapter
    - In the level select screen, tap the sun
    - Watch the credits, there’s one at the end
    - Within any level, go to the help screen. There’s one at the end
    - Level 1-8, tap the unreachable chest
    - Level 2-2, break the beach ball
    - Level 4-7, at the very top right of the map (zoom out)
    - Level 5-19, it’s hiding on the top right of the left tower

  54. Alex_G August 30th, 2010 12:52 am

    Amazing! Now we only need CrystalHD support, and I’ll actually be able to use it!

  55. Gee September 4th, 2010 11:50 pm

    Wicked! Now if someone could just write an agent for http://wiki.d-addicts.com/ my life would be complete ;)

Leave a reply