Home Theater Rude Goldberg

 
So I’m still working on getting everything right for modern Home Theater and here is the basic problem, you want to get content from any source to any device to any location the device may be, so let’s cover the content, the devices and the locations:
Content from Anyone
So what is the content:

  1. Live. Two flavors here Sports and Reality TV. They don’t have much shelf life and the best ones really need to be live, not even tape delayed (Superbowl and American Idol are iconic here).
  2. TV Shows. Again two flavors. The more traditional series that lots of times you want to watch a bunch in a row, but then keep up on the current ones so iconically watch the 10 episodes of Games of Thrones like a big movie vs. see the latest episode of Glee.
  3. Movies. This is highly repeatable content but comes in the highest possible flavor, Blu-Ray
  4. Youtube and Home Movies. This is short stuff that is quickly consumed and copied
  5. Games. There are a bunch of flavors, XBox, PS3, Wii, PC and iOS games.
  6. Music. This problem is solved with iTunes Match as Apple has something that runs on just about everything from iOS to PC and Mac plus it has in the cloud storage and on device caching. It is really the model for how video should work.

So the hardest part with the content problem is that because of licensing, there are a zillion (it seems) places where you can buy the content and it comes in a zillion different forms
Here is where the content sources that you can buy:

  1. Netflix ($8/month). This is a good source of older movies and TV shows. They only allow streaming but at least they are commercial free. You can pretty much get this from an iOS, AppleTV, Mac or Windows devices, so this is the easiest to get. This is now about $8/month since I discontinued getting Blu-ray movies with them.
  2. Comcast or your local cable company via SiliconDust HD HomeRun (Triple play makes it hard to estimate but about $30-50/month plus $30/month for premium). This is mainly via the RG-59 cable that comes into your house and then you can view with a Comcast DVR (Motorola), TiVo or the new Silicondust HD HomeRun Prime. The Comcast box is completely closed and not at all in the running, so the Silicondust HDHomerun Prime which takes content and eventually dumps it as MPEG-2 streams onto your intranet, it seems to work with MythTV and can produce an MPEG-2 file with all the raw streams intact including all the various audio formats. The main issue has been that MythTV is pretty much a hackers dream (see below for how to setup) and not super simple. It mainly produces obscurely named .MPG files right now and I’m completely locked out of the setup screens for reasons I don’t understand.
  3. Comcast via TiVo ($14/month additional for TiVo). TiVO is very mature and expensive, but it does work pretty well. In particular, the PyTivo application let’s you publish your media server out to the Tivo, so it can be a media client, but more importantly with the iTivo application, you can download the raw MPEG-2 streams with all the content (something called decrypt only that is buried in the option menus) or you can transcode it to MPEG-4 in reasonable time (reasonable being 4 hours for every 1 hour of content, but you lose your fancy multichannel feeds). The connection to the Tivo seems pretty flaky, but it does work decently and the naming of the files seems to work.
  4. Home Movies. I have a variety of home movies stored in AVI, M4V and MKV format on a file server that is currently a Mac Mini with a Drobo Pro drive array. 
  5. Blu-Ray disks from Local Video Store. After having been a NetFlix rental guy since 2001 (?!!!), I finally cut the cord and stopped renting from them mainly because there were so few new movies. Now the local video store here (On 15th Video) has a $5/video for a week rental plan. Main issue is that no of the Macs I have do Blu-Ray but it would be nice to show a Blu-ray from a PS3 or something to any computer or device in the house. Still researching this one. So right now, I have a PS3 attached to each television for Blu-Ray (and games too!). Alternatively, you can buy a separate Blu-ray drive and plug it into a Mac Mini.
  6. xBox, PS3 and Wii. Have one of these mainly for games but have to have a box at each screen oh well.
  7. Hulu.com. With all those lovely commercials but at least they are full episodes. Comcast actually now licenses it.
  8. Abc.com, nbc.com, etc. Manu of the individual providers have both websites and some have iOS applications as well.

