Apple TV

From MediaSmartServerWiki
Jump to: navigation, search

Super FAQ: Apple TV + MediaSmart Server

Originally posted[1] on the MediaSmartServer.net forums by Abulia


There tends to be a lot of questions and a fair amount of confusion when it comes to using the Apple TV (ATV) in conjunction with the MediaSmart Server (MSS). In this FAQ I will attempt to dispel any confusion between the two, how to maximize your setup to make the most of your investment and why I feel the ATV is the best “head” to drive your digital media stored on the MSS.

The Apple TV at a Glance

If you consider your MSS as the central storage point that “serves” up content for your home the Apple TV – and other products like it – are the “head” that receive and display content in a usable format. This means your music, video, photos, etc. This is the interface that you use to interact with your content and ultimately deliver it.


The Apple TV is a multimedia appliance that can sync or stream content across a wired network or across its built-in 802.11n wireless transceiver. The Apple TV comes in two variations, one with a 40GB hard drive and another with a 160GB hard drive. All units are otherwise identical.


The Apple TV has an optical output, analog stereo L/R, component video, and HDMI. It currently has a maximum bitrate support of 5 Mbps and will output at up to 1080p. It comes with its own remote control.


In February 2008 ATV received a “Take 2” update that expanded its features. Now the ATV is able to connect to Apple iTunes directly to purchase and download content, including HD movie rentals in 720p, without the need for a computer. Because it works with the iTunes infrastructure, the ATV can sync or stream its content from any device on your network that has iTunes.


Including your MSS.


Apple TV Format Support

From the Apple website[2], the ATV supports the following:


Video formats supported

  • H.264 and protected H.264 (from iTunes Store): Up to 5 Mbps Progressive Main Profile (CAVLC) with AAC-LC audio up to 160 Kbps (maximum resolution: 1280 by 720 pixels at 24 fps, 960 by 540 pixels at 30 fps) in .m4v, .mp4, and .mov file formats
  • iTunes Store purchased video: 320 by 240 pixels, 640 by 480 pixels, 720 by 480 pixels (anamorphic), or high-definition 720p
  • MPEG-4: Up to 3 Mbps, Simple Profile with AAC-LC audio up to 160 Kbps (maximum resolution: 720 by 432 pixels at 30 fps) in .m4v, .mp4, and .mov file formats


Audio formats supported

  • AAC (16 to 320 Kbps); protected AAC (from iTunes Store); MP3 (16 to 320 Kbps); MP3 VBR; Apple Lossless; AIFF; WAV; Dolby Digital 5.1 surround sound pass-through

Photo formats supported

  • JPEG, BMP, GIF, TIFF, PNG


Why Use the Apple TV?

In my estimation a digital distribution network either succeeds or fails based on its interface. That is to say, if I can’t easily use it – or my wife can’t easily get to her content – then what drives the digital distribution backbone is meaningless. Thus, when looking for a digital content “head” for my home, I immediately looked at the ATV, a well-designed and dead simple, easy-to-use interface.


Pros & Cons

The ATV has a lot going for it. Here’s what:

  • Cost: Only $229 per unit, expand to meet your needs as necessary
  • Can sync or stream from any iTunes-equipped machine on your network, including the MSS
  • Beautiful and easy-to-use interface
  • Backed by a highly-visible and driven company (ie. not abandonware)
  • Readily available
  • Low profile, beautiful case
  • Supports all major connections (HDMI, etc), Dolby Digital output (Component or DVI only)
  • On-demand video rentals
  • One device to play your digital content: music, movies, videos, podcasts, iTunes content, photos
  • Built-in Flickr and You Tube support!
  • Can play DRM-protected AAC/FairPlay content purchased via iTunes

Downsides? Oh it has a few:

  • Tied to the Apple/iTunes ecosystem; this may be a problem for some
  • Closed system; Apple locks down the ATV (it can be hacked, however)
  • Hard limit of syncing/streaming to 5 ATVs at once
  • No built-in display; have to use your TV to pick playlists/listen to music
  • Won't work on older (analog) televisions as it is Component or DVI only

Understanding How The ATV Works: Syncing vs Streaming

