Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Idgit

macrumors 6502a
Mar 14, 2004
551
158
I'd fix the code but not sure what needs to be done, talk of alterntive groups, checking first audio? etc. I can see no options for that in ffmpeg or atomicparsley that I use at back-end to do the donkey-work.

So If anyone knows at a code level what needs to be done, or if Apple are intending fixing this nonsense, plese let me know, until then....

You can actually enable/disable audio tracks, as well as set the alternate fallback audio in Quicktime, but it's cumbersome and time-consuming. You test it out with a movie file or two to see if it makes any difference.

I wonder if MP4Tools (cli) can enable/disable audio tracks.

You also might find the following two sites to be interesting and/or helpful.

This detailed article from someone on the Quicktime engineering team seems to have some code on how to set these various options.

Here is a technical Apple Developer Library article on Quicktime Modifier Tracks and Alternate Tracks. Maybe there is something useful in there.
 

ConvertApple

macrumors newbie
Oct 3, 2012
13
0
Thanks for your help, I read those 2 links, but they don't really help. Ideally I don't want to use any other tools beyond ffmpeg to encode and atomicparsley to tag as they're working fine, doing everything I need - almost. I still cannot ascertain if it is some metadata that defines these "alternate tracks" groups and sets the ac3 track to disabled and if so what they are and if I can set them with either ffmpeg or atomicparsley
 

Idgit

macrumors 6502a
Mar 14, 2004
551
158
Thanks for your help, I read those 2 links, but they don't really help. Ideally I don't want to use any other tools beyond ffmpeg to encode and atomicparsley to tag as they're working fine, doing everything I need - almost. I still cannot ascertain if it is some metadata that defines these "alternate tracks" groups and sets the ac3 track to disabled and if so what they are and if I can set them with either ffmpeg or atomicparsley

Do you have a sample file that you can provide (e.g., via Dropbox) that I can look at? I can run it through Subler and make changes, if necessary. Then send it back to you to see if it works.

BTW, HandbrakeCLI correctly enables the first 2-channel track, disables the second surround sound track (AC-3 5.1), and puts them in the correct alternate group. Have you tried the Apple TV 2/3 preset in Handbrake (app or CLI)? Could you integrate it into your workflow?
 

ConvertApple

macrumors newbie
Oct 3, 2012
13
0
Here's some short 4mb 40s samples I used uploaded to dropbox. My prog detects what is in original file so in case of an m4v will just re-mux it and tag it. (This file has tag data from 'a clockwork orange' in it, just chosen at random)

original working file

re-muxed+tagged non-working

I am loath to use different progs as ffmpeg can do all encoding/remuxing I need and atomicparsley can do all tagging, which worked great until atv 5.1.

TBH I've finished converting all MY files, tagged most of them and downgraded my ATV back to 5.0.2, so this surprise from Apple just prohibits a public release of my app as NOW it doesn't work properly! I'm not sure if I should even bother trying to work it out! 5 hours googling has revealed no clues as to what to do.

If anyone knows if ffmpeg or atomicparsley can - enable the first 2-channel track, disable the second surround sound track (AC-3 5.1), and put them in the correct alternate group - I'm all ears!
 

Idgit

macrumors 6502a
Mar 14, 2004
551
158
Here is a screenshot from Subler of the two files you provided. The one on the left is the working one, and as you can see, the second track (surround sound) is disabled. The one on the right doesn't work and you can see that both tracks are enabled. Also, no fallback track is set but that shouldn't affect playback. The alternate groups for audio tracks are set correctly so you don't have to worry about that.

subler1.jpg



Below is your file after I ran it through Subler. Download it and see if it works.

subler3.jpg
 

omni

macrumors 6502
Jan 20, 2008
335
6

This is how the file should look. The only thing extra I would add - the video does not have to be tagged as English - unknown is fine. I know of no instance where this will break anything - but Video English is kind of weird.

The other thing I noticed that *could* be weird in the long run - if you ever want to use the video on something else. The video profile is 3. I'm not at home - but I have a small dvd file here at work on a thumb drive which reads it as 3.1. I think the current appletv3 preset is 4.1 but don't quote me on that - could be 3.1 as well.