Then there are two sources I’m experimenting with but probably won’t use.

  1. Amazon Prime Video. I became a Prime member mainly to see if I would actually like their video collection or rent their books. Right now I’m not super impressed mainly because to see something, you can’t use an IOS device to get it pushed to your TiVo. You need a real computer because they only do flash. I tried using the $5 Photon browser to watch flash on an iPad and it was miserable.
  2. Apple Store. They have video rentals as well but they are decently expensive and only play on Apple devices of course 

Here are the transcoding and file format issues
The big issue is that different devices have different formats that are natural. 1080p is not 1080p. As an aside mediainfo is whatAnandtech uses to analyze what the file compression is in reality. It costs a whole $1 or you can use videoinfo which uses the open source libraries of mediainfo as freeware:

  1. 480p. This is so called Standard Definition and is about 400MB/hour in MP4 format
  2. 720p. Most of this content is in MKV container but is actually H.264 format which is 1GB/hour highly compressed which is usually for 6Mbps or 3GB/hour. Much of the time it uses the X264 encoder to produce it. 
  3. 1080p Blu-ray. This is very high definition and use what is called High Profile H.264. Blu-ray for instance uses MPEG-4 Part 10 AVC aka h.264 and TrueHD audio which is  28Mbps with a peak of 40Mbps or 20GB/hour. So getting your content from Blu-ray is still the highest quality that you can get and they typically have tracks that are beyond Dolby 5.1 so you need MKV to store it (see below)
  4. 1080p Apple. All the lastest apple hardware (Macs and AppleTV generation 3) can handle Blu-ray rates, but the movies you get from Apple are more compressed. Their 1080p movies are 4-6GB with Dolby AC-3 which means about 10Mbps so it is in the intermediate range and can be delivered on MP4.
  5. 1080p Comcast. They use MPEG 2 (MPG files) so they are much less efficient and an hour of video is about 5-6GB indicating about a 12-13Mbps. This is an easy candidate to transcode to MKV or MP4 using Handbrake, but then you have to use the correct parameters. There is much floating around here about how to do this, but the conventional wisdom is MP4 is about 4x smaller than MPEG-2. You can use Handbrake to do this with a constant quality parameter so rule of thumb is that if you have a 13Mbps MPEG-2 like Comcast does for a typical station, then you have to set the RF (relative quality factor). CRF of 18 gives you 5:1 while CRF of 15 gives you 2.5:1 so if you want to do the conversion that is about what you will need. It takes quite a long time about 2 hours for every hour of content. I’ve actually been trying this on a real life 1080p60 one hour stream from Comcast that is MPEG-2 and I’ve found that RF 18 actually gives you 1:1 with the original, RF20 gives you about 2/3 the size. Trying RF22 right now, so it looks like some tuning is needed. Also getting the audio right. That is to pass through as AC-3 rather than become stereo is also a trick with Handbrake.

Container formats
For whatever reason, there are huge variety of format container. That is where you can have different formats, so there are two issues, transcoding for lower bandwidth or changing the container. The big deal here is that the container that Apple likes 

  1. AVI. This is a Windows container, it can hold lots and lots of different things and generally Apple devices cant see this.
  2. MP4. This is the format container for video for all things that are MPEG-4. Apple seems to mainly want to consume this format. Most of the time it holds H.264 video, AAC for 2 channel or AC3 for 5.1 Dolby Digital  DTS plus .srt subtitles
  3. MKV. This is the standard format called Matroska which doesn’t just hold video, but also many other non-video related information . It’s main advantage is that it is completely open and it has some features different from MP4 or AVI which that don’t matter much to me including supposedly better for high definition, you can imbed subtitles of different sorts like .ass, advanced audio formats, multiple soundtracks and DVD-like chapters. Tools like subler, MKVtools and iflicks let you do the conversion to MP4 so you so you can use MKV with Apple since most of the time MKV and MP4 hold H.264 (eg the codec used by Blu-ray). The main thing you lose on conversion is that you lose the advanced audio format like DTS, DTS-HD/HR or TrueHD
  4. MPG. This the MPEG-2 container name and is older and just has AAC. 

