# Mix rtmp and mpegts audios and output HLS

**URL:** <https://community.wowza.com/t/mix-rtmp-and-mpegts-audios-and-output-hls/93487>\
**Category:** Wowza Streaming Engine\
**Created:** [July 1, 2021, 6:52am UTC](https://community.wowza.com/t/mix-rtmp-and-mpegts-audios-and-output-hls/93487 "2021-07-01T06:52:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Li\_Meng1](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@Li\_Meng1](https://community.wowza.com/u/Li_Meng1)\
**Post date:** [July 1, 2021, 6:52am UTC](https://community.wowza.com/t/mix-rtmp-and-mpegts-audios-and-output-hls/93487/1 "2021-07-01T06:52:32Z")

</div>

Hi guys, i have a RTMP stream (which contains 1 video track and 1 audio track) and a MPEG-TS stream with multiple audio tracks. I want to mix video and audio tracks from RTMP and MPEG-TS to output a single HLS stream. Can i do it in Wowza, or is there any other possible solution? Thanks a lot!

The media flow like below:

```
 -- RTMP (1 video / 1 audio) -->
                                -----> HLS (1 video / 3 audios) 
 -- MPEG-TS (2 audios) ------->
```

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [July 2, 2021, 4:13pm UTC](https://community.wowza.com/t/mix-rtmp-and-mpegts-audios-and-output-hls/93487/2 "2021-07-02T16:13:55Z")

</div>

Yes you can do that and you would use the AV Mix module:

# Mix audio and video from different live sources with a Wowza Streaming Engine Java module

> **[Use ModuleAVMix](https://www.wowza.com/docs/how-to-mix-audio-and-video-from-different-live-sources-moduleavmix#configuration)**
>
> Combine separate audio and video sources into a single stream using ModuleAVMix for Wowza Streaming Engine.

* * *

There is also a repo on our GitHub with some sample code.

> **[GitHub - WowzaMediaSystems/wse-plugin-avmix: Wowza Streaming Engine™ module that combines...](https://github.com/WowzaMediaSystems/wse-plugin-avmix)**
>
> Wowza Streaming Engine™ module that combines separate audio and video sources into a single stream.

---

<div class="post-metadata">

**Author:** ![Li\_Meng1](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@Li\_Meng1](https://community.wowza.com/u/Li_Meng1)\
**Post date:** [July 4, 2021, 12:56am UTC](https://community.wowza.com/t/mix-rtmp-and-mpegts-audios-and-output-hls/93487/3 "2021-07-04T00:56:04Z")

</div>

Thank you for your reply, does this module only support mix one video with one audio? Could it support mix one video track and one audio track with multiple audio tracks as what i want?

Thanks

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [July 6, 2021, 4:49pm UTC](https://community.wowza.com/t/mix-rtmp-and-mpegts-audios-and-output-hls/93487/4 "2021-07-06T16:49:14Z")

</div>

Sorry, we were closed for the U.S. Holiday. No you can mix and combine several tracks. If you looked at the article, it should describe how you can add multiple audio tracks for one video as an example. We have customers that add multiple audio language tracks for one video just to give you an idea.

You can also combine them using FF-MPEG and mix them there before you send it to Wowza as you can see described in this post:

> [@live stream with multiple audio language](http://community.wowza.com/t/live-stream-with-multiple-audio-language/34343/4):
>
> You can do it with FFMPEG outside of Wowza – just combine separate video and audio streams into one new stream for each language you want: [Wowza multiple Live audio with video streaming.](http://community.wowza.com/t/-/35752) You may also be able to use FFMPEG to combine your video stream and multiple audio streams into one single MPEG-TS stream, then just select different audio tracks for playback with different “.stream” files in Wowza (as described in wifisolution’s second link above). I have not tried this method, though. Inst…

One last option for you in addition to the AVmix module is you can have the player select the audio track from a SMIL file. Not sure what your use case is, but I’ll share this in case it’s helpful:

> **[Use alternative audio and video tracks with Apple HLS](https://www.wowza.com/docs/how-to-use-alternative-audio-or-video-tracks-with-apple-hls-streams)**
>
> Use custom SMIL files in Wowza Streaming Engine to enable alternative audio and video tracks in Apple HLS streams.

---

<div class="post-metadata">

**Author:** ![Li\_Meng1](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@Li\_Meng1](https://community.wowza.com/u/Li_Meng1)\
**Post date:** [July 12, 2021, 6:06am UTC](https://community.wowza.com/t/mix-rtmp-and-mpegts-audios-and-output-hls/93487/5 "2021-07-12T06:06:14Z")

</div>

Thank you for your reply, but i still can’t find how to mix more audio tracks into one stream. I wll try to find some other solution, thanks a lot.

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [July 12, 2021, 6:28pm UTC](https://community.wowza.com/t/mix-rtmp-and-mpegts-audios-and-output-hls/93487/6 "2021-07-12T18:28:32Z")

</div>

Ok, well if you want, you can submit a support ticket and have a Wowza engineer work with you to get this set up. It’s a very common use case, but we do get a fair amount of tickets asking how to configure it so know we are here to help! You can use the AV mix module or you can build a SMIL file which references the different audio tracks for one video.

Just let us know if we can help in a ticket. Good luck to you @Li_Meng1
