# Mix audio and video streams

**URL:** <https://community.wowza.com/t/mix-audio-and-video-streams/34004>\
**Category:** Wowza Streaming Engine\
**Created:** [January 19, 2010, 9:02pm UTC](https://community.wowza.com/t/mix-audio-and-video-streams/34004 "2010-01-19T21:02:09Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meinaart\_van\_Straale](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@Meinaart\_van\_Straale](https://community.wowza.com/u/Meinaart_van_Straale)\
**Post date:** [January 19, 2010, 9:02pm UTC](https://community.wowza.com/t/mix-audio-and-video-streams/34004/1 "2010-01-19T21:02:09Z")

</div>

Is it possible with Wowza to mix an audio and a video stream to one mixed audio/video stream?

I am thinking about a multicamera setup, where the user can switch between camera’s but still using the same audiostream. I could off course use 2 streams in my player but then I probably will get synching problems.

Any clever solutions for this? I need a salution for both live and on-demand streams.

Could not find a thread about this subject with the forum search.

Thanks in advance.

---

<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:** [January 19, 2010, 12:06pm UTC](https://community.wowza.com/t/mix-audio-and-video-streams/34004/2 "2010-01-19T12:06:07Z")

</div>

Just completely separate the audio from the video. A single NetConnection can have many NetStream objects. So have one NetStream that is audio only and one that is video only. You can switch the video at will.

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:** [January 19, 2010, 12:18pm UTC](https://community.wowza.com/t/mix-audio-and-video-streams/34004/3 "2010-01-19T12:18:53Z")

</div>

Synchronization is going to be an issue. If you want it synchronized then you will need an audio channel with each video channel.

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:** [January 19, 2010, 1:46pm UTC](https://community.wowza.com/t/mix-audio-and-video-streams/34004/4 "2010-01-19T13:46:17Z")

</div>

You might be able to do something tricky with the Publisher API but I really don’t have sample code. You would need to mix streams from multiple source streams. Tricky!

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:** [May 13, 2010, 12:20pm UTC](https://community.wowza.com/t/mix-audio-and-video-streams/34004/5 "2010-05-13T12:20:10Z")

</div>

Jake,

Describe in detail what you need. The devil is in the details of how you want it to work.

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:** [May 14, 2010, 3:17am UTC](https://community.wowza.com/t/mix-audio-and-video-streams/34004/6 "2010-05-14T03:17:07Z")

</div>

It would probably be best to re-encode both the video and audio into a single stream. We do have the API to intercept the incoming audio and video packets. The re-encoding part is not part of Wowza. A tool like Xuggler might be able to do this.

Charlie

---

<div class="post-metadata">

**Author:** ![Jake\_Hilton](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@Jake\_Hilton](https://community.wowza.com/u/Jake_Hilton)\
**Post date:** [May 13, 2010, 1:13pm UTC](https://community.wowza.com/t/mix-audio-and-video-streams/34004/7 "2010-05-13T13:13:04Z")

</div>

Just going to refresh this convo a little… so when you say it would be tricky Charlie… does that mean that you have an idea of how you’d approach it or that you’d need to sit and have a coke to think of way to do it.

So I assume you’d use the videopassthru stuff in combination with the publisher api? I guess using a global listener for start publishing you’d then write the stream out to a new feed… but I have no idea how you’d handle the combining of those.

Any direction you could push me?

Thanks,

Jake

---

<div class="post-metadata">

**Author:** ![Jake\_Hilton](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@Jake\_Hilton](https://community.wowza.com/u/Jake_Hilton)\
**Post date:** [May 13, 2010, 1:35pm UTC](https://community.wowza.com/t/mix-audio-and-video-streams/34004/8 "2010-05-13T13:35:01Z")

</div>

Charlie,

Well if there really is pie in the sky… 🙂

It would be great to have say 3 publishers pushing a video/audio stream into wowza… and have wowza grab those streams and output a single video of them side by side or something. I guess in a similar way to the octopuz project that Xuggle is doing \> [http://www.xuggle.com/octopus/](http://www.xuggle.com/octopus/)

Would it be a matter of intercepting the amfpackets and writing out the combined audio/video/data bits nicely so that it didn’t clobber one another and still play nicely on the clientside?

Thanks for the ear to bend.

Jake

---

<div class="post-metadata">

**Author:** ![Meinaart\_van\_Straale](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@Meinaart\_van\_Straale](https://community.wowza.com/u/Meinaart_van_Straale)\
**Post date:** [January 19, 2010, 9:16pm UTC](https://community.wowza.com/t/mix-audio-and-video-streams/34004/9 "2010-01-19T21:16:51Z")

</div>

And that causes no problem with synchronization? Neither with live or on-demand streams?

---

<div class="post-metadata">

**Author:** ![Meinaart\_van\_Straale](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@Meinaart\_van\_Straale](https://community.wowza.com/u/Meinaart_van_Straale)\
**Post date:** [January 19, 2010, 9:32pm UTC](https://community.wowza.com/t/mix-audio-and-video-streams/34004/10 "2010-01-19T21:32:11Z")

</div>

It’s not possible to mix those 2 together with Wowza?

Do you know any other serverside solutions?

---

<div class="post-metadata">

**Author:** ![Meinaart\_van\_Straale](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@Meinaart\_van\_Straale](https://community.wowza.com/u/Meinaart_van_Straale)\
**Post date:** [January 19, 2010, 11:02pm UTC](https://community.wowza.com/t/mix-audio-and-video-streams/34004/11 "2010-01-19T23:02:47Z")

</div>

I am not sure if it’s worth the try if even you say it’s tricky ;).

As always, thank you for the fast and helpful replies charlie :).