The biggest complexity is getting the storage format right a universal format (MKV) but one that Apple likes directly (MP4). No good solutions here for one format that rules them all

  1. The ultimate answer is that if you should pick H.264 to transcode to as this is the most advanced format.
  2. If the content only has 5.1 sound, then go to MP4, if it is more advanced then use MKV.
  3. You should store it in the lightest compression that you have available because disk is cheap. If it was originally Blu-ray then you want 20-30Mbps which trnslates into 20GB/hour (and you better start buying 3TB drives and backups). 
  4. If you have broadcast content (eg Comcast) at MPEG-2 13Mbps and Dolby AC-3 then you can transcode this down to H.264 with Handbrake

Whatever you are viewing things on has got to have some sort of server side doing conversion and transcoding because most of the time you won’t be able to see full resolution nor need it nor have the bandwidth required.
 
Devices of any kind
Onto these outputs and the solutions to get all of the above viewable (Netflix, Comcast, Server stored).

  1. Mac. The iMac makes the perfect mini television right now and with the upcoming Mountain Lion, they can do 
  2. iPhone 4 or earlier. These are slower devices
  3. iPhone 4S.
  4. iPad 1.
  5. iPad 2 or 3. The big breakpoint here is that they can do Airplay mirroring and can support 720p and 1080p content well.

Locations of any flavor
Where would you want to see this

  1. At home. That’s obvious where you own the bandwidth. The biggest issue here are the 250GB caps that the ISPs are now putting in. That’s easy to use
  2. On the road. This is where caching really matters which is via 3G where the issue is the 2GB cap
  3. On the airplane. When you are really disconnected
  4. At a hotel. When you are remote but have broadband access which is oftentimes slow and blocked.

The Solutions
So this is a big 3 dimensional matrix (multiple sources against multiple devices in multiple locations). Here is the solution that works cobbled together. I thought I would do this by what has to run and where it is running:
On the Server or the cloud
The core strategy here is to have a Mac Mini Server

  1. Mac Mini Server. Raid drive (DroboPro) which as a volume Video with Movies and TV Shows separated into folders
  2. Files. The Filebot application is wonderful for renaming files so they are standardized with movies and their release dates, TV Shows with their season and episode and names

Then there are the daemons that need to run on the server:

  1. Plex Server. Running the Plex server backend which goes through these and then publishes it to all Plex
  2. AirVideo Server. This seems to be the most robust streamer but is only for iOS devices. it does work remotely over the Internet.
  3. Apple File Sharing. XBMC and an Mac or PC just need file sharing as their clients handle things.

The main open issues are the Screen Sharing and Network connection seems pretty flaky. This might be a Lion bug, but essenitally Bonjour seems unreliable. The server appears and disappears off the network. I can’t tell if this is because I have the Mac Mini connected over Wifi and there are reports that Lion loses Wifi connectivity (I’m going to try a USB Ethernet dongle next) or because of something having to do with Bonjour itself, but it is pretty frustrating.

In the cloud

  1. iTunes Musicmatch is the model where the stuff ultimately lives in the cloud, but the problem is you need performance too. The candidates are Apple itself, Amazon Web Services or potentially Dropbox. The main issue is how to get enough storage. Bluehost which is use is a good candidate, but they limit files to less than 1GB although they have “unlimited” bandwidth and “unlimited” storage.

As an aside, I’m also in the middle of getting a dedicated NAS, the Synology 1812+ (cleaver name), it has 8 bays like the Drobo and will run the Plex Media Server directly since it is essentially a Linux box. That might be a good way to make things work even better.

