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!






















——————–
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?