Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
For me, when I watch anime, I just open the .mkv file, with perian installed, and then save the movie as a self contained .mov file. This allows the mac to read the whole thing upon opening. I am not sure if this works on the aTV, as I do not have one, but the resulting files will import to itunes.
 
For ac3 audio, I did everything Stomer suggested except I was able to skip the step with MP4Box because I could open the mkvextract'ed audio file directly with QT... snip ... The ATV cannot decode ac3 or dts. It just passes them through the toslink port so a dts/ac3 receiver can decode it.

@chinhster - Do you know if a stock/unmodified Apple TV passes through AC3 also? Using you rmethod, could I create an MP4 container with re-encoded video and AC3 and stream it from a stock ATV?
 
I've read through all guides/forums I can find on how to convert mkv to mp4 for  TV and all I can say is, why do they have to make it so dammed hard to put videos on it???

If it's not the AC3 audio, it's some obscure error quicktime spits out. And if it's not that, it's the 29FPS or the 5200kbps that just won't play on the *TV. It just takes too long to re-encode HD files.
 
Thanks guys! Glad you liked it :)


@diotav:

I tried to make my guide as user friendly as possible. But, since I pretty much live on the terminal I find it difficult to get into a beginners headspace. If you'd be willing to read my guide and show me where I've assumed things that I can't/shouldn't assume for a beginner, I'll do my best to make it better/fix it.
 
Is there an simple way to convert AC3 to AAC? Most of the mkv files I have contain AC3 audio.
 
@Idgit:

From my guide linked above:

ffmpeg -i file.mkv -sameq -vn -acodec aac -ac 2 audio.aac

-i file.mkv = input file name
-sameq = use same quality of the input for output
-vn = no video
-acodec aac = output is AAC
-ac 2 = output stereo
audio.aac = output file name

NOTE: The "-ac 2" changes the typical 5.1 audio to stereo. I did this because I'm not capable of 5.1 here and I wanted to start with the simplest thing. Not using "-ac 2" would preserve the 5.1 though I haven't tested that so YMMV. If you do this and decide to output 5.1 instead of stereo, please let me/us know if it works with the PS3 (assuming your going to watch it on a PS3).
 
@Idgit:

From my guide linked above:

ffmpeg -i file.mkv -sameq -vn -acodec aac -ac 2 audio.aac

-i file.mkv = input file name
-sameq = use same quality of the input for output
-vn = no video
-acodec aac = output is AAC
-ac 2 = output stereo
audio.aac = output file name

Hmm, didn't work for me. The resulting file is unrecognized by any app and too small.

I found a way that seems to work. I extract the AC3 file using mkvextract and convert the AC3 to AIFF using a52decX. Then I convert the AIFF to AAC. Finally, remux as MP4 using MP4Box.
 
Oddly enough...

As we speak I have a working app that takes an MKV file and extracts both the Audio & Video from it. It then takes Ac3 audio and converts it to AAC(Stereo 2 Channel @ 128kbs) & then modifies the elementary h264 video profile level and downgrades it to 4.1 to make it compatible for PS3/Xbos360/etc and remuxes both the untouched video(no re-encoding) and AAC audio into a valid MP4 that can be played across the boards...Xbox360/PS3/iPods/etc.

Took me a few days(on & off) to put together. It's as simple as launching the app and selecting the MKV file you want to convert to MP4. As it stands now it takes roughly 16 minutes to fully convert an MKV to MP4. Granted 16 mins is what I believe to be 8 minutes too long. I'm shooting for an 8 minute conversion time(On a MacBook Pro).

