Why does the sound echo on iOS and Apple TV 4?

I posted this a while back on the Mac Media Server forum, and mistakenly marked it as Answered, when in fact there is still a problem.

For some of my MP4s, I get a strange echo on the audio regardless if I’m listening on headphones (iOS) or direct on TV speakers on the Apple TV. I have to turn off direct play and direct stream for it to go away. As far as I can tell, the MP4 should be completely compatible on my Apple products.

Any ideas?

Here is the XML for one of the media files in question:

http://pastebin.ca/3614695

I get the exact same echo on I devices, any mp4 with an aac first track and second ac3 track causes it to happen, however an aac only file plays without echo.

Seems like a bug.

its an issue with the way you are converting to mp4. If there are multiple tracks they might be all marked as default causing them to play all at once on certain devices (iOS, ATV4)

It’s indeed a conversion issue, some more information here:

Sorted out. I updated my scripts and the new files look good. Thanks!