How-To: play DivX and Xvid on your Apple TV
The two biggest Apple TV limitations are the lack of codec support (like XviD, DivX, etc.) and not even having the ability to do basic surround sound like Dolby Digital 5.1. These issues were resolved almost immediately after the Apple TV was released, although the hacks were somewhat less than practical. Something as simple as getting your Apple TV to, say, sync and recognize your XviD movies as playable was no simple feat. Thankfully, that's no longer the case, and we want to show you how to get the most out of your Apple TV. Who says you can't have your cake and eat it, too?Before we get started we would like to applaud the entire crew from AwkwardTV, if it wasn't for their great Wiki, we may not have figured all this out.
Warning: you're about to engage in some serious, potentially warranty-voiding hacking. Just the way you like it, right? Ready to get your hands dirty? We need to download a few files first.
Download - ATVFiles plugin.
Download - Perian, the swiss army knife of QuickTime codecs.
Download - A52Codec, an AC3 codec.
Download - Custom ssh.plist file to start sshd automatically.
Optional
Download - Fugu, a nice OS X GUI to transfer files to the Apple TV.
Download - WinSCP to a nice Windows GUI to transfer files to the Apple TV.
Download - If you don't have an Intel Mac, you will need this Intel version of sshd.
Materials needed
A Mac of some sort - Sorry, you've got to be able to read the Apple TV's drive to at least get sshd going.
other stuff here.
We are going to do this in two steps. For those who do and do not already have SSH enabled. So if you've got SSH running on your Apple TV, skip ahead to the next section.
Enable SSH on the Apple TV (requires a Mac)
Remove the drive the same way we did to expand the drive and plug it into a Mac, then launch Terminal. Our first command is going to copy the Intel version of ssh daemon from our Mac to the ATV drive. If you are on a Intel Mac copy it from your sbin directory to the ATV's OSBoot/usr/sbin/ directory. If your browser causes the line to wrap be sure to enter it on one line in the Terminal.
sudo cp /usr/sbin/sshd /Volumes/OSBoot/usr/sbin/
You can also copy it from your downloads directory:
cp /Users/Engadget/Downloads/sshd /Volumes/OSBoot/usr/sbin/
Make sure sshd is executable
sudo chmod +x /Volumes/OSBoot/usr/sbin/sshd
Backup the original ssh.plist to our home directory:
cp /Volumes/OSBoot/System/Library/LaunchDaemons/ssh.plist ~
Now copy the new one from our downloads directory to the Apple TV drive:
cp /Users/Engadget/Downloads/ssh.plist /Volumes/OSBoot/System/Library/LaunchDaemons/
Before we dismount the drive to reinstall into the Apple TV, let us see if we need to clean up after Spotlight again.
Perform these command and check if the .Spotlight files are on the partitions by typing:
ls -a /Volumes/Media
and
ls -a /Volumes/OSBoot
Now, if you do see those .Spotlight files, use the following command to remove them. But be careful, this is the dreaded rm -rf command, which has the potential to ruin everything.
sudo rm -rf /Volumes/OSBoot/.Spotlight-V100
or
sudo rm -rf /Volumes/Media/.Spotlight-V100
Now dismount the drive and install it in your Apple TV. If you need to give your friend's Mac back, feel free. From here on out you can fly PC on this op, if you so choose.
Test it by signing in via terminal. (The password is frontrow.)
ssh -1 frontrow@AppleTV.local
That should get you in. So let's start installing the good stuff, shall we?
Adding additional QuickTime components.
Before we can start copying files we need to ssh into the Apple TV and mark the volume as read / write. A few times we will use sudo (as in sudo make me a sandwich) and a password will be requested; it's also frontrow. From the terminal, ssh to the Apple TV:
ssh -1 frontrow@AppleTV.local
Now remount root as read / write. (Enter frontrow for the password.)
sudo mount -o remount,rw /dev/disk0s3 /