This is a work in progress and 8 minutes of that 16 minutes is due to having to search inside the elementary video stream for the video profile(which isn't entirely necessary unless the MKK was encoded using High Profile 5.1 and you want to play it on your PS3/Xbox360). Removing this part of the app is trivial for those who don't require it. If anyone wants to test it out just PM me. Maybe you can even offer some help with it.

The point of putting the app together was to be able to easily take an MKV and convert it to an MP4 with little to no brains needed.
 
the only problem i am having is with this command:

MP4Box -add audio.aac -fps 23.976 audio.mp4

im getting "-bash: MP4Box: command not found", i did run the MP$Box binary 1st and then run all the commands in a seperate shell window, any tips? thanks

did u get this problem resolved, im having the same issue. I dl the mp4box file but im not sure if im suppose to put it somewhere or install it...
 
did u get this problem resolved, im having the same issue. I dl the mp4box file but im not sure if im suppose to put it somewhere or install it...

Try this.

Dowload the UB version of MP4Box from here.

Then in the Finder's "Go" menu, select "go to folder" and enter "/usr/local/bin" (without the quotes). Drop the MP4Box binary into the "bin" folder (/usr/local/bin) and authenticate when asked.

Open the Terminal and type "MP4Box." The MP4Box help page should appear. If it does, you should be able to successfully mux your files into a MP4 container.
 
Try this.

Dowload the UB version of MP4Box from here.

Then in the Finder's "Go" menu, select "go to folder" and enter "/usr/local/bin" (without the quotes). Drop the MP4Box binary into the "bin" folder (/usr/local/bin) and authenticate when asked.

Open the Terminal and type "MP4Box." The MP4Box help page should appear. If it does, you should be able to successfully mux your files into a MP4 container.

AWESOME!, this worked, thanks allot
 
So, I took a 1080p MKV and demuxed it into h.264 video and AC3 audio, then re-encoded the video in VisualHub to 720p for the :apple:TV. I then opened the new video stream into Quicktime Pro and pasted in the unmodified AC3 audio. I saved it in an MOV container, not MP4.

I was surprised to see that it did sync over to my :apple:TV just fine, and it plays the video, just no audio. So I guess a stock (unhacked) :apple:TV won't pass through AC3 sound, even though it will sync and play the MOV container... didn't expect that. As soon as Take 2 comes out, I'll try playing this file again to see if the AC3 passes through and I'll report back.
 
What's the use of converting an MKV if it downmixes 5.1 audio into 2-channel stereo? Pointless.

I'll quote myself:

I did this because I'm not capable of 5.1 here and I wanted to start with the simplest thing. Not using "-ac 2" would preserve the 5.1 though I haven't tested that so YMMV.


Please read before you comment.
 
If you actually read the comment you would see that this is due to the fact that the PS3/X360 can not read MKV files. They can read mp4 files providing they meet certain criteria (AVC level <=4.1).

I did read the comment and I'll quote myself again; "What's the use of converting an MKV file if it downmixes 5.1 audio into 2-channel stereo?"

I'm trying to get an MKV to play on my PS3 and preserve the 5.1 audio. I can only convert the MKV to mp4 which downmixes the audio into 2-channel stereo. I want to pass through the original AC3 5.1 audio WITHOUT downmixing. Not stereo and not 4.1. If it can't be done, then what's the point?

Maybe you should re-read my post again instead of jumping to conclusions.
 
I did read the comment and I'll quote myself again; "What's the use of converting an MKV file if it downmixes 5.1 audio into 2-channel stereo?"

I'm trying to get an MKV to play on my PS3 and preserve the 5.1 audio. I can only convert the MKV to mp4 which downmixes the audio into 2-channel stereo. I want to pass through the original AC3 5.1 audio WITHOUT downmixing. Not stereo and not 4.1. If it can't be done, then what's the point?

Maybe you should re-read my post again instead of jumping to conclusions.

The PS3 does not recognise MP4 files with 5.1 audio, they will not play. You clearly know very little about the subject as 4.1 has nothing to do with the sound it is to do with the AVC level, as stated in my post and dilema's also. Despite your obvious ignorance you chose to make a very negative comment and that will never win you any friends in a forum such as this.
 
The PS3 does not recognise MP4 files with 5.1 audio, they will not play. You clearly know very little about the subject as 4.1 has nothing to do with the sound it is to do with the AVC level, as stated in my post and dilema's also. Despite your obvious ignorance you chose to make a very negative comment and that will never win you any friends in a forum such as this.

I know it doesn't play 5.1 MKV which is why I converted to MP4 but the conversion app is pretty much bunk as it only converts to stereo. If somebody could write one that passes through the 5.1 (which CAN be decoded by the PS3), then it would be worth using. As it is, I see no reason to downconvert my media files to play them on my PS3. I'd rather watch them in their native MKV on my computer with 5.1.

And I didn't post here to make friends. I have a life in the real world. Some of you dorks need to get out more.
 
Sorry for the noob question, but can't you patch AppleTV and install VLC, and just play the mkv file as-is? (for the sake of my question, please assume I don't have a fancy home theater setup yet and have 2-channel sound.)

