Wowza Community

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

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?

For Flash RTMP clients, you can override play:

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

Richard

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

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

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

Richard

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

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

Richard

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

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

Richard

Robert,

No, sorry, that is not available.

Richard

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.

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

Fair enough, I guess. So, I’ll need to play a game of (hopefully not) 20 questions as a backup. :slight_smile: 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

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

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

excellent

what about selecting a single audio channel from a track?

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

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?

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

thank you for you help