# VOD MP4 files with multiple audio tracks - Delivery and web playback

**URL:** https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137
**Category:** Wowza Streaming Engine
**Created:** [February 7, 2012, 12:49pm UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137 "2012-02-07T12:49:15Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![Jason\_T](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Jason\_T](https://community.wowza.com/u/Jason_T)
#### Post date: [February 7, 2012, 12:49pm UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/1 "2012-02-07T12:49:15Z")

</div>

We have an archive of MP4 h264 multi-track videos.

When a user visits our site and requests to see a video through our site, we would like to send parameters such as filename or fileID and audio track ID to WOWZA.

Then WOWZA delivers the specified file and corresponding audio track.

Example:

a video has 3 audio tracks: track 1 = English, track 2 = French, track 3 = Spanish

The website visitor selects their preferred language and the player sends WOWZA the file ID and track ID to use. WOWZA then delivers the desired video and audio track.

Is this possible?

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [February 7, 2012, 9:16pm UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/2 "2012-02-07T21:16:45Z")

</div>

For Flash RTMP clients, you can override play:

[https://www.wowza.com/docs/how-to-override-play-to-remap-a-stream-name](https://www.wowza.com/docs/how-to-override-play-to-remap-a-stream-name)

To deal with other clients also, you will need to use IMediaStreamNameAliasProvider2

[https://www.wowza.com/docs/how-to-use-the-imediastreamnamealiasprovider2-interface](https://www.wowza.com/docs/how-to-use-the-imediastreamnamealiasprovider2-interface)

Richard

---

<div class="post-metadata">

### Author: ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)
#### Post date: [February 16, 2012, 4:51pm UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/3 "2012-02-16T16:51:59Z")

</div>

This API is no really open. The underlying MediaReader API is kind of complicated. What exactly are you trying to accomplish? There may be some other way to do it.

Charlie

---

<div class="post-metadata">

### Author: ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)
#### Post date: [February 17, 2012, 4:50am UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/4 "2012-02-17T04:50:22Z")

</div>

I can’t really think of a way to enable this with VOD content. If it were live it would be a bit easier. With VOD we really don’t have the hooks intercept individual audio packets. The MediaReader handles the file in time slices. It does not have methods that deal with individual packets.

How large is the library? Seems like it would be quick to just fix the files and make them multi-track.

Charlie

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [February 8, 2012, 1:51am UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/5 "2012-02-08T01:51:08Z")

</div>

I’m not sure if that is possible, I don’t so. You can select one of many tracks:

[https://www.wowza.com/docs/how-to-select-audio-and-subtitle-tracks-from-a-video-on-demand-file](https://www.wowza.com/docs/how-to-select-audio-and-subtitle-tracks-from-a-video-on-demand-file)

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [February 8, 2012, 6:18pm UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/6 "2012-02-08T18:18:00Z")

</div>

I might be wrong, but I dug around the server-side API and haven’t found anything. You can get a list of independent Wowza consultants by sending request to support@wowza.com.

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [February 8, 2012, 6:28pm UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/7 "2012-02-08T18:28:47Z")

</div>

I confirmed: it is not possible to select one channel from a stereo audio track.

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [February 16, 2012, 8:01pm UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/8 "2012-02-16T20:01:50Z")

</div>

Robert,

Yes, take a look at the bottom of the midroll example that shows an example that extends MediaReaderH264.

[https://www.wowza.com/docs/how-to-insert-a-pre-roll-or-mid-roll-for-video-on-demand-playback-in-flash-rtmp-client](https://www.wowza.com/docs/how-to-insert-a-pre-roll-or-mid-roll-for-video-on-demand-playback-in-flash-rtmp-client)

Also take a look at the IMediaReaderActionNotify interface:

[https://www.wowza.com/docs/how-to-select-audio-data-and-or-video-channel-from-a-multi-channel-mp4-file-by-using-imediareaderactionnotify](https://www.wowza.com/docs/how-to-select-audio-data-and-or-video-channel-from-a-multi-channel-mp4-file-by-using-imediareaderactionnotify)

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [February 16, 2012, 8:44pm UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/9 "2012-02-16T20:44:49Z")

</div>

Robert,

No, sorry, that is not available.

Richard

---

<div class="post-metadata">

### Author: ![Robert\_Reinhardt](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@Robert\_Reinhardt](https://community.wowza.com/u/Robert_Reinhardt)
#### Post date: [February 16, 2012, 11:37am UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/10 "2012-02-16T11:37:59Z")

</div>

Richard, is it possible to build a custom MediaReaderH264? The class is in wms-mediareader-h264.jar, but I don’t know if it’s possible to extend this class. I’d love to explore the possibility of selecting the channel within a track.

---

<div class="post-metadata">

### Author: ![Robert\_Reinhardt](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@Robert\_Reinhardt](https://community.wowza.com/u/Robert_Reinhardt)
#### Post date: [February 16, 2012, 12:17pm UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/11 "2012-02-16T12:17:46Z")

</div>

Thanks for the reply, Richard! Do you provide the Java class for the MediaReaderH264 base? I’d like to review it too if possible.

-Robert

---

<div class="post-metadata">

### Author: ![Robert\_Reinhardt](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@Robert\_Reinhardt](https://community.wowza.com/u/Robert_Reinhardt)
#### Post date: [February 16, 2012, 1:02pm UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/12 "2012-02-16T13:02:06Z")

</div>

Fair enough, I guess. So, I’ll need to play a game of (hopefully not) 20 questions as a backup. 🙂 I noticed there is a public method for MediaReaderH264.sendAudioTrakData(). How is the method utilized by WMS for real-time streaming? Would this be a likely method to overwrite and do my own manipulation of the retrieved audio sample during playback? Or would I overwrite another method such as MedaReaderH264.writePacket()? I think if I can grab the audio sample that is currently being read, I can manipulate the sample to select either the left or right channel using Xuggler.

-Robert

---

<div class="post-metadata">

### Author: ![Robert\_Reinhardt](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@Robert\_Reinhardt](https://community.wowza.com/u/Robert_Reinhardt)
#### Post date: [February 16, 2012, 8:09pm UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/13 "2012-02-16T20:09:29Z")

</div>

Charlie, thanks for the reply. If you track back to the beginning of this thread, the original poster was asking about playing just the one channel of a stereo pair in a single audio track in Wowza. Richard was saying it’s not possible, and I have a client with a similar request (heck, it could even be my client that started the thread). The use is this: the client has a large library of encoded H.264 with one language on the left channel, and another language on the right channel. Converting the whole library of assets (number in the thousands) to a more proper dual audio track muxer is more than the client wants to undertake and/or avoid if possible.

-Robert

---

<div class="post-metadata">

### Author: ![Robert\_Reinhardt](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@Robert\_Reinhardt](https://community.wowza.com/u/Robert_Reinhardt)
#### Post date: [February 17, 2012, 9:02am UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/14 "2012-02-17T09:02:46Z")

</div>

Charlie, thanks for the reply. As I mentioned in my last post, the client has thousands of videos encoded this way (don’t ask me why it’s this way–that’s just the way someone decided to do it way back when). Time slices might be fine–I may not need access to individual packets. Have you used Xuggler with WMS? It’s pretty insane what you can do. I worked on a live stream frame grabber/analyzer that works at the server level using Xuggler. Can you tell me more about how sendAudioTrakData() and writePacket()? In general, I’m not familiar with the process that a mediareader goes through during a playback request?

-Robert

---

<div class="post-metadata">

### Author: ![Jason\_T](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Jason\_T](https://community.wowza.com/u/Jason_T)
#### Post date: [February 7, 2012, 1:48pm UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/15 "2012-02-07T13:48:03Z")

</div>

excellent

what about selecting a single audio channel from a track?

example: i want to play only the left audio channel from track 1

---

<div class="post-metadata">

### Author: ![Jason\_T](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Jason\_T](https://community.wowza.com/u/Jason_T)
#### Post date: [February 8, 2012, 9:30am UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/16 "2012-02-08T09:30:36Z")

</div>

what would the cost be to get WOWZA to build the functionality for us either in the wowza core or as a module?

can you provide a quote?

---

<div class="post-metadata">

### Author: ![Jason\_T](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Jason\_T](https://community.wowza.com/u/Jason_T)
#### Post date: [February 8, 2012, 11:08am UTC](https://community.wowza.com/t/vod-mp4-files-with-multiple-audio-tracks-delivery-and-web-playback/38137/17 "2012-02-08T11:08:35Z")

</div>

OK, we are sending an email to support for a quote for a custom module

thank you for you help
