Ripping in surround for Apple TV

QuadraphonicQuad

Help Support QuadraphonicQuad:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
I find this a bit weird that members are actively seeking to convert to lossy formats.

If Hires is no longer important, do we even need to buy a quality AVR or speakers worth more than $200 each? (Asking for a friend)

I think it is more that people are looking for ways to enjoy their 5.1/Atmos rips in the Apple ecosystem and finding out that one of the solutions can only be done with a lossy method. It isn't like that is what people WANT, it is that is one of the few things that work.

I listen to all my 5.1 rips on an AppleTV in 24/48 (they are in my library at higher resolutions but it always downsamples to that). It isn't easy but I have a way. I have not found a satisfactory way to listen in spatial audio on AirPods etc. because the only possible solution is 5.1 at 256kbps which I wouldn't subject my ears to even to test if it works.
 
I'm doing this to have some multi-channel files available for when I go out walking. Of course my home listening uses highest quality sources.

From DVD-Audio (Bjork albums) I'm getting multi-channel MKV using MKVTools, simple pass-thru container bundle, no encoding or conversion.

ffmpeg -i D1_t01.mkv -vn -c:a aac_at -b:a 256k -sample_fmt s16 -ar 48000 output.m4a

I've managed to upload such a file (arrow symbol), but they show as unavailable on my iPhone (cloud with exclamation mark symbol). I don't have an Apple TV to check that.

Can somebody else who has done this please confirm that such tracks are playable in iPhone Music app?

Thanks!
 
Last edited:
I have figured it out. If you convert to a 256kbp (or lower) multichannel AAC (.m4a) and Apple Music "uploads" it, it will upload the unaltered .m4a and when you play it back on an AppleTV you will play back the multichannel .m4a. If you do it at a higher bitrate, Apple Music always resamples to 256kbps and will convert it to stereo in the process.

So if you are satisfied with 256kbps multichannel AAC, you can get them added to Apple Music.
I've continued to experiment with this and created 768kbps versions that were successfully uploaded and are playable on my iPhone. I picked that rate as I read that's the rate that multi-channel Dolby Atmos is encoded at on Apple Music.

ffmpeg -i input.mkv -vn -c:a aac_at -b:a 768k -sample_fmt s16 -ar 48000 -y output.m4a

Sadly, I don't have an Apple TV setup to check the bitrate that it pulls down. Would be interested if anybody who is interested can do this and report back.
 
I've continued to experiment with this and created 768kbps versions that were successfully uploaded and are playable on my iPhone. I picked that rate as I read that's the rate that multi-channel Dolby Atmos is encoded at on Apple Music.

ffmpeg -i input.mkv -vn -c:a aac_at -b:a 768k -sample_fmt s16 -ar 48000 -y output.m4a

Sadly, I don't have an Apple TV setup to check the bitrate that it pulls down. Would be interested if anybody who is interested can do this and report back.

Wow. I converted a 5.1 flac as directed and it was uploaded and plays in 5.1 on the AppleTV. I'm amazed. Did you try any higher sample rates?
 
Unclear what is happening on the iPhone. If I look at the AirPod settings it does indicate it is multichannel but spatial audio head tracking doesn't work, (pretty sure it doesn't for "Dolby Audio" either, have to do some more listening tests to see if it is actually trying to make it surround.

(Doesn't look like the encoder supports rates over 768k so I guess that is the best one can expect from this).
 
Unclear what is happening on the iPhone. If I look at the AirPod settings it does indicate it is multichannel but spatial audio head tracking doesn't work, (pretty sure it doesn't for "Dolby Audio" either, have to do some more listening tests to see if it is actually trying to make it surround.

(Doesn't look like the encoder supports rates over 768k so I guess that is the best one can expect from this).
I used Vox app on iPhone to confirm the specs/bitrate of the audio that was downloaded and played. It was exactly as uploaded, see attached image. That's when I posted about it in this thread.

As you say with the Apple Toolbox aac encoder (-c:a aac_at) the max for 5.1 surround is 768kbps, though I read the max for 7.1 is 960kbps I can't check. I picked the Apple encoder as I read some tests that showed it had higher quality than other encoders at the same bitrate.

If you want to go higher, you can use:
ffmpeg -i input.mkv -vn -c:a libfdk_aac -b:a 768k -sample_fmt s16 -ar 48000 -y output.m4a

but you'll need a custom install of ffmpeg (to get Fraunhofer_FDK_AAC):
brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-fdk-aac

The standard ffmpeg aac encoder (-c:a aac) supports more than 768kbps but I didn't pursue it more than a simple attempt (1000kbps). I've not done any real testing with higher than 768kbps.

I mentioned earlier that if the file has a "Text Track" in it (which is mostly used for chapter markers) the file will either upload but not be playable, or not upload, or be matched rather than uploaded. So maybe there was some other detritus in the previous test files that this ffmpeg encoding mechanism avoids? I check and remove Text Tracks with Subler app on macOS.

(also, quick note: Dolby Atmos is also lossy at ~768kbps)
 

Attachments

  • IMG_6336.PNG
    IMG_6336.PNG
    1.2 MB
Last edited:
I’ve done a couple of tests converting my Apple Lossless to 768k aac with this method and it looks good. Metadata is preserved except for cover art. Anyone know how to get ffmpeg to preserve cover art?
 
My further testing using a "channel check" 5.1 test track indicates that yes the AirPods from an iPhone are doing multichannel with head tracking. Very nice.

They also play 5.1 on the AppleTV either through Apple Music Library or using Home Sharing.

So if 768kbps (or perhaps a better bitrate if we figure out how) is acceptable, this seems like a best of "most" (excluding lossless) worlds solution for encoding 5.1 for the Apple ecosystem.
 
I've continued to experiment with this and created 768kbps versions that were successfully uploaded and are playable on my iPhone. I picked that rate as I read that's the rate that multi-channel Dolby Atmos is encoded at on Apple Music.

ffmpeg -i input.mkv -vn -c:a aac_at -b:a 768k -sample_fmt s16 -ar 48000 -y output.m4a

Sadly, I don't have an Apple TV setup to check the bitrate that it pulls down. Would be interested if anybody who is interested can do this and report back.

Use this command-line switch to remove any unwanted chapters in the mkv: -map_chapters -1
 
Interesting hiccup. iTunes decided to "match" some of the tracks which means, the iPhone and AppleTV get a 256kpbs stereo version. No bueno. Can probably confuse it with bad album/track names or something but not easy.
 
Indeed, I've had that. But only on one track: "Play Dead" from Björk's "Debut" album.

Is it possible that track exists on Apple Music already in 5.1 on some other release? It was from a movie after all.

Not likely, just that the sound profile it builds matched the stereo version. The matches I got were on the Art of Noise - Daft SACD and it just matched the normal stereo version.
 
The matching could be a deal breaker for me. I've tried a few tricks that have worked before (changing Artist/Album, etc. but no dice.

For stereo tracks it is easy, just upsample them to 24/96 and they upload (then replace the the original after. If I can't figure out a trick to get matched 768k 5.1's to upload it isn't going to work out.
 
If you want to go higher, you can use:


but you'll need a custom install of ffmpeg (to get Fraunhofer_FDK_AAC):


The standard ffmpeg aac encoder (-c:a aac) supports more than 768kbps but I didn't pursue it more than a simple attempt (1000kbps). I've not done any real testing with higher than 768kbps.

I tested with fdk_aac. Looks like the bitrate maxes out at 1440kpbs. But Music does still upload them. Sadly it also still matches them.
 
I had two "matched" tracks in my 6 albums.

- Play Dead (from Björk's Debut album, and The Young Americans movie)
- Army of Me (from Björk's Post album, and Tank Girl movie)

Interestingly both from movies. No idea if that has any significance.

But I'm happy with this method of ripping as an interim measure until the albums I want come to streaming as multi-channel versions.
 
Back
Top