Wowza Community

Mux video and audio for HLS streams

Hello,

I’ve been searching for a while now, but haven’t had any success, so I thought I’d try my luck here. What I’d like to know is, if there is any way for Wowza to mux a video and audio file on demand. I have some content that is made up of a video file, and multiple separate audio files (for different languages).

I use JWPlayer for my desktop users, which has a plugin that can mux these files on demand, based on which audio track the user requests. I want to offer this same functionality to my iOS users. So in short: can Wowza mux these files for me? If yes, how would I do this?

Thanks in advance!

Pieter

Pieter,

Take a look at this article:

https://www.wowza.com/docs/how-to-select-mpeg-ts-stream-by-program-id-and-also-audio-language-by-pid

Richard

I would put all the audio tracks and the video track in one file, if possible. I use the MP4Box utility to do this (not part of Wowza, but one should be able to find it easily enough) – the command could be something like this:

mp4box -add video.mp4 -add english.mp4:lang=eng:group=1:name="English Audio Track" -add french.mp4:lang=fre:group=1:disable:name="French Audio Track" -new new.m4v

Then specify the audio track to use when calling the Wowza video URL as specified here:

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

You will have to reload the page/video if you want to switch audio tracks while streaming, but otherwise this works great across all formats (RTMP, HLS for iOS, etc.). And it makes local playback nicer too, if that’s part of your workflow – iTunes and other players will let you switch languages/tracks nicely.

I think Richard’s suggestion also relies on all of the tracks being inside the same stream/file. I am not aware of Wowza muxing streams on the fly.

You should be able to write a batch script for mp4box and/or ffmpeg to easily mux them. If the files are currently in the proper formats, you shouldn’t need any transcoding, and the process should go very quickly. If you let me know what platform you’re on, I could give you some pointers on batch scripting these.

@ Richard:

Thanks, but I don’t really understand the contents of the article you referred me to. I’m quite new to the whole concept of VOD streaming, therefore I would not really know if the article you suggest does what I’m asking. Could you provide me with some more background information, or perhaps a link to some explanation of the concept?

@ susta004:

Thanks for the suggestion. I’ve looked into it, but due to the nature of the platform I’m forced to use, I’m afraid this doesn’t suit my (superiors’) needs.

I have access to a video file, and an audio file. If I can get Wowza to load both these files, and mux them on the go, then that would be the ideal solution to my problem. If this can’t be done, I would have to mux the files myself, before uploading them to the server. Unfortunately, this is something my superiors only want to use as a last resort.

Thanks again susta004. :slight_smile:

We’ve decided to use the premuxing route, for now.