I guess the other equivalent option is if that NitoTV app is later updated to support MKV.

Thanks! (don't own an ATV but an curious as to its different capabilities.)
 
Thats easy...

I know it doesn't play 5.1 MKV which is why I converted to MP4 but the conversion app is pretty much bunk as it only converts to stereo. If somebody could write one that passes through the 5.1 (which CAN be decoded by the PS3), then it would be worth using. As it is, I see no reason to downconvert my media files to play them on my PS3. I'd rather watch them in their native MKV on my computer with 5.1.

And I didn't post here to make friends. I have a life in the real world. Some of you dorks need to get out more.

It's understandable that you want to preserve your AC3 5.1 audio. Who wouldn't want to preserve that over AAC 2 Channel. AAC may be superior as far as better quality at lower bitrates but losing that 5.1 sucks hard core. I get your point.

The problem lies with the MP4container specifications. It does not support AC3 5.1. Not officially. You can toss any audio encoded stream into an MP4. Whether it be OGG,MP3,AC3,AAC, etc. An MP4 can contain a lot of things. But for unofficial codecs like AC3 it will give their track ids a private label. Which means no stand alone hardware will play that track. Sure it can encapsulate that stream. But won't give it a proper track id.

Converting that AC3 5.1 to AAC 5.1 is possible but a real PITA. Sorry.

P.S. Are you sure the PS3 will play MP4s with AC3 5.1 audio? It sound slike thats what you're syaing. I don't own a PS3 so I wouldn't know.
 
It's understandable that you want to preserve your AC3 5.1 audio. Who wouldn't want to preserve that over AAC 2 Channel. AAC may be superior as far as better quality at lower bitrates but losing that 5.1 sucks hard core. I get your point.

The problem lies with the MP4container specifications. It does not support AC3 5.1. Not officially. You can toss any audio encoded stream into an MP4. Whether it be OGG,MP3,AC3,AAC, etc. An MP4 can contain a lot of things. But for unofficial codecs like AC3 it will give their track ids a private label. Which means no stand alone hardware will play that track. Sure it can encapsulate that stream. But won't give it a proper track id.

Converting that AC3 5.1 to AAC 5.1 is possible but a real PITA. Sorry.

P.S. Are you sure the PS3 will play MP4s with AC3 5.1 audio? It sound slike thats what you're syaing. I don't own a PS3 so I wouldn't know.

What I'm saying is that a PS3 does support 5.1 decoding into LPCM multi-channel. Transcoding the MKV to MP4 downmixes it to a stereo mix. What it needs is to retain the 5.1 audio in the transport stream so that the PS3 can decode multi-channel LPCM from the AAC or AVI divx codecs. There's got to be a way to transcode either to MP4 or divx AVI and pass through 5.1.
 
What I'm saying is that a PS3 does support 5.1 decoding into LPCM multi-channel. Transcoding the MKV to MP4 downmixes it to a stereo mix. What it needs is to retain the 5.1 audio in the transport stream so that the PS3 can decode multi-channel LPCM from the AAC or AVI divx codecs. There's got to be a way to transcode either to MP4 or divx AVI and pass through 5.1.

What you're asking is easily doable. But let me make sure I'm clear. You want to take an MKV with H264 video and AC3 5.1 audio and export both the video and audio stream back into an MP4. Leaving both streama completely untouched? Just repackaging of the streams?

If so, thats a walk in the park. If the PS3 is capable of converting that AC3 5.1 on the fly than you are right. Converting the AC3 5.1 to AAC 2 Channel is pointless. The PS3 shines in this case. Not so for the Xbox360. And thats why I put this app together. Because I own an Xbox360 that I stream movies to.

But there is another hurdle you must jump. The majority(and increasingly so) of MKVs out there are using AVC/H264 High Profile 5.1. This will %100 *not* play on a PS3. High Profile 5.1 *must* be downgraded to 4.1. This does not affect the video in any way shape or form.
 
The MKV video definitely needs to be converted. The PS3 does not have a codec that supports MKV video unless it's simply a matter of changing the tags. If the video is transcoded, possibly to an AVI, perhaps we could try that. The audio would need to pass through in the transport stream. So the PS3 can't decode H.264 unless it is a 4.1 profile? Well, we could try that. The audio is what I'm really concerned about for my home theater.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.