• Home
  • Assertions
  • Poetry
  • Programming

Record and Reverie

General things I find interesting

Feed on
Posts
Comments
« So Long Perian
Tooling Matters »

My Media Setup

Jun 5th, 2012 by Graham Booker

While I’ve described some of the pieces in my media setup, I have not described it as a whole. I started the process when I got annoyed with DVDs that don’t allow you to skip the copyright warnings, commentary disclaimers, trailers, endless menus, studio logos, and other crap when I simply wanted to watch the movie. It was time for something better, and now I have it.

Storage
I’ve written some on my storage setup before, but I’ll describe it briefly here. I bought an Antec 300 case, Intel server-class motherboard, 6 WD 2TB Black drives (before the flood that drove up the prices), and 4G of RAM (later upgraded to 12GB). The machine is booting Ubuntu 11.10 (not yet upgraded to 12.04) off a pair of USB flash drives which are configured in a software mirror. The 6 drives are configured in a raidz2 configuration (raid6 redundancy) yielding 8TB of disk space (or 7.2TB if you count in base 2 instead of 10). The raid contains all the media is an a sub-filesystem so it can be snapshotted/backed up independently (taking advantage of ZFS’s capabilities here).

Content
All the storage in the world isn’t useful if there isn’t anything to put on it. I’ve experimented with several different forms, but I’ve finally settled on ripping my DVDs and BluRays to MKV files. I added a SATA card and a BluRay burner to my storage array for this purpose. Most would rip DVDs using Handbrake, but since I have the space, I’m doing a lossless conversion. I’ve been using MakeMKV to rip the DVD content into an MKV file which contains the original MPEG-2 video, AC3 audio, and DTS audio (when present). I only include the subtitles when I need them. When it comes to ripping BluRays, there’s little choice beyond using MakeMKV for the actual rip process. The resulting file can be run through Handbrake to transcode, but I’m still experimenting with keeping the original file. In that case, it contains the original H.264 video and DTS-HD or Dolby TrueHD audio.

Server
In my case, the server and the storage are the same hardware, but there’s also the software component as well. In the past I worked on a plugin for Frontrow (on the Mac) and the AppleTV. It did a nice job of cataloging my movies and TV shows. I’ve never been happy with any of the other solutions, so I ported this over. In doing so, I realized that I should change it from client-only to a client-server relationship, but a client-server relationship brings it own set of challenges. For instance, it makes little sense to design a server that’s only capable of supporting a single client, so the server has to be designed with concurrency in mind. At first I thought of playing with a C based metadata server, but quickly I realized that I would be far better off using a Java based server due to its superior threading models and concurrency primitives.

I decided to transfer everything over HTTP where the client will make its requests via HTTP GETs and information from the server is transferred via JSON. I also decided that I’d put a majority of the intelligence in the server, so the client only makes requests of URLs which the server provided in a previous response. The initial connection is advertised via mDNS and extra information can be transferred via HTTP headers. So, when the client starts up, it listens for mDNS broadcasts of the server and makes the initial connection. The server tells the client to present the user with a list of items, where each item contains a title, preview information, the URL to access when the user selects the item, and what type of display is contained at that URL. Additionally, there are URLs for the list menu and the contextual menu of each item. So, with a small set of display primitives, I have a fully functional set-top display all delivered by a server. Furthermore, due to having a client-server system, when I get more set-top boxes, the information is automatically synchronized between them. So I can stop playback in one room, and resume it in another.

Client
I spent a while trying to find a good client. I originally looked into a Roku, but I found it terribly lacking. Furthermore bringing up any such deficiencies in the forums brought on the wrath of its fanboys. The final straw was trying to deal with Roku’s terrible programming language, brightscript, and making it actually do something useful (for more info see my post on their forums). The Roku is now a black piece of plastic sitting in a closet, where it belongs.

I later bought a GoogleTV, particularly the Sony NSZ-GT1. It seems to have gone up to nearly $300 which is significantly more than the $170 I paid for mine in Nov. I selected this device because it not only can play high bitrate 1080p content, which the Roku claims but fails to deliver, but it can also play nearly any other content that I have such as AVIs, MKVs, MP4s, FLVs, and even MPEG2. Furthermore, it’ll play the typical codecs found in these files, including passing through the AC3 or DTS to a decoder. In short, it plays nearly everything that I’ve thrown at it, so it makes an excellent set-top box for playback. Soon, more manufactures are supposed to be releasing their GoogleTVs which should drive the price back down.

Since the programming language used on the GoogleTV is Java, I was able to significantly reduce my time spent parsing data from the server. I created a set of Java objects which defined the data I wished to transfer, and simply copied these objects to the client. Then I simply used the Jackson library to serialize and deserialize these objects to and from JSON on both ends. Additionally, the client is powerful enough to do some interesting additions. The GoogleTV is currently lacking the ability to display subtitles, so I added it myself. I currently can display both SRT and VobSub (IDX/SUB) subtitles. I suppose I’ll be adding SUP in the future to support BluRay subtitles, but since its format is similar to VobSub, I expect it to be a simple process.

Conclusion
So, there it is. I have a set-top box from which I can play anything that I own. Whenever I get a new disk, I immediately stick it in the server and rip it without ever playing it in an actual player. I remember seeing a commercial as a kid depicting the future. It had some kids in a household scrolling through a list of movies on the TV, selecting one, and it immediately played. Back then, the idea was not feasible, but now I have it.

Posted in General

