Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Level 7

m4v playback with multiple audio tracks

Hello,
I have encoded a series of home DVDs with m4v that have both an AAC and an AC3 audio track. It appears that Roku SDK can't handle more than one audio track with the video.

Is there a way for me to select the track to be played and allow the user to pick that from a menu?

Thanks
0 Kudos
4 Replies
Level 7

Re: m4v playback with multiple audio tracks

http://forums.roku.com/viewtopic.php?t=25107

Check out this thread from earlier. BbeFilms also has some good posts on the ripping process.

-Shlep'
0 Kudos
Highlighted
Level 9

Re: m4v playback with multiple audio tracks

Unfortunately, our mpeg demux is having problems parsing multiple audio streams out of a file and selecting the appropriate stream to play. We will enable the parsing of multiple audio streams in the future.

There is a work around you can use today. If you have access to the content, you can strip the excess streams using a transcoding tool like ffmpeg:

% ffmpeg -i MyMultiTracAudio.m4a
....
Duration: 00:59:06.98, start: 0.000000, bitrate: 71 kb/s
Stream #0.0(eng): Audio: aac, 44100 Hz, stereo, s16
Stream #0.1(eng): Data: mp4s / 0x7334706D
Stream #0.2(eng): Data: mp4s / 0x7334706D
Stream #0.3(eng): Data: rtp / 0x20707472

% ffmpeg -i MyMultitracAudio.m4a -map 0:0 MySingletracAudio.mp3

% ffmpeg -i MySingletracAudio.mp3
....
Input #0, mp3, from 'MySingletracAudio.mp3':
Duration: 00:59:07.92, start: 0.000000, bitrate: 63 kb/s
Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 64 kb/s

The -map option can map input streams to output streams. In this case I also transcoded the stream from aac to mp3.

By default on Fedora, ffmpeg is not compiled against libfaac so the transcoding was a necessary step for me (libfaac is required for encoding aac).

--Kevin
0 Kudos
Highlighted
Level 9

Re: m4v playback with multiple audio tracks

Found another way to use ffmpeg to get an aac stream out without libfaac... You can copy a particular stream by specifying the audio codec as "copy".

% ffmpeg -i MyMultiTracAudio.m4a -map 0:0 -acodec copy MySingleTracAudio.m4a

% ffmpeg -i MySingleTracAudio.m4a
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MySingleTracAudio.m4a':
Duration: 00:59:06.98, start: 0.000000, bitrate: 63 kb/s
Stream #0.0(eng): Audio: aac, 44100 Hz, stereo, s16
0 Kudos
Highlighted
Level 7

Re: m4v playback with multiple audio tracks

Excellent info! I think we need a tacked FAQ thread for recipes like this...
0 Kudos