The ATV gets its content three ways: directly from the iTunes Store, syncing from a machine running iTunes, streaming content from a machine running iTunes.

iTunes Store

The first, downloading directly from the iTunes Store, isn’t really applicable in our situation. In this case the ATV contacts the iTunes Store, requests the content, and receives it. This is how you download HD movies, purchase music, etc.


Syncing

The second is syncing. In this model your ATV connects with a computer on your network running iTunes. Once you authorize the connection you can then select what content is then synced or copied to your ATV. That content then resides locally on your ATV. On the ATV this content appears under the “My Movies,” “My Music,” and “My Photos” tabs respectively.


The amount of content that your ATV can sync at any given time is limited by its internal storage, either 40 or 160GB.


An ATV can only be synced with one computer at a time, including your MSS.


Since this guide presumes that you have a MSS, syncing really isn’t that useful; the ATV “only” has up to 160GB of storage and no fault-tolerance. A MSS has at least 500GB (up to 8TB!) and can be fault-tolerant. Instead we want to stream our content, using the MSS as our data store.


Streaming

Streaming is a lot like syncing except the content isn’t copied to the ATV; content is streamed from the data store (the MSS) directly the ATV via iTunes. Again, like syncing, you establish a connection with iTunes on a machine and then share your library. The ATV reads this library and then displays it under “Shared Movies,” “Shared Music,” and “Shared Photos” tabs respectively. When you stream, content never leaves the streaming server (the MSS).


An ATV can connect to multiple iTunes computers to stream content, although only one library can be viewed (and streamed) at a time. A shared iTunes library has a limit of one sync AND five concurrent streamed connections.


So ultimately what we do is run iTunes on the MSS, share our library, and allow ATV to stream from the MSS directly.


What About Firefly?

One of the selling points of the MSS is that it comes with, out of the box, the ability to act as an iTunes server. This is something of a misnomer. First, the Firefly server is an open-source project not related to HP at all and certainly not supported. Also, the Firefly server only streams non-DRM content, and only music. It will not stream iTunes-purchased content, photos, or movies. This makes it pretty useless, IMO.

Firefly will, however, allow you to stream your music content via its web interface to the Internet. Thus you could listen to your music from work, streaming it from your MSS. This, in my opinion, is the only benefit of Firefly.

Anyone who wants to use their MSS as a digital content server with ATV will want to use iTunes.


Using ATV With Your MSS

Presuming you’ve used the console to log into your MSS, getting iTunes running on your server is simple. There are two ways to do this. The first is to use the existing MSS Console, the second a Remote Desktop Connection (RDC) console. The second (RDC), tends to be easier.

NOTE: If you are in an OS X environment (all Mac) with no Windows machine, please see the next section of this FAQ for details on how to setup your MSS.

First, copy your digital content to the MSS. A good, default place is the Music share located at \\servername\Music.

Setup via MSS Console

First, download and install the Program Launcher plug-in for the Windows Home Server (WHS). This will allow you to execute and run programs from the remote console. Once you have that working, simply display the Desktop and run Windows Explorer.

Setup via Remote Desktop Connection/Services (RDC)

The MSS Console is just an RDC connection with a fancy GUI that locks out a lot of features. Using Terminal Services you can connect directly the MSS and install without having to fight with the MSS Console. The RDC client comes pre-installed on all versions of Windows after XP. (All Programs / Accessories / Communication / Remote Desktop Connection)

There is a OS X version for PowerPC and Intel Macs and a complete section below on how to do this.

Point the RDC to your MSS and use the "/console" keyword to login directly to the MSS' console. Use your administrator password.

Important! Any time you are done with your MSS do not log off via RDC! This will close out iTunes not cause the system to be available to the ATV! Simply close/terminate your RDC connection; Windows will leave you logged in but locked. Every time you "login" to your MSS you are simply unlocking the console. Remember, do not log out! (I spent weeks troubleshooting this issue at home.)

Both Versions -- Next Step

From the desktop download and install iTunes. Once you have iTunes installed, run it. You will get an error message that there is no valid sound device. This is normal. Unfortunately there’s no way that I know of to suppress this error dialog box.

