So far we have done

We have a video chat client which has a set of 9 video streams (users) with h.264 codec using Adobe FMS. Now, using ffmpeg we are able to combine these streams into one stream using the overlay (video) and amix (audio) filters. We are able to send the single combined stream to a live streaming service. The stream of the active speaker is shown in a bigger size using the scale property of ffmpeg.

Code as follows:

CODE: SELECT ALL
ffmpeg -i "rtmp://localhost/live/mystream" -i "rtmp://localhost/live/mystream2 " -i "rtmp://localhost/live/mystream3 "-filter_complex"nullsrc=size=300x300 [b1];[0:v] setpts=PTS-STARTPTS,scale=100x100 [s1];[1:v] setpts=PTS-STARTPTS,scale=200x200 [s2];[2:v]setpts=PTS-STARTPTS,scale=100x100 [s3];[b1][s1] overlay=shortest=1 [b1+s1];[b1+s1][s2] overlay=shortest=1 [b1+s2];
[b1+s2][s3] overlay=shortest=1:x=100" out.mp4


Help Needed in the following 2 major issues. Any help would be appreciated.

Whenever the active speaker changes, the stream of that user should be shown in a bigger size. is this possible to do without restarting the ffmpeg process?

Right now, if one of the 9 streams stops, the ffmpeg process crashes.