Changes between Version 1 and Version 2 of Create a mosaic out of several input videos using xstack


Ignore:
Timestamp:
Oct 8, 2019, 8:15:40 PM (6 weeks ago)
Author:
jpb
Comment:

adjust image sizes for all images

Legend:

Unmodified
Added
Removed
Modified
  • Create a mosaic out of several input videos using xstack

    v1 v2  
    66FFmpeg provides more than one mechanism to create a video mosaic.  In addition to using the ''overlay'' filter shown in  [[Create a mosaic out of several input videos]], you can use the [http://ffmpeg.org/ffmpeg-all.html#xstack xstack] filter.  [http://ffmpeg.org/ffmpeg-all.html#xstack xstack] takes the individual inputs along with a custom layout that you create, and positions the videos according to the layout.  Here's an example:
    77
    8 [[Image(col_2x2.png, title=Figure 1)]]
     8[[Image(col_2x2.png, title=Figure 1, width=320, height=240)]]
    99
    1010
     
    5858When there are more than two images in a sequence (either vertical or horizontal), it becomes necessary to add widths or heights together.  So for example, for a single vertical sequence of three videos in '''Column Major Order''':
    5959
    60 [[Image(col_1x3.png, title=Figure 3)]]
     60[[Image(col_1x3.png, title=Figure 3, width=180, height=320)]]
    6161
    6262the layout would be '''layout=0_0|0_h0|0_h0+h1'''.  The X coordinate for all videos is the same - '''0''', whereas the Y coordinate changes.  For the first stream it is '''0''', then '''h0''', then '''h0+h1''' - the addition of height h0 and h1.  For a horizontal sequence it would be similar with identical Y coordinates and X coordinates of '''0''', '''w0''', and '''w0+w1'''.
     
    6464'''Row Major Order''' is similar, with values juxtaposed to appropriate points of origin.  Figure 4 shows a 3x3 matrix (nine video streams), and Figure 5 shows a 6x6 matrix (36 video streams).  Note how in these examples the output is now piped directly to '''ffplay'''.  (Be aware that higher video counts can result in higher than normal CPU load.)
    6565
    66 [[Image(row_3x3.png, title=Figure 4)]]
     66[[Image(row_3x3.png, title=Figure 4, width=320, height=240)]]
    6767
    6868The complete command for this example ('''Row Major Order''') is
     
    9595
    9696
    97 [[Image(row_6x6.png, title=Figure 5)]]
     97[[Image(row_6x6.png, title=Figure 5, width=640, height=480)]]
    9898
    9999For higher density mosaics, you should probably scale down all inputs.  This example scaled each video to qqvga (160x120).   
     
    194194= Matrix Madness! =
    195195
    196 [[Image(row_12x12.png)]]
    197 
    198 
    199 
    200 
     196[[Image(row_12x12.png, width=1024, height=640)]]
     197
     198
     199
     200