Here are the client devices

  1. iPad 1. This device isnt super powerful, it doesn’t support Airplay Mirroring, so you can use it to watch Netflix by dedicated application,
  2. iPad on the airplane. Cache files and watch with AirVideo. Works with MKVs
  3. iPad in hotel. Stream from Netflix and cache some with AirVideo, also can use the AirVideo Server remotely apparently through Airport Extreme to see videos on the home network.
  4. iMac as mini home theater using Apple Remote. Use XBMC and connect to the media server over network.
  5. Macbooks in house. XBMC allows you to see Homerun, Zeroconf (aka Bonjour aka Mac servers) which is really nice or Netflix
  6. Macbooks on the plane. Copy over files and then use XBMC
  7. Macbooks in a hotel. Netflix or XBMC on cached files
  8. Home Theater. Trying AirPlay Mirror on AppleTV 3 from an iPad with AirVideo Player, it sure does work well. It also shows Netflix and you can use the Remote application on iPod Touch to control it as well if you need to, although the iPad is a simpler controller.
  9. Flat screen. Need to get another AppleTV and iPad to control it for Netflix.

In Summary here are the players right now
Here is what I’ve tried that are keepers

  1. AirVideo. This is pretty amazing, can cache on an iOS device, browse but you do have to install an AirVideo Server on a Mac or PC somewhere. The main limitation is that it only shows 720p
  2. Netflix. Currently $8 a month. A good way to get second run movies and old TV series. Works on iPad.
  3. Filebot. Wow this is a Java application that runs cross platform (one of the few). It has a strange user interface but is free and let’s you rename your video files so that they make sense
  4. iTunes Musicmatch. This is pretty invaluable. Sync your music into the cloud, then find a clean machine and attach it, then let is down sync 256Kbps M4As that are pristine copies of all your music.
  5. XBMC. Just found this application in research on how to view 720p movies on iPads. It grovels the various servers on the network which is super convenient.
  6. Plex. This is related to XBMC but also has a server, so it is like AirVideo in that it allows transcoding. So you can either use AirVideo for iOS devices and then XBMC for everything or Plex for it all. So I’m trying both.

The main open issues are;

  1. Both Plex and XBMC try to find the underlying TV show and movie information and they do an OK job with random file names and directory names, but it is pretty clear that you have to clean up the names to make it all work right.
  2. Mac Mini. This is the biggest issue I’ve had as the Mac Mini seems to keep appearing and disappearing from the network. Not sure what is going on but have noticed this problem for a long time. A reboot of the Mac Mini seems to make it reappear and sometimes turning on and off Wifi, but it is hard to reproduce. I’ve noticed that sometimes when I do a network ping the machine doesn’t respond, but it is still connected to the Internet. Have the same intermittent problem with my Time Capsules. The big issue here is how to serve the files, they are right now an Apple file protocol, SMD protocol and I’ve been experimenting with using AirVideo server and Plex server to also serve it. Does seem like lots of protocols!

Things that I’ve tried but didn’t work super well…

  1. Goodplayer. This is an IOS application, plays 720p MKVs well and most importantly has an SMB scanner, so you can look for files on servers to copy. Not super elegant, but great except that it can only download one file at a time so it is not the easiest to use.
  2. VLC seems to handle just about any format, so is the backup to XBMC on the Macbooks.
  3. VLC on iPad to VLC Streamer on Mac. This works semi OK. Seems to lose connection to VLC Streamer quite a bit and has video lag.

What I’ve tried that doesn’t work:

  1. I’ve tried iPhone VLC but it is not hardware accelerated and doesn’t support 720p MKV as a result
  2. CineXPlayer is suppose to be good but doesn’t support MKV

If I were king for a day, here is what I would do if I were the major players:
We are just taking the major players with over $20B in market capitalization:

  1. Apple
  2. Microsoft
  3. Comcast
  4. Sony
  5. Samsung
  6. HBO
  7. Google
  8. Facebook
  9. A random startup

Other Guides
Getting this whole thing to work took quite a bit of hacking, here are the instructions for
 