Now, copy the ATVFiles plugin, Perian and AC3 QuickTime components to the Apple TV. (As always, depending on the location of these files your command will differ.)
scp -1 -r /Users/Engadget/Downloads/ATVFiles-0.2.1/ATVFiles.frappliance/ frontrow@AppleTV.local:~
scp -1 -r /Volumes/Perian\ 0.5/Perian.component frontrow@AppleTV.local:~
scp -1 -r /Volumes/A52Codec\ 1.7.2/A52Codec.component frontrow@AppleTV.local:~
If you have the MPEG-2 QuickTime component then you can copy that too, but otherwise it's probably not worth the $20.
scp -1 -r /System/Library/QuickTime/QuickTimeMPEG2.component/ frontrow@AppleTV.local:~
Now we need to use ssh to move the files to the proper directory so QuickTime can find them.
ssh -1 frontrow@AppleTV.local
sudo mv ATVFiles.frappliance/ /System/Library/CoreServices/Finder.app/Contents/PlugIns
sudo mv Perian.component/ /Library/QuickTime/
sudo mv A52Codec.component/ /Library/Audio/Plug-ins/Components/
sudo mv QuickTimeMPEG2.component/ /System/Library/QuickTime/
Now we need to restart Finder so it will load the plugin, you could pull the power (easy way) or you could run a couple commands (slightly less easy way). Here those are, if you're paranoid about unplugging your unit; find the pid to kill:
ps ax | grep Finder
This will return a line with the pid for finder.

Now kill Finder's pid. (Ours was 512 when we wrote this.)
kill 512
After Finder restarts we will see a new menu item named Files, which allows us to play movies stored in /Users/frontrow/Movies on the Apple TV. So we'll copy a movie there, shall we? (Again you can use scp, or Fugu if you prefer.)
scp -1 ~/Movies/Gothika_480p_XviD.avi frontrow@AppleTV.local:~/Movies/
All you have to do is select the clip to play from the files menu.
Voila! Your Apple TV just got a whole helluva lot more useful.Of course there are many more codecs that work by using the same basic method of installing QuickTime plugins into the ATV's directory structure. And don't even get us started on all the other plugins being developed for this bad boy. Hell, you can even mount AFP or NFS shares and stream videos instead of copying them. The possibilities are kind of endless for this little Unix box, but hopefully this guide well get you on your way. Good luck!


















