# Combining Multiple Live streams to one

**URL:** <https://community.wowza.com/t/combining-multiple-live-streams-to-one/43644>\
**Category:** Hire a Consultant\
**Created:** [September 22, 2014, 1:19pm UTC](https://community.wowza.com/t/combining-multiple-live-streams-to-one/43644 "2014-09-22T13:19:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaurav\_Mishra1](https://avatars.discourse-cdn.com/v4/letter/g/9de053/32.png) [@Gaurav\_Mishra1](https://community.wowza.com/u/Gaurav_Mishra1)\
**Post date:** [September 22, 2014, 1:19pm UTC](https://community.wowza.com/t/combining-multiple-live-streams-to-one/43644/1 "2014-09-22T13:19:42Z")

</div>

Hi,

I have a requirement of combining multiple live streams into one (assume a layout where 4 live streams are present and every stream is occupying 25% of screen) . The resultant stream should be again published back to wowza (which can be broadcasted.) I want a solution which is fully automated and can fit well with wowza workflow. The streams mentioned above have both audio and video .

I am currently exploring xuggler(api on top of ffmpeg) which looks promising but havnt had much success with writing working code . I need someone who can help me with xuggler modules. if there are better solutions than xuggler then i am ok with that too.

-Gaurav

---

<div class="post-metadata">

**Author:** ![Paul\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/paul_shields/32/390_2.png) [@Paul\_Shields](https://community.wowza.com/u/Paul_Shields)\
**Post date:** [September 22, 2014, 12:43pm UTC](https://community.wowza.com/t/combining-multiple-live-streams-to-one/43644/2 "2014-09-22T12:43:20Z")

</div>

Hi,

I’ve removed the replies from the consultants as it resulted in a sparring match between them which was not constructive at all for the original poster. Romano, please keep your replies professional and to the point and don’t engage in banter with other consultants when it comes to addressing the initial question. By all means reply again but please do stick to the question in hand.

Kind regards,

Paul

---

<div class="post-metadata">

**Author:** ![Roman\_Shmelev](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@Roman\_Shmelev](https://community.wowza.com/u/Roman_Shmelev)\
**Post date:** [September 27, 2014, 9:15am UTC](https://community.wowza.com/t/combining-multiple-live-streams-to-one/43644/3 "2014-09-27T09:15:45Z")

</div>

This is why special solution is needed to achieve stable overlays with reconnection functionality and so on 🙂

So if someone will need this special tool, please ping me here: rshmelev@gmail.com

---

<div class="post-metadata">

**Author:** ![Gaurav\_Mishra1](https://avatars.discourse-cdn.com/v4/letter/g/9de053/32.png) [@Gaurav\_Mishra1](https://community.wowza.com/u/Gaurav_Mishra1)\
**Post date:** [September 26, 2014, 10:49am UTC](https://community.wowza.com/t/combining-multiple-live-streams-to-one/43644/4 "2014-09-26T10:49:49Z")

</div>

from command line i was able to do it using ffmpeg. thanks to a tutorial - [https://trac.ffmpeg.org/wiki/Create%20a%20mosaic%20out%20of%20several%20input%20videos](https://trac.ffmpeg.org/wiki/Create%20a%20mosaic%20out%20of%20several%20input%20videos)

but from command line i cannot put in retry logics for input streams. ie if one of the incoming streams gets dropped for sometime, the ffmpeg command continues to show that stream as dropped till i restart the command. Thats why i was trying to make xuggler work so that i can monitor the incoming streams from code and reconnect in case some stream drops for sometime. Do you think this is possible just from a ffmpeg command ?

---

<div class="post-metadata">

**Author:** ![Emre\_Karatasoglu\_Adv](https://avatars.discourse-cdn.com/v4/letter/e/0ea827/32.png) [@Emre\_Karatasoglu\_Adv](https://community.wowza.com/u/Emre_Karatasoglu_Adv)\
**Post date:** [September 25, 2014, 11:51pm UTC](https://community.wowza.com/t/combining-multiple-live-streams-to-one/43644/5 "2014-09-25T23:51:53Z")

</div>

Hi Gaurav ,here is the person you are looking for , trust me 🙂 about 2 years ago I was close to lose my mind about this topic 🙂

If I’m not mistaken xuggler use ffmpeg library , the only difference is you can use java .

I searched all the way , join the mail group etc etc etc , finally I found a way that merging two stream with ffmpeg .

> ffmpeg -i rtmp://localhost/cam/1 -vf “[in] scale=iw/2:ih/2, pad=2\*iw:ih [left]; scale=iw/4:ih/4  
> ; [left]  
> overlay=main\_w/2:0 [out]” -b:v 768k output.

but two streams not enough for me , I tried to make it dynamically and wanna stream 4 to 16 ip camera as 1 stream .

I guess you try to do something similar.

You need to use ffmpeg filter or third party tool . Further more information please contact to me

Kind Regards,

Emre Karatasoglu

emre.karatasoglu@hotmail.com

**LetheaSoftware**

[http://letheasoftware.com](http://letheasoftware.com)

[http://emrekaratasoglu.com](http://letheasoftware.com)

---

<div class="post-metadata">

**Author:** ![Emre\_Karatasoglu\_Adv](https://avatars.discourse-cdn.com/v4/letter/e/0ea827/32.png) [@Emre\_Karatasoglu\_Adv](https://community.wowza.com/u/Emre_Karatasoglu_Adv)\
**Post date:** [September 26, 2014, 7:56am UTC](https://community.wowza.com/t/combining-multiple-live-streams-to-one/43644/6 "2014-09-26T07:56:30Z")

</div>

Hello Gaurav, for a single stream I can do a retry logic , but actually I didn’t tested yet while combining stream. Only you can block the stream stop by shortest=0

> @echo off
> 
> title receiver
> 
> call:emreFunc12
> 
> echo.&pause&goto:eof
> 
> :emreFunc12
> 
> cd c:/ffmpeg/bin
> 
> ffmpeg.exe -i “rtp://192.168.100.100:1236” bla bla bla -f flv rtmp://192.168.100.100/live?doPublish=1kLasKoqpCzxvB/receiverTv
> 
> ping -n 5 127.0.0.1
> 
> echo ping attim bitti
> 
> call:emreFunc12
> 
> goto:eof

I tried to use the same way like you , I walked the way that you are walking now , none of them actually cant solve my problem cause I wanna change the view dynamically , so I found a cheaper solution like tv channel combine programme .

Here is my question about two years ago 🙂

[http://stackoverflow.com/questions/12383753/how-to-create-mosaic-with-live-stream-with-ffmpeg-or-with-xuggle](http://stackoverflow.com/questions/12383753/how-to-create-mosaic-with-live-stream-with-ffmpeg-or-with-xuggle).

Kind Regards,

Emre Karatasoglu

emre.karatasoglu@hotmail.com

**LetheaSoftware**

[http://letheasoftware.com](http://letheasoftware.com)

[http://emrekaratasoglu.com](http://letheasoftware.com)