Getting a Windows Media Center up on a MacBook:

  1. Their instructions aren’t the greatest, they say they require a PC to setup things up, so I finally thought I should probably have a Windows 7 machine lying around, so here are the incredible byzantine instructions for getting Windows 7 to run on a Mac.
  2. First you have to have a Mac with an optical disk because Windows 7 won’t boot from a USB image of a CD. Ugh! And it turns out Mac needs a particular boot format which Windows doesn’t have.
  3. Plus getting the Apple drivers for Windows  is an incredible pain because Apple doesn’t have a separate driver pack for Windows, it has a very pick Boot Camp which needs to see things just right (like a single partition on your hard drive) before it coughs up the driver download. Whew! Alternatively ask a buddy who has a single partition with an optical disk to do the automatic download or splunk the internet looking for the 600MB file and stick that onto a USB stick.
  4. Now you need to find Windows 7 more than Home Basic (how can you have so many version). Run installation and then spend the day getting your various Windows Update hotfixes
  5. You need to have antivirus too since it is a Windows machine. Comcast users can go to http://comcast.net and click on this micro button at the top called security and then they get something (very annoying) called ConstantGuard and then you can finally install Norton Security Suite 7
  6. Now start Windows Media Center and go to the Extras (wow the UI here is really different) and install from the Extra Gallery, something called the Digital Media Advisor, make sure your computer is plugged in if it is a laptop. The thing runs a performance test and will fail if the computer isn’t plugged in with a dire error message and an actual note saying, troubleshooting tips should go here (?? really??)
  7. This then installs the widget you need to use a CableCard, and now browse back to Tasks/Settings/TV/TV Setup (four menus deep!). Get your zip code and wait for the program guide to download, it will go through yet another activation and hopefully find your HD HomeRun Prime you setup.

 
Getting a Windows Media Center up on a MacBook:

  1. Their instructions aren’t the greatest, they say they require a PC to setup things up, so I finally thought I should probably have a Windows 7 machine lying around, so here are the incredible byzantine instructions for getting Windows 7 to run on a Mac.
  2. First you have to have a Mac with an optical disk because Windows 7 won’t boot from a USB image of a CD. Ugh! And it turns out Mac needs a particular boot format which Windows doesn’t have.
  3. Plus getting the Apple drivers for Windows  is an incredible pain because Apple doesn’t have a separate driver pack for Windows, it has a very pick Boot Camp which needs to see things just right (like a single partition on your hard drive) before it coughs up the driver download. Whew! Alternatively ask a buddy who has a single partition with an optical disk to do the automatic download or splunk the internet looking for the 600MB file and stick that onto a USB stick.
  4. Now you need to find Windows 7 more than Home Basic (how can you have so many version). Run installation and then spend the day getting your various Windows Update hotfixes
  5. You need to have antivirus too since it is a Windows machine. Comcast users can go to http://comcast.net and click on this micro button at the top called security and then they get something (very annoying) called ConstantGuard and then you can finally install Norton Security Suite 7
  6. Now start Windows Media Center and go to the Extras (wow the UI here is really different) and install from the Extra Gallery, something called the Digital Media Advisor, make sure your computer is plugged in if it is a laptop. The thing runs a performance test and will fail if the computer isn’t plugged in with a dire error message and an actual note saying, troubleshooting tips should go here (?? really??)
  7. This then installs the widget you need to use a CableCard, and now browse back to Tasks/Settings/TV/TV Setup (four menus deep!). Get your zip code and wait for the program guide to download, it will go through yet another activation and hopefully find your HD HomeRun Prime you setup.

