5
4
I'm creating audio tracks from movies that can be played on Apple TV and iOS devices. Handbrake could downmix 5.1 audio to stereo with Pro Logic II matrix encoding. How can I do that with ffmpeg?
I found this link on ffmpeg Trac mentioning that I could do matrix encoding with libswresample
, but further searching doesn't show how to actually use this in command line.
I tried
ffmpeg -i test.mkv -map 0:1 -c libfdk_aac -ac 2 -af aresample -matrix_encoding dplii out.aac
where the only audio track in the source file test.mkv
is a 5.1ch DTS HD MA, but the generated AAC audio does not seem to be matrix encoded.
wouldn't you rather convert the DTS-MA to AC3 rather than AAC? – James – 2013-05-12T21:08:17.743
@James AppleTV and iOS devices don't support AC-3. (See http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html)
– slhck – 2013-05-12T21:25:34.297ah. misread question. thought we were converting movies for playback rather than just extracting the audio – James – 2013-05-12T21:30:09.350
Well, actually Apple TV can do AC-3 passthrough to TV via HDMI if the TV supports AC-3 decoding (most LCD TVs do), or via the optical link. However if I want to view the movie on iOS devices, AAC is the only choice. I've already make ffmpeg to create an AC-3 track correctly, but the AAC DPLII is puzzling me as nothing can be found so far. – Riobard – 2013-05-13T03:04:28.010
Out of interest, what do you mean 'AAC is the only choice'? What devices are you trying to watch the movies on which don't support AC3? AFAIK the iPad supports AC3 audio in MP4 movies / tv shows. – James – 2013-05-13T07:18:33.340
I tested on iPad 3 with a MP4 movie with AC-3 audio track. There is no sound at all. Apple's official spec for iPad doesn't include AC-3 either. Where did you find that iPad supports AC-3 playback? – Riobard – 2013-05-13T18:47:59.680