Reader Comments (Page 1 of 2)
Jordan @ Apr 10th 2007 12:23PM
If all the terminal work can be done on a Windows system, Mediafour's MacDrive 7 will allow you to read and write HFS+ hdds.
kuonji @ Apr 10th 2007 12:24PM
Or it could have had the capability to play Xvid and DviX from the beginning. Oh wait, this is Apple...
Geoffrey Sperl @ Apr 10th 2007 1:03PM
@kuonji: And why should Apple include Xvid and DivX support? Does that add anything to their bottom line? I mean really? How many more units will they sell because of included Xvid/DivX support? Maybe 25,000 at the absolute most? Or should they just focus on making sure the item does something and does it well instead of making it a one-size-fits all solution?
Keep in mind: Apple is in business to make money, not to make you happy with supporting formats they have nothing to do with. So, if you want an Apple TV, then go get one and start hacking. If you don't, then go get another solution and quit trolling...
Christopher P. TOdd @ Apr 10th 2007 12:25PM
I just bought a buffalo media server. I wonder if I should have waited? I guess Apple will soon put a stop to this with an "upgrade". BUt it is good to know that people are figuring out how to hack this thing!
Joe V @ Apr 10th 2007 12:58PM
Actually, Apple has said they won't circumvent any hacks made to the box -- only that you're probably voiding your warranty once you pry it open.
sornypanafonic @ Apr 10th 2007 12:27PM
well, i wasnt going to get this, but i must now (living room tv!!), especially after all the hard work put in to make this right. grassy ass (say it fast).
Preston @ Apr 10th 2007 1:47PM
I want a copy of Ocean's 13 (which isn't even out in theaters yet!).
Ben @ Apr 10th 2007 1:46PM
That is just a trailer. ;)
Joe V @ Apr 10th 2007 12:36PM
Looks like someone misspelled "Engadget" when they created their user account. :)
Mystic @ Apr 10th 2007 1:46PM
Why don't all the bitchers and complainers of the AppleTV GET SOMETHING ELSE!? Jeezuz H Christ!
luc @ Apr 10th 2007 1:50PM
Is there a software hack to play the xvid without opening the appletv?Or is this it.
Ben @ Apr 10th 2007 1:51PM
Not yet, but there are some very smart people trying to make it happen.
paul @ Apr 10th 2007 12:54PM
to first post -- i thought about that, but you must also have the SSHD binary compiled for Mac OS X.
Ben @ Apr 10th 2007 12:55PM
I provided a link to a precompiled sshd so that wouldn't stop you.
I don't see why it wouldn't work, but I can't update the post unless I can test it.
masterbake @ Apr 10th 2007 1:00PM
Actually, the AppleTV will play Dolby 5.1 content just fine...
http://www.roughlydrafted.com/RD/RDM.Tech.Q1.07/147048D8-D8B7-45E7-9A97-3CD5B4C2B75A.html
No hacks required.
Way to spread some FUD, though, Engadget.
Ben @ Apr 10th 2007 1:03PM
You must read closer, we don't say Dolby 5.1 we say Dolby Digital 5.1.
Sure Dolby 5.1 is still surround sound, circa 2000. We like our surround sound channels to be discrete.
Ryan @ Apr 10th 2007 2:22PM
Sweet Pro Logic II, I finally have a use for my 15 year old stereo. Seriously is DD 5.1 that hard to integrate? Seems like the open source solutions are always 3 years ahead of these proprietary formats.
kuonji @ Apr 10th 2007 2:31PM
Why are personal media players such as those made by Archos, Cowon, and Creative more desirable when they include more popular codecs? To broaden their appeal. It's not some sort of programming nightmare to include this support on the device, Apple simply wants to make a piece of hardware that forces you to use it the way they want you to use it, which is ideally (for them) to download movies and shows from Itunes. That's their M.O., and that's how it has always been. And that is why I said "Oh yeah, because it's Apple"
Apple makes gorgeous hardware and very slick software, but their forcing you to do things as they want you to do them is very tired and old, and keeps me from being very serious about most of their product offerings.
And by the way, if you think including Dvix and Xvid support would only increase demand very slightly in this unit, you're crazy.
mrhammerstein @ Apr 10th 2007 3:16PM
so why do i hear all the complaints about having to convert clips to play with itunes, appletv, ipod? you're right. no one cars.
same problem with microsoft and their wmv format. please don't tell me you have never complained about this before...
podawg @ Apr 12th 2007 5:03PM
Yeah...makes this white brick absolutely useless to me. I cant even figure out what the hell it is. I can download to a computer and watch any video on any screen I want. Or I can burn movies onto a DVD that my $50 DVD player from Wal-Mart can play.
I...dont...understand.
stu @ Apr 10th 2007 3:09PM
dolby 5.1 ??
pro-logic was 4.0 if memory serves...
great tutorial BTW
Stu
Tim @ Apr 10th 2007 1:44PM
You might want to check out these components too:
x264 - http://developer.berlios.de/projects/x264qtcodec/
matroska (mkv) - http://sourceforge.net/projects/matroskaqt/
Ben @ Apr 10th 2007 1:45PM
Tim,
What is the difference between the x264 codec and the h.264 codec already supported?
Tim @ Apr 10th 2007 3:00PM
actually the perian x264 support is very basic, afaik it doesn't support many profiles...
in version 1.0, perian will support matroska and handle x264 much better, as i heard it's not far around the corner
rob @ Apr 10th 2007 1:45PM
ben - how is the performance on 720p? are those 60fps or 24fps movies and what is the bitrate? has anyone tried 1080p?
Ben @ Apr 10th 2007 1:46PM
720p high bit rate looks really really good and of course DD 5.1 sounds great too.
1080p is really choppy as is 720p MPEG-2.
Ben @ Apr 10th 2007 3:10PM
Prologic was 2.0 decoded to 3.1, Prologic II is 2.0 decoded to 5.1.
Gordy @ Apr 10th 2007 3:02PM
I'm sorry folks, but FFMPEGX converts to MP4 a lot cleaner than this mash-up job. Stop fighting it, it's really not that difficult.
mrhammerstein @ Apr 10th 2007 3:30PM
sorry engadget, i have to disagree.
"The two biggest Apple TV limitations are the lack of codec support (like XviD, DivX, etc.) and not even having the ability to do basic surround sound like Dolby Digital 5.1. These issues were resolved almost immediately after the Apple TV was released"
i believe you always taught me issues are not resolved by hacks. until the provider fixes the problem, it doesn't count.
Mark @ Apr 10th 2007 4:17PM
Until I can give AppleTV the ability to play Divx files without having to open the case and void the warranty, I'm not interested in it whatsoever.
SoloMalee @ Apr 10th 2007 3:54PM
Now if someone can turn the Apple TV into a Media Center Extender that would work with Vista MCE, then I will go out and buy two tomorrow....really!
walk2k @ Apr 10th 2007 4:28PM
Nobody supports Divx/Xvid because it's the #1 format choice of pirates.
Sony/Playstation doesn't, M$/Xbox doesn't, and Apple doesn't...
annunaki @ Jul 9th 2007 7:11PM
Simply not true. The Philips Philips DVP642 plays DivX and Xvid discs just fine. The Philips DVP5960 (which I am currently using) connects to my external 500gb drive with ease and will upconvert to 1080p with HDMI cable. The only drawback is that the USB connection is actually running as a USB 1.1 so very large files (tried 7.6gb) will stutter when played. Well, that and the filebrowser sucks royal @$$.
At $40-$80 for this player, it is an inexpensive alternative to the appleTV if you just want to play your DVDs and downloaded/ripped content.
Rob @ Apr 10th 2007 4:30PM
Linux can access HFS+ right? so why do you need a Mac?
In fact how about something along these lines, to prevent having to open the unit....
1) create a bootable USB key with Linux that is bootable by the apple tv (this has already been done).
2) ensure the linux kernel has HFS+ support
3) run a script that copies the nessesary files from the USB key to the apple tv and configures the apple tv to launch sshd on boot.
This USB image could be made available for download, so even people without a Mac or Linux machine can use it, as long as they can write the image to a suitably sized USB key.
Jeff @ Apr 10th 2007 6:33PM
I'm waiting for the "boot from a USB attached drive" solution: I'm not interested in opening my AppleTV.
It can't be that far off.
Until then, i'm fine with my iTunes store purchases, and have plenty of hard drive space to encode my DVD seasons in h.264 (which takes no longer than encoding to XviD)
Joseph @ Apr 10th 2007 8:38PM
Head on over to http://wiki.awkwardtv.org/wiki/Patchstick . It's still a work in progress, but it does pretty much what you described.
walk2k @ Apr 10th 2007 4:34PM
ProLogic is 4 channel - L/C/R and 1 mono surround channel.
DPLII added independent surrounds for 5-ch, and IIx adds a single back-surround for 6-ch. None of them have an LFE or ".1" channel.
So, you can call it "surround sound" or you can call it "ProLogic" but you can't call it "5.1" or anything-".1" at all...
grundler @ Apr 10th 2007 4:31PM
So all these terminal commands one after the other just beg for someone to write a script and tell people to "copy this file and type 'fixMyAppleTV'" why on earth didn't they do that already? Then, after apple "fixes" and "updates" you may just have to login and type 'fixMyAppleTV' again--maybe after replacing that script with a new one whenever necessary... any volunteers? I don't have an apple tv.
Johnny5k @ Apr 10th 2007 4:57PM
I too don't understand why Apple didn't just include DivX/Xvid support. 5 years ago when the iPod came out, mp3 format was no different than DivX is now (almost-- I'll get to that). The iPod would have NEVER had a chance if it didn't support mp3 out of the box. I guess now that Apple has established the iTunes store, and they're selling other content, they think that's where everybody's going to go to get all their video content. I for one am not going to buy a $300 device that I need to hack to play 90% of my video; nor do I want to convert (note: huge quality loss) all my video to Apple's supported format. If AppleTV came with DivX/Xvid support, I would buy one tonight. And I'm sure I'm not the only one out there. But we may be the minority, as your average Joe & Jill probably don't have very much DivX content on their PCs, and that's who Apple's targeting.
jimjonze @ Apr 10th 2007 5:11PM
"Why are personal media players such as those made by Archos, Cowon, and Creative more desirable when they include more popular codecs? To broaden their appeal. It's not some sort of programming nightmare to include this support on the device, Apple simply wants to make a piece of hardware that forces you to use it the way they want you to use it, which is ideally (for them) to download movies and shows from Itunes. That's their M.O., and that's how it has always been. And that is why I said 'Oh yeah, because it's Apple'"
It's really easy to integrate in support for DivX and xVid when your company isn't in the business of trying to convince the major studios to provide you with video content for your online store. Because of the iTunes store Apple has to walk a fine line between keeping the customers happy by enabling as many features as possible on the device, while at the same time trying to keep the content producers happy by trying to limit the priacy happening on the devices. DVD is so entrenched that it is easy for Phillips and Toshiba to add in DivX playback without the DVD Forum getting all over them, but Apple's digital distribution is still in its infancy, so they have to be really careful about hwta piracy-enabling features they are going to support on their devices.
lee @ Apr 10th 2007 5:40PM
pick up a use xbox 1 / xbmc and it will play anything you throw at it... just hide its ugly box if possible
one thing I would not do with apple products is void a warranty - as a mac user I have come to use my warranties for their computers and ipods quite a few times... I will wait a few months to see if there are any common failures with the device until I purchase one or even think about voiding its warranty and hacking one..
David @ Apr 10th 2007 5:47PM
Is it possible to Install this in an external drive to use without voiding the warrenty?
Brandon Humphries @ Apr 10th 2007 7:25PM
Could you use the shareware tool Spotless (searched Version tracker for "disable spotlight") to turn off Spotlight completely, plug your appleTV drive in, do your dirty dirty deeds, unmount, unplug, and turn spotlight back on? Cuz it seems safer than messing with the RM -rf command, and you won't have to worry about pesky spotlight bugs creeping into your appleTV. The reason I ask all you fabulous Engadget folks is I want to be sure spotlight will be back to its regular self when I go to turn it back on.
So, anyone have any experience with this utility and could it be useful?
danb @ Apr 11th 2007 10:31AM
castcluster does it.
http://castcluster.blogspot.com/
RichardG @ Apr 12th 2007 3:13PM
I tried the directions here and it worked perfect except I had to chmod +x sshd. I had to reopen my AppleTV and run that command. I think you should add that to the instructions to be complete. Thanks for the info...
Ben @ Apr 12th 2007 3:13PM
Thanks for the tip, I added it.
Appletvbbs @ Apr 12th 2007 4:24PM
I have to commend Ben for putting together an excellent tutorial and its something everyone should do to their Apple TV! You can find more hacks and tutorials on our forums:
http://www.appletvbbs.com/forumdisplay.php?f=8
Thanks again!
Spiritusindomit @ Apr 13th 2007 2:23PM
That's a hell of alot of work to do something everything else I have does out of the box.
Spiritusindomit @ Apr 13th 2007 2:26PM
I have to say that this is typical of what I expect from mac users. It doesn't matter how bad it is, or how much work it takes to do it, it's always better because it has a shiny apple on it.
If I wanted to hack the hell out of something I buy before it's useful, I'd get linux and do it myself.
Justin @ Apr 14th 2007 1:22AM
I have been thinking about modding my Apple TV to play the divx/xvid files. I just purchased my first mac which is a macbook pro. I am still just to hesitant to try this hack. Does anyone know of a store or person online who will mod an apple tv if I sent it to them so that it can play Divx/Xvid? Until I'm more familiar w/ OSx or they come out with an easier way to hack the Apple TV this seems to be my only option. If anyone is interested who can perform this I will provide good compensation for your help.