Now, map a network drive to your server's share. Do NOT simply point to the D:\share volume! Bypassing the network share and copying directly to the MSS' hard drive can cause issues. To map a network drive, from Windows Explorer select "Map Network Drive," select a drive letter, and map to your \\servername\Music folder (or wherever you placed your content). Make sure to "re-connect at login."

From iTunes set the location of your music, in this case the MSS. Under Preferences / Advanced set the library location to where you mapped your media to. Also let iTunes manage all content. Now “Add to Library” your content, pointing to (again) this same mapped folder. This will add your library contents to the iTunes library. Authorize your MSS to play your iTunes content (“Store” / “Authorize Content”). Then you need to share the library.

Go to your ATV, “Settings / Computers” and establish a connection with your MSS iTunes share. After that is done you should be able to see all of your MSS content on the ATV. That’s it!

Managing Your Content

Unless you want to remain logged in to your MSS all the time to manage your content (not recommended) the easiest way it to simply take your “home” machine and point its iTunes library to the MSS library. Import the MSS content into your library and manage from there, as a file store. This also won’t chew up one of your five allowed streaming connections. Now any new music you purchase will be added directly to your MSS, along with ID3 tags, artwork, etc.


The caveat is, however, that your MSS iTunes library doesn’t know about this new content. That’s not a problem. Using the following script, generously provided by Jehos of Ars Technica, you can setup your MSS to automatically re-import its library at a set interval and update it. If you do not use this script your MSS will never see new changes to its library added from your “home” machine. Your other option is to console in and manually update your library but that defeats the purpose of making your digital content transparent.

Also, see the Help Section section for some additional scripts


Everything we’ve discussed so far also has the benefit of making your entire digital library available to other people on your network, including other computers. Your MSS can share your content with anyone running the iTunes client!


NOTE: If this is a concern for you, you can lock down the MSS share and require a password. Make sure to change this setting on your ATV as well.

Multiple ATVs

No problem. Just connect each ATV up to your MSS shared iTunes library.

Remember that the MSS can only have five concurrent iTunes streams open at once.


The Q&A Section

What kind of output does the ATV support?

Apple TV has the following connections: HDMI and component for video. HDMI and optical for audio with Dolby Digital 5.1 pass-through, L/R stereo for AAC output.

Apple TV outputs 480p, 720p, 1080i, and 1080p. The latter is only available via HDMI with a 1080p-compliant device.

The ATV also has 50Hz output for PAL sets.


Does ATV support 5.1 surround sound?

Yes, but only via HDMI or optical and it requires you to have a receiver capable of decoding the Dolby Digital output; ATV does pass-through only. You must turn this on via the ATV menus, otherwise the ATV outputs 2-channel stereo.

Worth repeating: 5.1 support is pass-through only; the ATV does not decode at all!


What is the native/maximum resolution?

The maximum resolution is 1280 x 720, or 720p. The ATV will scale content for 1080i and 1080p. Depending on your HDTV you may be better off to set the ATV output at 720p and have your HDTV scale the signal to 1080i/1080p. (I’ve seen no discussion as to the quality of the ATV’s scaler.)


How Do I Rip My DVDs/Stream to the ATV?

How you go about ripping your content is up to you. However I would recommend the following for ATV: H.264 encoded video with a DD stream + AAC within a .m4v container at 720p with a maximum bitrate of 5000kbps. This will get you the best picture and sound quality on the ATV and in a format that it natively understands.


As for programs to do this, I can think of none better than HandBrake[3], which also has an ATV preset built-in.


Should I Get the 160GB ATV?

No. The entire point of this FAQ is to use the ATV with your MSS, thus the storage capacity of the ATV is entirely immaterial. Get the 40GB as that is all you will ever need; you’ll be streaming all your content.


Is Gigabit Necessary?

No, but recommended. The ATV has a fast Ethernet (100Mbit/s) connection and supports 802.11n (300Mbit/s). Those are theoretical maximums; in reality your throughput will be much lower. For high-bitrate video you’ll want about 45Mbit/s which is the upper limit of 802.11g and getting close to the maximum of fast Ethernet.


