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!




















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.
Or it could have had the capability to play Xvid and DviX from the beginning. Oh wait, this is Apple...
@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...
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!
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.
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).
I want a copy of Ocean's 13 (which isn't even out in theaters yet!).
That is just a trailer. ;)
Looks like someone misspelled "Engadget" when they created their user account. :)
Why don't all the bitchers and complainers of the AppleTV GET SOMETHING ELSE!? Jeezuz H Christ!
Is there a software hack to play the xvid without opening the appletv?Or is this it.
Not yet, but there are some very smart people trying to make it happen.
to first post -- i thought about that, but you must also have the SSHD binary compiled for Mac OS X.
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.
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.
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.
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.
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.
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...
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.
dolby 5.1 ??
pro-logic was 4.0 if memory serves...
great tutorial BTW
Stu
You might want to check out these components too:
x264 - http://developer.berlios.de/projects/x264qtcodec/
matroska (mkv) - http://sourceforge.net/projects/matroskaqt/
Tim,
What is the difference between the x264 codec and the h.264 codec already supported?
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
ben - how is the performance on 720p? are those 60fps or 24fps movies and what is the bitrate? has anyone tried 1080p?
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.
Prologic was 2.0 decoded to 3.1, Prologic II is 2.0 decoded to 5.1.
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.
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.
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.
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!
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...
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.
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.
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)
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.
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...
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.
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.
"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.
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..
Is it possible to Install this in an external drive to use without voiding the warrenty?
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?
castcluster does it.
http://castcluster.blogspot.com/
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...
Thanks for the tip, I added it.
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!
That's a hell of alot of work to do something everything else I have does out of the box.
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.
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.
——————–
Make sure sshd is executable
sudo chmod +x /Volumes/OSBoot/usr/sbin/
——————–
should be
——————–
Make sure sshd is executable
sudo chmod +x /Volumes/OSBoot/usr/sbin/sshd
——————–
While most have probably figured this out, I was following the directions without thinking too much. Closed up my tv and had to crack it open again. So if any other CLI newbs get "ssh_exchange_identification: Connection closed by remote host" that there would be the problem.
Thanks, fixed it.
I'm having a little trouble here.
"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."
Isn't that on the OSBoot drive? Why would I want to put media there? There's little point to my newly swapped-in 80GB drive if I'm storing big data on the tiny boot partition. Maybe I should be creating a symbolic link from "/Users/frontrow/Movies" to a "/Volumes/Media/Movies" directory? Would this work? Has anyone else grappled with this issue?
Okay, after some examination of my AppleTV's directory structure I've answered my own question. Looks like the "Users" directory is already a symbolic link to the "Media" disk.
Der.
Instructions incorrect???
I think that the instructions for the A52Codec are incorrect. When I followed your instructions, my Xvids would play but had no audio. After examining the plugin, it appears that you have the location for the plugin incorrect. I believe that this is the correct command:
sudo mv A52Codec.component/ /Library/Audio/Plug-ins/Components/
instead of
sudo mv A52Codec.component/ /Library/QuickTime/
Thanks for catching my mistake.
I fixed it.
Thanks for the info guys....one question...
So everything we do to add DivX and Xvid creates a new menu item called Files. How do we change the name of that menu item? Can we add additional menu items?
This are perfect instruction that I followed, but I still get 22: connection refused. I really cannot figure out why. Does someone can please give me a tip. Thanks,
- I modified my ATV with your tutorial, but in frontrow instead of folder named "File" i have a folder named "CFBundleName" why?
- If i play a xvid or divx with ac3 audio with my ATV i heard only stereo sound and not 5.1.
I'm italian... sorry for my english
Dave
Dave,
ATVFiles doesn't currently support AC3 passthrough so stereo is all you get for now.
Keep checking on the developers site for an update that enables this feture.
Ok thank you and about the folder's name?
Bye
Dave
I keep getting 'permission denied' when copying to the plugins folder. I did enter: sudo mount -o remount,rw /dev/disk0s3 /
Is there something I missed? I tried fugu and tried a local cp command.
TIA
I have the very same problem!
After many hours I finally was able to upgrade my drive and load all the codecs.
I was able to move some test AVI files that were encoded using HandBrake and I set the option to use AC3 passthrough. When i play the movies the sound is definitely not Dolby Digital 5.1 (AC3), the sound has been drowngraded to Dolby ProLogic II.
Is it possible to play AC3 passthrough thru the apple TV into my reciever? If so how? Do I have to way for a later A52 Codec release?
The rghosting.com link for the sshd binary doesn't work. Does anyone have another site to download this file?
I just made a patchstick from an image running on the net (a torrent) and i booted from it on my Apple TV. What happened? My ssh got enabled so I can connect to my Apple TV through fugu, Winscp, etc... BUT i can't install ATVFiles since I get no disk access (read only disk)
I used several commands throgh the Terminal:
[CODE]sudo mount -o remount,rw /dev/disk0s3 /
[/CODE]
this didn't work, either this other command:
[CODE]sudo /sbin/mount -uw /[/CODE]
Of course, i did log in to the Apple TV (frontrow@appletv.local) by network cable and wifi...but still no luck.
What am i doing wrong?!?!?!
Hello,
Does anybody know where to find the sshd file because i have not an intel version mac.
The link to get sshd.tar.gz for apple tv doesn't work anymore...
Thanks from a french user
I have the same problem. No mac sshd. And the link is borked as you said.
I updated the link, let me know if it works.
I have the same problems as Pieter and Marc. Could anybody help us out here?
i need the sshd file too. the link still doesn't work.
I'm sorry, but I don't know another place to get the file.
Maybe you can download the entire darwin CD and copy just the file you need, or find another friend with an Intel Mac.
You may also be able to compile it yourself on your PPC mac if you Xcode installed.
I'm also having the same problem as marc and pieter
the sudo mount -o remount,rw /dev/disk0s3 /
line doesn't seem to work when I do an ls-l on dev/disk0s3 it is still read only? Are these newer apple tvs I wonder? Mine is only a week old. Has something changed? Help would be good if anyone knows?
I'm also having the same problem as marc and pieter
the sudo mount -o remount,rw /dev/disk0s3 / just doesn't seem to work.
Any ideas?
If you'd prefer to not keep typing the frontrow password when ssh or scp'ing then you can generate a public key on your side and store it on the ATV so that it knows you are an authorised connection.
Here's how:-
1. On your Mac in a terminal window type
ssh-keygen -t rsa1
Just press to all prompts to accept defaults. This will generate an SSH1 compliant key pair in your home directory under .ssh.
2. Create the same on the ATV
ssh -1 frontrow@myatv
ssh-keygen -t rsa1
exit
Just press to all prompts to accept defaults. This will generate an SSH1 compliant key pair in your home directory under .ssh.
3. Copy your public key onto the ATV under the frontrow account (you will still be prompted for the frontrow password at this point)
scp -1 ~/.ssh/identity.pub frontrow@myatv:~/.ssh/authorized_keys
4. Set the appropriate permissions on directories/files on the ATV (actually works without, but is good practice for v2 ssh types and/or stricter sshd's)
ssh -1 frontrow@myatv
chmod 750 .
chmod 600 .ssh/authorized_keys
exit
5. Now when you ssh from your Mac to your ATV you shouldn't get prompted for a password!
Regards
gyb
Hi, now when its hacked, if i search for updates in setup on the aTV. Will the hacks still be working afterwards? or will the files be overwritten by Apple update?
has anyone tested enabling ssh on the drive with mediafours macdrive on a windows pc?