I know this is a well covered topic, but I'm at a loss. I'm trying to make sur emy files are in a format most suitable to DirectPlay on my ATV3. Most of my material is in MKV format which I know requires transcoding.
I have used ffmpeg to convert my MKV files to MP4, retaining the H264 video. It's the audio format that has me baffled.
Transcoder Action = DirectPlay - Video plays fine
AAC 5.1 play in Stereo (PMS not transcoding - obviously)
AC3 5.1 plays in surround (PMS not transcoding - obviously)
Transcoder Action = Auto - Video plays with some interruptions (slow CPU on PMS)
AAC 5.1 plays in surround (PMS transcoding both audio and video)
AC3 5.1 plays in surround (PMS transcoding video only)
So now I'm confused. I thought AppleTV supported AAC so it wouldn't need transcoding. And why is the H264 video being transcoded when AppleTV supports H264 in an MP4 container?
Can someone wiser than I am offer some guidance please?
I know this is a well covered topic, but I'm at a loss. I'm trying to make sur emy files are in a format most suitable to DirectPlay on my ATV3. Most of my material is in MKV format which I know requires transcoding.
I have used ffmpeg to convert my MKV files to MP4, retaining the H264 video. It's the audio format that has me baffled.
Transcoder Action = DirectPlay - Video plays fine
AAC 5.1 play in Stereo (PMS not transcoding - obviously)
AC3 5.1 plays in surround (PMS not transcoding - obviously)
Transcoder Action = Auto - Video plays with some interruptions (slow CPU on PMS)
AAC 5.1 plays in surround (PMS transcoding both audio and video)
AC3 5.1 plays in surround (PMS transcoding video only)
So now I'm confused. I thought AppleTV supported AAC so it wouldn't need transcoding. And why is the H264 video being transcoded when AppleTV supports H264 in an MP4 container?
Can someone wiser than I am offer some guidance please?
1) are your .mp4 containers flagged as "web optimized aka optimized for streaming"?
2) are you sure the ATV supports 5.1 AAC, or only 2.0 AAC?
AFAIK the aTV only support 2 channel AAC so if you feed it a 5.1 AAC track it will only play the Front Left and Right channels.
A properly encoded aTV file should contain 2 audio tracks, the first being AAC 2.0 and the second being AC3 5.1, this is how all the iTunes store content is encoded.
Just download it set up the correct ffmpeg path locations and run:-
python manual.py -I inputfile.mkv
It will remux the mkv to an apple friendly format with both AAC 2.0 and AC3 5.1 audio tracks.
It also does some other cool stuff like tagging the file with iTunes metadata from theTVdb and theMoviedb, which is great because if there is ever a time when Apple stops PlexConnect from working then all my media is ready to go straight back into iTunes
It also allows you to add subtitle tracks to the remuxed file and will even pull them for you from the internet.
AFAIK the aTV only support 2 channel AAC so if you feed it a 5.1 AAC track it will only play the Front Left and Right channels.
A properly encoded aTV file should contain 2 audio tracks, the first being AAC 2.0 and the second being AC3 5.1, this is how all the iTunes store content is encoded.
Just download it set up the correct ffmpeg path locations and run:-
python manual.py -I inputfile.mkv
It will remux the mkv to an apple friendly format with both AAC 2.0 and AC3 5.1 audio tracks.
It also does some other cool stuff like tagging the file with iTunes metadata from theTVdb and theMoviedb, which is great because if there is ever a time when Apple stops PlexConnect from working then all my media is ready to go straight back into iTunes :)
It also allows you to add subtitle tracks to the remuxed file and will even pull them for you from the internet.
Thanks for the link to the scripts, they are working perfectly for me on my Synology NAS.
I do have one question, however.
Which audio track do I choose to play on my ATV3? No matter whether I choose the AAC track or the AC3 track, my receiver (Yamaha RX-V1900) still seem to think it's getting a stereo signal. In thepast there was an audible click and the surround sound speaker icons lit up on the receiver, this no longer happens. Although I do get audio through all the speakers. I can only assume the receiver is getting a stereo signal and using its own DSP to "synthesise" surround sound rather than playing the original channels from the source media. Is that correct?
Make sure your PMS settings are set to enable dd for ATV. On your Yamaha make sure your audio settings are set to auto detect audio source input. On your ATV make sure you have dd enabled in the native apple settings.app. The aTV3 currently only can output dd. I believe the aTV2 can output DTS if it’s jailbroken using xbmc.app using the plugin Plexbmc. This assumes the content on PMS is dd or DTS.
Thanks for the info, I’ve enabled all of the setting you suggest and still the dual audio files play in stereo. What I don’t understand is that when the file has an AC3 5.1 track only it works but when there’s an AAC track present it doesn’t.
There is, and that is enabled. It's an ATV3 and I've tried both HDMI and toslink-optical (both into the receiver). The current wiring is ATV3 --> Yamaha --> TV (with the "passthrough" on the Yamaha set to AMP only)
If I play a Netflix video it automatically triggers the dd on the receiver, the same if I force transcoding from the PMS or if I play a file with only an AC3 5.1 stream in it (as described in my post above). I'm baffled. Everything I've read seems to suggest that for the best compatibility I should have a stereo AAC stream as well as a dd AC3 5.1 stream in the file.
Well if the file in question is DTS I don’t think it would work due to the aTV3 only being able to output dd currently. You would need to rip it in a dd format for it to work I believe. I’m not sure if PlexConnect can downconvert (switch to dd) a DTS file to dd, I would assume not. The file would need to be a dd format to begin with I believe.
As you can see from the ffprobe output above, the file contains AC3 5.1 (which is DD as far as I understand) so I have not DTS streams to get in the way. And as I said earlier, a file with only an AC3 5.1 stream works fine, the issue seems to come in when I add the stereo AAC stream (as suggested for true ATV compatibility).
Could it have something to do with the PMS profile for Apple TV? I'm not sure how PMS profiles are implemented but mine looks like this:
That’s what I’m going to resort to, removing the AAC stream and leaving the AC3 stream, but it’s against everything I’ve read on this and other forums about the right format for AppleTV.
I wish I could help you further but maybe someone else with better knowledge on the subject can assist you further. Personally I would just go with the working format for now unless someone knows a better solution to your issue so you don’t need to change the format. Sounds like you have most of it figured out since some of them do play dd.
Could it have something to do with the PMS profile for Apple TV? I'm not sure how PMS profiles are implemented but mine looks like this:
No, because if you've remuxed these files to proper aTV formatted m4v files then PMS/PlexConnect will natively direct-play them and the aTV should natively decide which audio track to play based on weather or not you've got "Dolby Digital" turned on in the main aTV "Audio & Video" settings.
Check and make sure in PlexConnect on the aTV that "Settings"->"Transcoder Action" is set to "Auto" or "DirectPlay"
Thanks for trying to help roidy. They are mp4 not m4v files, is that where I'm going wrong? I do have "Dolby Digital" turned on on the ATV itself as you suggest, and I have set "Transcoder Action" to "DirectPlay". If I set it to "Auto" then I can see my PMS fire up a transcoder thread, so something is definitely wrong.
Thanks for trying to help roidy. They are mp4 not m4v files, is that where I'm going wrong? I do have "Dolby Digital" turned on on the ATV itself as you suggest, and I have set "Transcoder Action" to "DirectPlay". If I set it to "Auto" then I can see my PMS fire up a transcoder thread, so something is definitely wrong.
mp4 and m4v are 99.9% the exact same thing. (m4v can cater for drm and a few optional things which you aren't actually using anyway) - if you are not using those optional things, they only difference is the file extension.
They are mp4 not m4v files, is that where I'm going wrong?
I suspect so... as Bob Snot said mp4 and m4v are 99.9% the same... however the m4v extension tells the aTV to passthru the AC3 audio, it also allow the file to contain chapter marker, but that's irrelevant. Try just renaming the file from .mp4 to .m4v
There is, and that is enabled. It's an ATV3 and I've tried both HDMI and toslink-optical (both into the receiver). The current wiring is ATV3 --> Yamaha --> TV (with the "passthrough" on the Yamaha set to AMP only)
If I play a Netflix video it automatically triggers the dd on the receiver, the same if I force transcoding from the PMS or if I play a file with only an AC3 5.1 stream in it (as described in my post above). I'm baffled. Everything I've read seems to suggest that for the best compatibility I should have a stereo AAC stream as well as a dd AC3 5.1 stream in the file.
Supported formats:
Audio Formats
HE-AAC (V1), AAC (16 to 320 Kbps), protected AAC (from iTunes Store), MP3 (16 to 320 Kbps), MP3 VBR, Audible (formats 2, 3, and 4), Apple Lossless, AIFF, and WAV; Dolby Digital 5.1 surround sound pass-through
I read this as no AAC 5.1 (AAC Dolby Pro Logic II should work) only stereo.