# Is it possible to mix several threads into one using modules?

**URL:** <https://community.wowza.com/t/is-it-possible-to-mix-several-threads-into-one-using-modules/55493>\
**Category:** Wowza Streaming Engine\
**Created:** [July 1, 2020, 2:08pm UTC](https://community.wowza.com/t/is-it-possible-to-mix-several-threads-into-one-using-modules/55493 "2020-07-01T14:08:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexey\_Linnik](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@Alexey\_Linnik](https://community.wowza.com/u/Alexey_Linnik)\
**Post date:** [July 1, 2020, 2:08pm UTC](https://community.wowza.com/t/is-it-possible-to-mix-several-threads-into-one-using-modules/55493/1 "2020-07-01T14:08:09Z")

</div>

Hello, everybody! Need to know if it is possible to mix several rtmp threads into one using modules? By Picture-in-Picture type, or simply there is a main stream, and additional streams add sound. It’s the mixing that I need so that all the streamers can be heard at the same time.

I need to see if that’s possible in principle, so I don’t have to spend time on investigating if that’s not possible. And what skills does a specialist need to have in order to create a module like this?

---

<div class="post-metadata">

**Author:** ![Alexey\_Linnik](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@Alexey\_Linnik](https://community.wowza.com/u/Alexey_Linnik)\
**Post date:** [July 1, 2020, 4:28pm UTC](https://community.wowza.com/t/is-it-possible-to-mix-several-threads-into-one-using-modules/55493/2 "2020-07-01T16:28:44Z")

</div>

I’m primarily interested in PiP.

---

<div class="post-metadata">

**Author:** ![Karel\_Boek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/karel_boek/32/454_2.png) [@Karel\_Boek](https://community.wowza.com/u/Karel_Boek)\
**Post date:** [July 1, 2020, 4:35pm UTC](https://community.wowza.com/t/is-it-possible-to-mix-several-threads-into-one-using-modules/55493/3 "2020-07-01T16:35:58Z")

</div>

PiP with Wowza is a challenge, because there’s no good solution for merging two videos, except via heavy customization of the transcoder process, and it requires the original streams to have same frame rate, etc. It would be better if you can do PiP before you send the stream to Wowza.

---

<div class="post-metadata">

**Author:** ![Karel\_Boek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/karel_boek/32/454_2.png) [@Karel\_Boek](https://community.wowza.com/u/Karel_Boek)\
**Post date:** [July 1, 2020, 2:18pm UTC](https://community.wowza.com/t/is-it-possible-to-mix-several-threads-into-one-using-modules/55493/4 "2020-07-01T14:18:14Z")

</div>

Not sure if you are talking about PiP or about audio mix. Do you mean to mix multiple audio tracks into a single (mono or stereo) track, or do you want an output stream with multiple audio choices? Or do you mean video PiP?

---

<div class="post-metadata">

**Author:** ![Karel\_Boek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/karel_boek/32/454_2.png) [@Karel\_Boek](https://community.wowza.com/u/Karel_Boek)\
**Post date:** [July 1, 2020, 4:35pm UTC](https://community.wowza.com/t/is-it-possible-to-mix-several-threads-into-one-using-modules/55493/5 "2020-07-01T16:35:58Z")

</div>

PiP with Wowza is a challenge, because there’s no good solution for merging two videos, except via heavy customization of the transcoder process, and it requires the original streams to have same frame rate, etc. It would be better if you can do PiP before you send the stream to Wowza.

---

<div class="post-metadata">

**Author:** ![Karel\_Boek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/karel_boek/32/454_2.png) [@Karel\_Boek](https://community.wowza.com/u/Karel_Boek)\
**Post date:** [July 2, 2020, 7:28am UTC](https://community.wowza.com/t/is-it-possible-to-mix-several-threads-into-one-using-modules/55493/6 "2020-07-02T07:28:13Z")

</div>

Audio mix is a totally different question. It’s not simple either; during the transcoding process you can get the raw audio samples and store them in buffers, then mix them manually or with a 3rd party library and add the mixed samples to the output stream.

---

<div class="post-metadata">

**Author:** ![Alexey\_Linnik](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@Alexey\_Linnik](https://community.wowza.com/u/Alexey_Linnik)\
**Post date:** [July 2, 2020, 3:13am UTC](https://community.wowza.com/t/is-it-possible-to-mix-several-threads-into-one-using-modules/55493/7 "2020-07-02T03:13:30Z")

</div>

I see, PiP is complicated in implementation, and what about the situation when there is a main thread and there are additional threads, but only sound is needed from them. And you only need to mix the sound streams.