I have no idea what fallback is - never set it, never had to - never had a problem with aac/ac3 issues
 

ConvertApple

macrumors newbie
Oct 3, 2012
13
0
Yes, you're fixed file plays fine on ATV3+IOS-5.1. Thanks for the heads up on alternate tracks being correct, I've been googling that for hours, reading ffmpeg source code etc. So I just need to figure out IF ffmpeg can set audio track 2 to disabled.

Thanks for your help
 

Idgit

macrumors 6502a
Mar 14, 2004
551
158
I'm not the best with the command line, but I tried disabling track 3 using mp4track and it worked.

I renamed your non-working file and used the following command in the Terminal.

mp4track -z --track-id 3 --enabled false test.mp4

Track info before running the command:
user$ mp4track --list test.mp4
track[0] id=1
type = video
enabled = true
inMovie = true
inPreview = true
layer = 0
alternateGroup = 0
volume = 0.0000
width = 672.00000000
height = 272.00000000
language = Undetermined
handlerName = VideoHandler
userDataName = <absent>
track[1] id=2
type = audio
enabled = true
inMovie = true
inPreview = true
layer = 0
alternateGroup = 1
volume = 1.0000
width = 0.00000000
height = 0.00000000
language = Undetermined
handlerName = SoundHandler
userDataName = <absent>
track[2] id=3
type = audio
enabled = true
inMovie = true
inPreview = true
layer = 0
alternateGroup = 1
volume = 1.0000
width = 0.00000000
height = 0.00000000
language = English
handlerName = SoundHandler
userDataName = <absent>

And after:

user$ mp4track --list test.mp4
track[0] id=1
type = video
enabled = true
inMovie = true
inPreview = true
layer = 0
alternateGroup = 0
volume = 0.0000
width = 672.00000000
height = 272.00000000
language = Undetermined
handlerName = VideoHandler
userDataName = <absent>
track[1] id=2
type = audio
enabled = true
inMovie = true
inPreview = true
layer = 0
alternateGroup = 1
volume = 1.0000
width = 0.00000000
height = 0.00000000
language = Undetermined
handlerName = SoundHandler
userDataName = <absent>
track[2] id=3
type = audio
enabled = false
inMovie = true
inPreview = true
layer = 0
alternateGroup = 1
volume = 1.0000
width = 0.00000000
height = 0.00000000
language = English
handlerName = SoundHandler
userDataName = <absent>


----------

This is how the file should look. The only thing extra I would add - the video does not have to be tagged as English - unknown is fine. I know of no instance where this will break anything - but Video English is kind of weird.

The other thing I noticed that *could* be weird in the long run - if you ever want to use the video on something else. The video profile is 3. I'm not at home - but I have a small dvd file here at work on a thumb drive which reads it as 3.1. I think the current appletv3 preset is 4.1 but don't quote me on that - could be 3.1 as well.

I have no idea what fallback is - never set it, never had to - never had a problem with aac/ac3 issues

Fallback is used when you have an AC-3 track in the same language as the 2-channel AAC track. My understanding is that it just tells Quicktime and other players that both tracks are connected and provide the same audio and to select the AAC track if the AC-3 track can't be played. Don't use fallback if the AC-3 track is in a different language. Truth be told, I don't believe the fallback setting is required to be set.

Tagging the video track as English is just me being anal-retentive. It's not necessary but it is tidy.
 

ConvertApple

macrumors newbie
Oct 3, 2012
13
0
Well theoretically I can add another program to workflow BUT I had hoped there would be someway that ffmpeg could do it as I did';t want app to bloat or get less stable.

MP4Box that I've seen other tools use, seems to unpack all the components of the files then re-pack them. I'd probably rather find out what the coder did.

I'll have to think about it, need zome Zzzzz's now. Still cannot understand why apple did this in 5.1
 

mic j

macrumors 68030
Mar 15, 2012
2,663
156
Well theoretically I can add another program to workflow BUT I had hoped there would be someway that ffmpeg could do it as I did';t want app to bloat or get less stable.

MP4Box that I've seen other tools use, seems to unpack all the components of the files then re-pack them. I'd probably rather find out what the coder did.

I'll have to think about it, need zome Zzzzz's now. Still cannot understand why apple did this in 5.1
Just to be clear, Apple has always required the first audio track to be AAC 2-channel default and the second audio track (if it exists at all) to be AC3 not set to default. Has nothing to do with the 5.1 version. As you can see from above posts, people using other applications to generate their aTV3 compatible files are not having a issue with 5.1.
 

Idgit

macrumors 6502a
Mar 14, 2004
551
158
ConvertApple,

I came across this Windows utility for modifying/muxing/demuxing Quicktime-compliant MP4s. Might be worth checking out.

MP4Creator
 

Idgit

macrumors 6502a
Mar 14, 2004
551
158
Well theoretically I can add another program to workflow BUT I had hoped there would be someway that ffmpeg could do it as I did';t want app to bloat or get less stable.

MP4Box that I've seen other tools use, seems to unpack all the components of the files then re-pack them.

I think I found the answer to your question and it looks as if you'll need to use MP4Box or HandbrakeCLI.

From that thread:

Note that you need to disable the ac3 track and group the audio tracks together (a recent ATV change) for ATV to pass it through. Suspect you know this.

As I do all my conversion 'offline' using the script (COM) interface my external muxer of choice is a command line one - MP4BOX but there are lots about - GOOGLE. The advantage of MP4BOX is that it also allows tracks to be disabled and grouped
 

ConvertApple

macrumors newbie
Oct 3, 2012
13
0
MP4v2 would be great but I can find no windows binary for it. Downloaded the source but it won't compile, got a missing file from svn but still won't compile, tried for 2 hours so given up on that. Best hope is if ffmpeg can do it.
 
Last edited:

ConvertApple

macrumors newbie
Oct 3, 2012
13
0
SUCCESS!!! Thx for tips guys. I svn'd latest source + reinstalled vs2008 (didn't like vs2010) and got it compiled - So I now have a solution! Next comes the simple part writing the code.

It'll probably take me a week or 2 after that to get time to polish it, but then I'll release it. It's aim was the be mega-fast, require no user-intervention (beyond naming your files properly), minimal user options and to NEVER crash!

So beyond disabling track2 (or is that disabling all tracks bar track1?) are there any other maggots in the apple that might bite me in the future I should be aware of?
 

ConvertApple

macrumors newbie
Oct 3, 2012
13
0
I am running my app to FIX all my video files (only alters those with 2+ audio streams in). It seems to take about a minute per file. I wouldn't upgrade yet. In a week or two I can let you have an app that will auto-fix all your files with a single click. BUT it's a windows app and on a mac forum perhaps that is sacriledge!
 

Rushli0n

macrumors regular
Aug 27, 2012
118
0
Just to be clear, Apple has always required the first audio track to be AAC 2-channel default and the second audio track (if it exists at all) to be AC3 not set to default. Has nothing to do with the 5.1 version. As you can see from above posts, people using other applications to generate their aTV3 compatible files are not having a issue with 5.1.

I'm not disagreeing with you regarding Apple's policy...but both Audio Files on my movies were checked on 5.0.2 and it worked. After updating to 5.1, I had to uncheck the 5.1 file for it to work. So something in the update broke it.
 

mic j

macrumors 68030
Mar 15, 2012
2,663
156
I'm not disagreeing with you regarding Apple's policy...but both Audio Files on my movies were checked on 5.0.2 and it worked. After updating to 5.1, I had to uncheck the 5.1 file for it to work. So something in the update broke it.

Understood, but "checking" a file says this is the default, so by checking both files you were telling the aTV that both files are default. If you look back through previous posts here, you will see that the recommendation is to only have the first file (stereo) checked as default. Apparently, something in the new version was changed to no longer allow 2 default files. IMO, that doesn't sound like "breaking", it sounds like it was "fixing".
 

Idgit

macrumors 6502a
Mar 14, 2004
551
158
So beyond disabling track2 (or is that disabling all tracks bar track1?) are there any other maggots in the apple that might bite me in the future I should be aware of?

Glad to hear you got it working.

I could be wrong, but I think chapters are only supported if the video has the file extension M4V (rather than MP4).

Also, be sure to use mp4file (part of MP4v2) to "optimize" your MP4/M4V files.

[Optimize] interleaves the audio and video samples, and puts the "MooV" atom at the begining of the file, restoring the Quicktime "fast-start" (also known as "pseudo-streaming") ability of the file.

For example, optimizing the file allows Plex Media Server to "direct stream" the file to Plex clients rather than transcoding it. So the computer that is running the Plex Media Server will use very little CPU when direct streaming vs lots of CPU when transcoding.

If you make changes to the file (like changing or adding tags) after optimizing, the "MooV" atom will no longer be at the beginning of the file, so you'll have to optimize it again if you want to keep the "fast-start" feature. Just make the optimize option be the last thing you run on the file.

If the MP4/M4V file will be bigger than 4 GB, be sure to enable "64 Bit chunk offset" or the file may not work on older devices.
 

dynaflash

macrumors 68020
Mar 27, 2003
2,119
8
I could be wrong, but I think chapters are only supported if the video has the file extension M4V (rather than MP4).
You are not wrong. correct use .m4v
If the MP4/M4V file will be bigger than 4 GB, be sure to enable "64 Bit chunk offset" or the file may not work on older devices.
If you don't use 64 bit chunk offset and the file ends up over 4 GB, it will not work on *any* devices. It will be a broken file.
 

Rushli0n

macrumors regular
Aug 27, 2012
118
0
Understood, but "checking" a file says this is the default, so by checking both files you were telling the aTV that both files are default. If you look back through previous posts here, you will see that the recommendation is to only have the first file (stereo) checked as default. Apparently, something in the new version was changed to no longer allow 2 default files. IMO, that doesn't sound like "breaking", it sounds like it was "fixing".

Right, and it apparently has caused users to have to go back and "correct" their files by only checking 1 default. I understand why, just saying it wasn't a problem before.

My novice understanding was that checking meant it was enabled, not defaulted. Seeing the checks as defaults makes more sense to me that only 1 should be selected.
 

Bymatt

macrumors member
Aug 11, 2011
48
0
EVER since I encode EVERYTHING to MKV via

handbrake, using about 1700 AND selecting AC3 pass through for either 2.0. 5.1 OR HOLD ON NOW, DTS pass thru for those that have it and send it via HDMI to an input port on my AVR...then to the flat screen, VIDEO and AUDIO have never been better.. My ATV is basically a nite lite. Why have crippled audio and have to put up with all this. In MY case I have access to flea markets, ( great dvds @ 3 for 5.00), and a great library which gives me an ENDLESS supply of material.
I can see why those that rent APPLE media or those that still stream to the ATV like it, but I cut the cord to that thing and ever since have enjoyed SUPERB MOVIE sound and audio with very little trouble.
Just my .02
 

mic j

macrumors 68030
Mar 15, 2012
2,663
156
handbrake, using about 1700 AND selecting AC3 pass through for either 2.0. 5.1 OR HOLD ON NOW, DTS pass thru for those that have it and send it via HDMI to an input port on my AVR...then to the flat screen, VIDEO and AUDIO have never been better.. My ATV is basically a nite lite. Why have crippled audio and have to put up with all this. In MY case I have access to flea markets, ( great dvds @ 3 for 5.00), and a great library which gives me an ENDLESS supply of material.
I can see why those that rent APPLE media or those that still stream to the ATV like it, but I cut the cord to that thing and ever since have enjoyed SUPERB MOVIE sound and audio with very little trouble.
Just my .02
How are you getting Handbrake mkv to your AVR?
 

Idgit

macrumors 6502a
Mar 14, 2004
551
158
SUCCESS!!! Thx for tips guys. I svn'd latest source + reinstalled vs2008 (didn't like vs2010) and got it compiled - So I now have a solution! Next comes the simple part writing the code.

It'll probably take me a week or 2 after that to get time to polish it, but then I'll release it. It's aim was the be mega-fast, require no user-intervention (beyond naming your files properly), minimal user options and to NEVER crash!

SublerCLI source

Is it possible for you to recompile the source code for SublerCLI so it works in Windows? If so, it might be helpful.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.