In short, connect the ATV via fast Ethernet or put up an “N only” wireless network for best performance. You’ll be able to stream faster, move through chapters in a movie faster, etc.


Can I Purchase Content on my ATV?

Yes. If you setup the ATV with your iTunes Store account credentials you can purchase music and videos and/or rent HD content directly from the ATV.


Content purchased this way will be synced to your MSS/iTunes library if you use a sync connection. Non-HD movie rentals can be copied to your iTunes library and viewed on another device.


HD movie rentals cannot be removed from the ATV.


An ATV that streams its iTunes library will not be able to sync its content back to the MSS. Thus the recommendation is made to make your iTunes purchases from your “home” machine and update your iTunes library and stream to the ATV on a regular interval. (See the script provided earlier in this document.)


Can You Hack The ATV?

Yes, although that’s beyond the scope of this document. Suffice it to say that you can unlock your ATV and install additional programs to provide additional functionality. This will, obviously, void your warranty.

Thus far I’ve had no compelling reason to hack my ATV.


How Do Movie Rentals Work?

This can be a little confusing based on the restrictions that Apple has placed on rentals and how the ATV interacts with your MSS. Here are the bits that have nothing to do with the MSS:

  • HD rentals can only be made from the ATV and may not be moved/copied/synced
  • SD rentals may be moved to and from the ATV to a computer that is synced with the ATV


SD rentals moved off of the ATV can be moved onto another device, like an iPod/iPhone When you put the MSS into the mix, the only thing that really changes is that rentals moved from the ATV to a synced computer (that pulls its library from the MSS) have their files stored on the MSS. Once that rental expires or is moved again then it is also removed from the MSS. In this case the MSS is nothing more than a data store location. Considering that a SD rental is between 1.0 and 1.5 GB this is a good thing!

Help! I Have A Mac!

No worries. You can setup and manage the MSS from OS X without the need for a Windows machine (aside from the MSS, of course). See the section below for specific details.

Hints & Tips

iTunes Scripts

In the previous post I mentioned how there is potentially the issue where you add new content to your MSS from your "home" machine--PC or Mac--and the iTunes library running on the MSS is not updated. That library is what the ATV sees so we need to automate the MSS scanning for new content so that the ATV can see it (and you can play it).

There are three scripts that make this happen. They are the UpdateItunesLibrary.bat, DoUpdate.vbs, and RemoveDeadTracks.js scripts. I have included them as attachments as well (see bottom of this post).

Important

The scripts require iTunes to be running on the MSS. They will launch iTunes but the "No audio device found" iTunes dialog box will wait for interaction. Thus, your first step of troubleshooting is to make sure you leave iTunes running on your MSS! Obvious but important!

Installation On your MSS, create the following folder structure:

\\yourserver\Software\Scripts\UpdateITunesLibrary

UpdateItunesLibrary.bat


This one is pretty simple. It's a batch file that kicks off the other two scripts we'll be creating. We will automate having the MSS run these at a set interval.


Create the following file, "UpdateItunesLibrary.bat" in the aforementioned directory path. Cut and paste the following:


CScript DoUpdate.vbs /B /nologo
Cscript RemoveDeadTracks.js /B /nologo

If you care, this script launches each of the next two scripts using the CScript engine in Batch Mode and suppresses the dialog logo (and output).

DoUpdate.vbs


This script does the heavy lifting. The script scans your media folders and adds the content into iTunes. You will need to configure this script for your settings.

Const MoviesFolder = "Y:\"
Const MusicFolder = "Z:\iTunes"
Dim iTunes
Dim Library
Set iTunes = WScript.CreateObject("iTunes.Application")
iTunes.LibraryPlaylist.AddFile(MoviesFolder)
iTunes.LibraryPlaylist.AddFile(MusicFolder)


The first two lines are where you set the path to where your media is. It can be a drop box, your Music share...whatever. In the previous section you should have mapped a drive to this location, so enter in the mapped drive location above. In my example I have the Z:\ drive mapped to my \\server\Music folder where my iTunes folder resides. The Y:\ drive is mapped to the root of my \\server\Videos share which is where I drop any converted movies that I want loaded into iTunes.


