videocommand-linevlcvideo-editingavisynth

Command Line Video Tool for mosaic video output


I'm looking for a command line video tool running on linux, which is scriptable, and it can give an output video with mosaic videos inside. The problem is, that the mosaic videos have to change inside the output. Imagine a 4*4 mosaic video, but there are more input videos than 16, so for example every 10 seconds I have to change a tile in the mosaic to another video.

I've found the command line VLC tool and avisynth which can generate mosaic output, but as I see they don't support the changing videos described above.

Does someone know other options?

Thanks in advance!


Solution

  • AviSynth can join videos, hence you can change a video source at any time in the script.

    For instance, in the following sample, the top left video of the four inputs will change to a different video after 6 seconds:

    v11 = AviSource("SomeSampleVideo.avi", false). \
      Crop(0, 0, 320, 240).AssumeFPS(25).ConvertToRGB32.Trim(0, 150).FadeOut(25, $FF0000)
    
    v12 = AviSource("AnotherSampleVideo.avi", false). \
      Crop(40, 10, 320, 240).AssumeFPS(25).ConvertToRGB32.FadeIn(25, $FF0000)
    
    v1 = v11 + v12
    
    v2 = ImageReader("SomeSampleBitmap.bmp").Crop(20, 10, 320, 240).ConvertToRGB32
    v3 = AviSource("YetAnotherVideo.avi", false).Crop(30, 30, 320, 240).ConvertToRGB32
    v4 = v1.Subtract(v2)
    
    return StackVertical(StackHorizontal(v1, v2), StackHorizontal(v3, v4))
    


    It is possible that I have misunderstood the requirements though..