We need someone to create a command-line script using ffmpeg and other open-source libraries (possibly libavfilter) to create a video showing multiple videos in mosaic. The script should grab 1 to 8 existing video files and from them create a video which first loops each video for 2 seconds, and then shows a mosaic of all videos together.
More specifically, suppose that we have N videos (where N is 1 to 8) and there's a short interval of time named X seconds (X could be 2, 3, 5, whatever).
The output video should be:
0:00 to 0:00 + X : video 1
0:00 + X to 0:00 + X*2 : video 2
0:00 + X*(N-1) to 0:00 + X*N : video N
0:00 + X*N to 0:00 + X*n : mosaic of all N videos playing together.
This loop should be repeated until the end of the videos. All the source videos have the same length. There's no need to pay attention to sound since that's mixed separately.