How To create mosaic with live stream with ffmpeg ( or with xuggle )

10,302

Solution 1

You could read this FFmpeg tutorial and try using live inputs instead of file inputs, to achieve what you want. Also, I think you'll want to use shortest=0 to avoid having your stream stopped if one of your live inputs becomes unavailable.

Solution 2

FAQ for ffmpeg includes instructions for concatenation of video. Pay close attention to instructions in section 3.14.3 because if you understand how to demux audio from video and to then convert each track to raw stream, the streams can simply be concatenated.

Share:
10,302
Emre Karataşoğlu
Author by

Emre Karataşoğlu

Php ,net core, mysql,mssql, ajax , javascript , jquery , html , css , java , ffmpeg , c# , mssql, webrtc, sip, angularjs

Updated on June 04, 2022

Comments

  • Emre Karataşoğlu
    Emre Karataşoğlu almost 2 years

    For a thousand minutes I try to find a way that stream multiple video and combine them into a one output . I wanna do that with ffmpeg or xuggler with ffmpeg cmd. VirtualDub and avis couldn't meet my needs. Actually I couldn't find a way stream in avis . I can only make 4 8 16 videos in a screen on virtualdub but they are local videos and not my issue .

    >cd c:\f\bin 
    

    ffmpeg -i rtmp://localhost/live/me -vf "[in] scale=iw/2:ih/2, pad=2*iw:ih [left]; movie=other stream, scale=iw/4:ih/4 [right]; [left][right] overlay=main_w/2:0 [out]" -b:v 768k output

    anyway join two stream side by side , but I want more . Is it possible with ffmpeg ? Also I cant use the program like spycam ,vlc etc . Don't say to me vlc , console vlc can easily do it .

  • Emre Karataşoğlu
    Emre Karataşoğlu over 11 years
    I just try to show them at the same time . start at the same time , not first one finish and the second one start .my aim is for example 4x4 videos like a security provider company's program. But there is no camera , only different streams . I 'm reading the concatenate a few min later I'll try it . Unfortunetely What I see that it makes video pipe to me . And I'm getting to be far away from ffmpeg , Its very hard to do it with ffmpeg .
  • Dr.jacky
    Dr.jacky over 8 years
    And is that possible to output it as live? Means live inputs and live output; such as RTP for example
  • Emre Karataşoğlu
    Emre Karataşoğlu over 8 years
    Yes you can use live input and publish it to the rtmp server . I was using this for security cam .
  • Mladen B.
    Mladen B. almost 8 years
    What you could do is to put several streams into one transport (mux) and demux it on the viewer's side and create the mosaic.