If you don't plan on having a movie drop box folder you can just delete lines one and six and not bother importing that content.


This script was written and kindly provided by Jehos of Ars Technica.


RemoveDeadTracks.js This is the exact file from the Apple iTunes SDK, repeated here for your convenience. This removes "dead" tracks from your iTunes library. A dead track is an orphaned track; one that is on a playlist or in your library but doesn't actually exist for some reason.


var ITTrackKindFile   = 1;
var   iTunesApp = WScript.CreateObject("iTunes.Application");
var   deletedTracks = 0;
var   mainLibrary = iTunesApp.LibraryPlaylist;
var   tracks = mainLibrary.Tracks;
var   numTracks = tracks.Count;
var   i;
while (numTracks != 0)
{
   var   currTrack = tracks.Item(numTracks);
  // is this a file track?
  if (currTrack.Kind == ITTrackKindFile)
  {
     // yes, does it have an empty location?
     if (currTrack.Location == "")
     {
        // yes, delete it
        currTrack.Delete();
        deletedTracks++;
     }
  }
  numTracks--;
}
if (deletedTracks > 0)
{
  if (deletedTracks == 1)
  {
     WScript.Echo("Removed 1 dead track.");
  }
  else
  {
     WScript.Echo("Removed " + deletedTracks + " dead tracks.");
  }
}
else
{
  WScript.Echo("No dead tracks were found.");
}

You can cut and paste this as-is; no configuration is required.

Automating

On your MSS, login (preferably via RDC) and to go All Programs / Accessories / System Tools / Scheduled Tasks. Create a new Scheduled Task named whatever you'd like. Set the Run path to:

D:\shares\Software\Scripts\UpdateITunesLibrary\UpdateItunesLibrary.bat

and the start path to:

D:\shares\Software\Scripts\UpdateITunesLibrary

Allow the task to be run as Administrator. On the Schedule tab, set a schedule. Originally I ran my script every 10 minutes when setting up my MSS and running tests. Now I run it every 30 minutes. With about 100GB of content and 10K songs in iTunes, it takes less than five minutes. Set whatever interval you deem appropriate.

The above scripts can be downloaded from here.

Combine "My Content" & "Shared Content" Together

By default synced content shows up under "My Content" (where "Content" is "Movies", "Music", etc) and streamed content shows up under "Shared Content" (where "Content" is "Movies", "Music", etc).


If you set your ATV to stream and sync all content will show under both menu items. Since "My Content" and "Shared Content" reside at the bottom of the menu tree, this makes it a little easier to get to your content.


You can sync anything you'd like and it doesn't matter what. For example, you can sync one blank photograph, a single music file, etc. As long as your ATV has a synced connection with any other device all your content will be displayed under both menu items!


Tag Your Movies Correctly

If a movie has no XML/ID3 tags associated with it the ATV will, by default, simply display the file name. This may be enough for some, however it is possible -- and quite easy -- to set the movie poster art, movie genre, rating (PG, R, etc), and a brief description. This will all display on the ATV and make your movie collection look a lot more organized!

What you need is a meta-tagging application. For OS X try MetaX, a free download. With this you can batch encode your movies, download actor and movie information from Amazon, browse movie art, etc and tag all of your files correctly. You can also do TV shows which will then organize on the ATV by show, rather than by file, making for a lot less clutter.


A Warning

As you may be aware[4], there is a known data corruption bug on the MSS confirmed by HP and Microsoft[5]. The bug can cause the loss of data while editing data directly from the MSS and streaming content simultaneously. This situation could easily happen in the aforementioned ATV setup discussed in this document.


While I personally have been using this arrangement for weeks and editing files directly on the MSS without any ill effect, prudent users would exercise caution. For example, I would rip files and tag them first, off the MSS, before moving them to the server.

References

  1. http://www.mediasmartserver.net/forums/viewtopic.php?t=715
  2. http://www.apple.com/appletv/specs.html
  3. http://handbrake.fr/
  4. http://www.mediasmartserver.net/forums/viewtopic.php?t=438
  5. http://support.microsoft.com/kb/946676