Getting HD HomeRun Prime up and running
Now it turns out a Windows Media Center isn’t needed, so here are the HD HomeRun Prime installation instructions Here are setup instructions for the HD HomeRun Prime from http://www.silicondust.com/support/hdhomerun/instructions/prime/. What this does is get their little server box up and running, so it can distribute the MPEG-2 streams from your cable operator to anything on your network. As an aside, this works well with Comcast because they have the copy freely bit set even for things that are content protected, so you can see the raw MPEG-2 streams on non-Windows Media Center devices.

  1. Turns out of course, they don’t really need this at all, here are the easier instructions, plug the HD HomeRun Prime into you network, get the configuration tool from their download page http://www.silicondust.com/support/hdhomerun/downloads/ get a CableCard (I got one from one of the TiVos I have, this is fine since most of the time I actually use TiVo transfer to get videos from one to the other, so I really only need one CableCard for all the TiVos). Then browse to the configuration website for the HomeRun Prime and see that it is working.
  2. Activate the HD HomeRun Prime by going to http://comcast.net/activation because you have to associate the box with the CableCard. Or there is a magic number to try to get a human to do it. 1-877-405-2298, they will ask for a bunch of numbers that are all on the home page of the Silicondust device (thanks for that!). The biggest problems in making this work is that the Comcast billing system is separate from the provisioning system so if you don’t see all your channels, you have to point them in that direction to fix.
  3. You should now have a working HD HomeRun Prime and now you need to activate the clients, where your choices are a Windows Media Center (see above)

Getting MythTV on the Mac running and connecting it to HD HomeRun Prime
 On the Mac, you have to use MythTV running on Mac or Linux (with Comcast, you can see most channels because the Copy-Freely bit is set for most content there), then you first have to get MythTV up and running. This is seriously difficult as there is no simple instructions, but here is the short form. Mythtv.org does have a wiki page on this that is pretty accurate

  1. First you have to load MySQL. Not super easy as you actually have to get into the terminal window and get rid of users that don’t exist, create a mythtv user and create various tables. Yikes
  2. Now you have to download MythTVBackend, currently in version 0.25. And run MythTV-Setup. This is hard because while there are instructions for HDHomeRun, there are no instructions for HDHomeRun Prime which is a bit of a different device. You basically have to go through their Setup which is a series of menus and things and compare them with the Wiki to make sure you get them right.
  3. The big thing is to make sure to say you are using OpenGL to display
  4. Now you have to signup for Scheduledirect.org to get the programming guide. It is $20/year so not that big a deal
  5. Then you actually have to run a database thingy to do a –dd-get-all which sucks down the scheduledirect.org database into your mysql database
  6. Finally you run MythTV-Frontend and again you have to dive deep to set a bunch of parameters.
  7. When I first did this I got a tuner busy message, this means you probably have to do a reboot as the Mythtv-backend sometimes goes wild.
  8. When all this works, then you go down a bunch of menus to specify how to record. It sure ain’t as easy as a Tivo
  9. You specify a local directory and it starts dumping huge MPEG-2 .mpg files into it with really long file names that look like date stamps. 7GB per hour
  10. I found that with a Mac Mini (2010) running over a 802.11n network at 78Mbps, I wasn’t able to handle recording correctly this video stream. Seems like you need a big server and it needs to be on a gigabit ethernet or at least a connected ethernet. When I moved my Mac Mini from a 802.11n network with about 78Mbps of bandwidth downstairs to the gigabit ethernet port all the slow down vanished.
  11. The MythTV frontend is truly clunky, so it looks like the better approach is to just use the MythTV backend and then either rename the files or try MythWeb as a frontend. 
  12. MythWeb is currently broken on the Mac with the 0.25 release but its pretty clear what you really want is to take the MythTV stuff and turn the MPG automatically into MP4s (since they don’t have advanced 
  13. The filenames that MythTV uses are pretty obscure, basically, the tuner number, the channel number and the data stamp. There is a perl script calle mythlink.pl that you can run after it completes which can give you a symbolic link that is meaningful to humans with date time and episode and so forth. Then you can use that to display with AirVideo player for instance. Or use it to do a batch transcode to MP4 via Handbrake

I’m Rich & Co.

Welcome to Tongfamily, our cozy corner of the internet dedicated to all things technology and interesting. Here, we invite you to join us on a journey of tips, tricks, and traps. Let’s get geeky!

Let’s connect

Recent posts

Loading Mastodon feed…