4 Responses to “My Media Setup”

  1. on 08 Jun 2012 at 2:16 am1Noah Coad

    This is a great write up! Wish I had known this a week ago, would’ve saved me so much time. I’ve tried a Roku, Apple TV 3, Mac Mini, all without happiness. I’ve really just want to easily stream 1080p MKV, sounds like Google TV is the right thing for that, I’m going to give it a try. My server is a 4U 20-drive-bay case w i7 24 GB RAM running Win Server Core + Hyper-V w Windows Home Server and other VMs (Ubuntu in there). Don’t own any BlueRay, but if I do I’ll follow your advice and rip w/out down conversion.

  2. on 08 Jun 2012 at 2:18 am2Noah Coad

    p.s. That is kickass you’ve written your own extensions. I wrote an extension for Win Media Center, but that was long ago. Got them published somewhere (github maybe?). Would like to use the subtitles on some foreign films.

  3. on 08 Jun 2012 at 2:52 am3Graham Booker

    Noah,
    It was actually your tweet asking about using a Mini that prompted me to write this up. Between my dad and I, we’ve tried the Roku 1&2, AppleTV1 (I didn’t bother with 2 or 3 since I saw where they were going), and a Mini; The GTV is the best for this. The device will stream 1080p MKV out of the box from a DLNA server, but I went with my own client-server since I wanted more customization of both sides (such as virtual directories). If you are interested in trying it out (and improving it I’d hope 😉 ), then let me know and I can get you access to the repository (it’s friends and family only ATM). The server should work on any OS that supports Java, so it should be able to go where your actual data is stored. BTW, of the devices available now, the Sony is better about updates and the like than the Logitech.

  4. on 27 Jun 2012 at 11:29 am4wazza

    Hi Graham,

    Long time no talk 🙂

    It’s neat that you did a Sapphire port. I was very disappointed that Apple discontinued Front Row in the latest OS X releases so I ended up searching for alternatives. The client server route seems to be quite popular everywhere now and I eventually settled on Plex. I don’t have an Apple TV, but found between the mac mini and the plex iPad app my content requirements were well catered for.

    I miss Front Row & Sapphire though. And my partner finds Plex way more complicated compared to the old set up, which tends to scare her a bit 🙂 The simplicity my old system was a big plus.

  • Recent Posts

    • Tooling Matters
    • My Media Setup
    • So Long Perian
    • What Objective-C can learn from Java, Part 5 (Exceptions)
    • Switched to Linux
  • Archives

    2022
    April 2022 (1)
    2021
    May 2021 (1)August 2021 (1)
    2020
    March 2020 (1)
    2019
    November 2019 (1)
    2018
    June 2018 (1)July 2018 (1)December 2018 (1)
    2017
    January 2017 (2)June 2017 (1)August 2017 (1)
    2016
    June 2016 (1)August 2016 (1)
    2015
    January 2015 (1)February 2015 (1)December 2015 (1)
    2014
    June 2014 (1)July 2014 (1)August 2014 (2)
    2013
    February 2013 (2)March 2013 (1)April 2013 (1)June 2013 (1)November 2013 (1)
    2012
    April 2012 (2)May 2012 (1)June 2012 (1)November 2012 (1)
    2011
    January 2011 (1)October 2011 (1)November 2011 (1)December 2011 (1)
    2010
    February 2010 (2)April 2010 (1)June 2010 (1)July 2010 (1)August 2010 (1)September 2010 (1)October 2010 (2)December 2010 (3)
    2009
    January 2009 (1)February 2009 (1)March 2009 (2)May 2009 (1)July 2009 (3)September 2009 (1)
    2008
    January 2008 (1)February 2008 (4)March 2008 (1)April 2008 (6)May 2008 (1)June 2008 (3)August 2008 (1)September 2008 (2)October 2008 (2)December 2008 (1)
    2007
    January 2007 (1)February 2007 (4)March 2007 (5)April 2007 (4)May 2007 (1)June 2007 (6)August 2007 (3)September 2007 (3)November 2007 (3)December 2007 (4)
    2006
    January 2006 (4)February 2006 (10)March 2006 (4)April 2006 (6)May 2006 (2)June 2006 (4)July 2006 (1)August 2006 (1)September 2006 (4)October 2006 (6)November 2006 (3)December 2006 (3)
    2005
    October 2005 (6)November 2005 (13)December 2005 (1)
    2004
    February 2004 (2)March 2004 (1)April 2004 (1)May 2004 (6)June 2004 (6)July 2004 (3)August 2004 (2)September 2004 (1)November 2004 (5)
    2003
    September 2003 (1)October 2003 (3)November 2003 (1)December 2003 (1)
  • Categories

    • Breakaway (5)
    • Family (4)
    • Friends (2)
    • General (151)
    • Nature Pictures (8)
    • Politics (2)
    • Programming (41)
    • School (11)
    • SysAdmin (8)
    • Teaching (2)
  • Tags

    AC3 Ads Code Frontrow Java Objective-C Open Source Perian Perl permissions plex plugin RSS Sapphire School Servers ZFS

  • Pages

    • Assertions
      • Female Friends Who Won’t Date You
      • Not Dating Friends
    • Poetry
      • Curtis Staying Over
      • Girl Questions
      • Scaring Girls Off
      • Summer’s End
    • Programming
      • Fire Development
      • Kyocera Ringtone Converter for the Mac
      • Perian
      • Text Compression

Record and Reverie © 2022 All Rights Reserved.

WordPress Themes | Web Hosting Bluebook