Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Wessiez opened this issue Nov 7, 2024 · 0 comments
Open

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

Wessiez opened this issue Nov 7, 2024 · 0 comments

Comments

@Wessiez
Copy link

Wessiez commented Nov 7, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant