Go Back   MacRumors Forums > Apple Hardware > Apple TV and Home Theater

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 3, 2012, 12:50 PM   #26
Idgit
macrumors 6502
 
Join Date: Mar 2004
Quote:
Originally Posted by ConvertApple View Post
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.
Idgit is offline   0 Reply With Quote
Old Oct 3, 2012, 04:00 PM   #27
ConvertApple
macrumors newbie
 
Join Date: Oct 2012
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
ConvertApple is offline   0 Reply With Quote
Old Oct 3, 2012, 04:04 PM   #28
Idgit
macrumors 6502
 
Join Date: Mar 2004
Quote:
Originally Posted by ConvertApple View Post
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?
Idgit is offline   0 Reply With Quote
Old Oct 3, 2012, 06:14 PM   #29
ConvertApple
macrumors newbie
 
Join Date: Oct 2012
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!
ConvertApple is offline   0 Reply With Quote
Old Oct 3, 2012, 07:22 PM   #30
Idgit
macrumors 6502
 
Join Date: Mar 2004
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.




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

Idgit is offline   0 Reply With Quote
Old Oct 3, 2012, 07:33 PM   #31
omni
macrumors 6502
 
Join Date: Jan 2008
Quote:
Originally Posted by Idgit View Post

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
omni is offline   0 Reply With Quote
Old Oct 3, 2012, 07:38 PM   #32
ConvertApple
macrumors newbie
 
Join Date: Oct 2012
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
ConvertApple is offline   0 Reply With Quote
Old Oct 3, 2012, 07:57 PM   #33
Idgit
macrumors 6502
 
Join Date: Mar 2004
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.

Quote:
mp4track -z --track-id 3 --enabled false test.mp4
Track info before running the command:
Quote:
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:

Quote:
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>


----------

Quote:
Originally Posted by omni View Post
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.
Idgit is offline   0 Reply With Quote
Old Oct 3, 2012, 08:11 PM   #34
Idgit
macrumors 6502
 
Join Date: Mar 2004
CovertApple,

Can you integrate mp4tools and/or MP4Box into your workflow?

MP4v2

MP4v2 Command-line Tools Guide

MP4Box
Idgit is offline   0 Reply With Quote
Old Oct 3, 2012, 08:25 PM   #35
ConvertApple
macrumors newbie
 
Join Date: Oct 2012
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
ConvertApple is offline   0 Reply With Quote
Old Oct 3, 2012, 08:49 PM   #36
mic j
macrumors 68020
 
Join Date: Mar 2012
Quote:
Originally Posted by ConvertApple View Post
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.
__________________
17" MBP '09, 2.66 GHz, 8GB RAM; 13" MBP (Retina) '12, 2.5GHz, 8GB RAM; iPad 2, 32GB; iPhone 5s; AE; AppleTV 3; AEBS w 1TB Seagate HDD; 65" Mits DLP, Sony STR-DB1070 AVR
mic j is offline   0 Reply With Quote
Old Oct 3, 2012, 09:19 PM   #37
Idgit
macrumors 6502
 
Join Date: Mar 2004
ConvertApple,

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

MP4Creator
Idgit is offline   0 Reply With Quote
Old Oct 4, 2012, 04:26 AM   #38
Idgit
macrumors 6502
 
Join Date: Mar 2004
Quote:
Originally Posted by ConvertApple View Post
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:

Quote:
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
Idgit is offline   0 Reply With Quote
Old Oct 4, 2012, 05:02 AM   #39
ConvertApple
macrumors newbie
 
Join Date: Oct 2012
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 by ConvertApple; Oct 4, 2012 at 05:49 AM.
ConvertApple is offline   0 Reply With Quote
Old Oct 4, 2012, 07:40 AM   #40
ConvertApple
macrumors newbie
 
Join Date: Oct 2012
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 is offline   0 Reply With Quote
Old Oct 4, 2012, 09:49 AM   #41
GarrettL1979
macrumors 6502
 
Join Date: Feb 2012
are you all still having problems with this? i haven't updated yet...
GarrettL1979 is offline   0 Reply With Quote
Old Oct 4, 2012, 11:24 AM   #42
ConvertApple
macrumors newbie
 
Join Date: Oct 2012
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!
ConvertApple is offline   0 Reply With Quote
Old Oct 4, 2012, 01:38 PM   #43
Rushli0n
macrumors regular
 
Join Date: Aug 2012
Quote:
Originally Posted by mic j View Post
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.
__________________
13" Unibody Macbook, 2.0 GHz, 2 GB RAM, 160 GB HD iPad 2, 16 GB, WiFi Apple TV 2 & 3 Airport Extreme (Late 2009) iPod touch, 32 GB, 5th Gen
Rushli0n is offline   0 Reply With Quote
Old Oct 4, 2012, 01:54 PM   #44
mic j
macrumors 68020
 
Join Date: Mar 2012
Quote:
Originally Posted by Rushli0n View Post
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".
__________________
17" MBP '09, 2.66 GHz, 8GB RAM; 13" MBP (Retina) '12, 2.5GHz, 8GB RAM; iPad 2, 32GB; iPhone 5s; AE; AppleTV 3; AEBS w 1TB Seagate HDD; 65" Mits DLP, Sony STR-DB1070 AVR
mic j is offline   0 Reply With Quote
Old Oct 4, 2012, 02:03 PM   #45
Idgit
macrumors 6502
 
Join Date: Mar 2004
Quote:
Originally Posted by ConvertApple View Post
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.

Quote:
[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.
Idgit is offline   0 Reply With Quote
Old Oct 4, 2012, 02:08 PM   #46
dynaflash
macrumors 68020
 
Join Date: Mar 2003
Quote:
Originally Posted by Idgit View Post
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
Quote:
Originally Posted by Idgit View Post
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.
dynaflash is offline   0 Reply With Quote
Old Oct 4, 2012, 03:15 PM   #47
Rushli0n
macrumors regular
 
Join Date: Aug 2012
Quote:
Originally Posted by mic j View Post
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.
__________________
13" Unibody Macbook, 2.0 GHz, 2 GB RAM, 160 GB HD iPad 2, 16 GB, WiFi Apple TV 2 & 3 Airport Extreme (Late 2009) iPod touch, 32 GB, 5th Gen
Rushli0n is offline   0 Reply With Quote
Old Oct 4, 2012, 04:23 PM   #48
Bymatt
macrumors member
 
Join Date: Aug 2011
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
Bymatt is offline   0 Reply With Quote
Old Oct 4, 2012, 05:01 PM   #49
mic j
macrumors 68020
 
Join Date: Mar 2012
Quote:
Originally Posted by Bymatt View Post
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?
__________________
17" MBP '09, 2.66 GHz, 8GB RAM; 13" MBP (Retina) '12, 2.5GHz, 8GB RAM; iPad 2, 32GB; iPhone 5s; AE; AppleTV 3; AEBS w 1TB Seagate HDD; 65" Mits DLP, Sony STR-DB1070 AVR
mic j is offline   0 Reply With Quote
Old Oct 4, 2012, 06:15 PM   #50
Idgit
macrumors 6502
 
Join Date: Mar 2004
Quote:
Originally Posted by ConvertApple View Post
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.
Idgit is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Hardware > Apple TV and Home Theater

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
How to encode many files with handbrake, changing the audio bitrate darshie76 Digital Video 1 Nov 26, 2013 07:59 PM
Handbrake Encoded Video Stutters in iTunes thunderclap Windows, Linux & Others on the Mac 0 Jan 30, 2013 08:58 PM
Apple TV 3 Handbrake Audio CopyPaste Apple TV and Home Theater 2 Dec 18, 2012 12:35 AM
anyway to get handbrake encoded stereo only to 5.1? x-evil-x Apple TV and Home Theater 0 Aug 2, 2012 05:29 AM
Help! No audio on .m4v files after I encoded them! absolutelypb Mac OS X 10.7 Lion 1 Jul 8, 2012 09:00 PM

Forum Jump

All times are GMT -5. The time now is 08:28 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC