Skip to content

Can ffmpeg-Python make a mosaic with direct output #865

Open
@Wessiez

Description

My Project:
A camera makes a 15 second video and puts them in a directory.
I want to take the video's and make a mosaic of them to show the people beeing filmed.
The code used is:

ffmpeg \
   -i videos/01.mp4 \
   -i videos/02.mp4 \
   -i videos/03.mp4 \
   -i videos/04.mp4 \
   -i videos/05.mp4 \
   -i videos/06.mp4 \
   -i videos/07.mp4 \
   -i videos/08.mp4 \
   -i videos/09.mp4 \
  -filter_complex " \
      [0:v] setpts=PTS-STARTPTS, scale=qvga [a0]; \
      [1:v] setpts=PTS-STARTPTS, scale=qvga [a1]; \
      [2:v] setpts=PTS-STARTPTS, scale=qvga [a2]; \
      [3:v] setpts=PTS-STARTPTS, scale=qvga [a3]; \
      [4:v] setpts=PTS-STARTPTS, scale=qvga [a4]; \
      [5:v] setpts=PTS-STARTPTS, scale=qvga [a5]; \
      [6:v] setpts=PTS-STARTPTS, scale=qvga [a6]; \
      [7:v] setpts=PTS-STARTPTS, scale=qvga [a7]; \
      [8:v] setpts=PTS-STARTPTS, scale=qvga [a8]; \
      [a0][a1][a2][a3][a4][a5][a6][a7][a8]xstack=inputs=9:layout=0_0|w0_0|w0+w1_0|0_h0|w0_h0|w0+w1_h0|0_h0+h1|w0_h0+h1|w0+w1_h0+h1[out]"
-preset ultrafast -f matroska - | ffplay -fs -

But how to get this in a python script?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions