1

trying to create a 4x2 grid from 8 videos using the terminal on a mac. The code I am using is not working:

ffmpeg -i input0.mov -i input1.mov -i input2.mov -i input3.mov -i input4.mov -i input5.mov -i input6.mov -i input7.mov -filter_complex "[0:v][1:v][2:v][3:v] [4:v] [5:v][6:v][7:v] xstack=inputs=8:layout=0_0|0_h0|w0_0|w0_h0|w0+w1_0|w0+w1_h0|w0+w1+w2_0|w0+w1+w2_h0[v]” -map "[v]" 4x2grid.mp4
Any ideas? I'm using ffmpeg version 4.3.1. And the error message is:
dquote>
Not sure why this is. I am relatively new to ffmpeg but can successfully create a 3x2 grid using the following code without the same message:
ffmpeg -i input0.mov -i input1.mov -i input2.mov -i input3.mov -i input4.mov -i input5.mov -filter_complex "[0:v][1:v][2:v][3:v] [4:v] [5:v] xstack=inputs=6:layout=0_0|w0_0|0_h0|w0_h0|w0+w3_0|w0+w3_h0[v]" -map "[v]" 3x2grid.mp4
I have also tried various other possibilities including the following code but with the same result:
ffmpeg -i input0.mov -i input1.mov -i input2.mov -i input3.mov -i input4.mov -i input5.mov -i input6.mov -i input7.mov -filter_complex "[0:v][1:v][2:v][3:v][4:v][5:v][6:v][7:v] xstack=inputs=8:layout=0_0|w0_0|0_h0|w0_h0|w0+w3_0|w0+w3_h0|w0+w3+w4_0|w0+w3+w4_h0[v]” -map "[v]" 4x2grid.mp4
Although I have tried to read the explanation here:
http://ffmpeg.org/ffmpeg-all.html#xstack
I am not sure I fully understand how to specify the desired layout configuration.

6
  • What ffmpeg version? What is actual error? What is ffmpeg command output?
    – user12174
    Aug 11, 2020 at 8:26
  • Hi, thanks for your response. I've tried to answer your questions and added a greater explanation of the problem and the solutions I've tried. Hope it's clearer. I'm not sure what you mean by ffmpeg command output? Do you mean desired output. If so that is outputting the finished video as an .mp4
    – Ben Hardy
    Aug 12, 2020 at 3:33
  • Still missing error message output of ffmpeg.
    – user12174
    Aug 12, 2020 at 18:49
  • @Paul Thanks for your response. Not sure how I find the error message output of ffmpeg? When I try the code discussed above using terminal in Mac OS 10.14.6 I receive the message "dquote" which I gather means I've executed a line of code with only one double-quote character. However as I mention I can create a 3x2 grid using a similar format: ffmpeg -i input0.mov -i input1.mov -i input2.mov -i input3.mov -i input4.mov -i input5.mov -filter_complex "[0:v][1:v][2:v][3:v] [4:v] [5:v] xstack=inputs=6:layout=0_0|w0_0|0_h0|w0_h0|w0+w3_0|w0+w3_h0[v]" -map "[v]" 3x2grid.mp4
    – Ben Hardy
    Aug 13, 2020 at 6:12
  • Please consult wiki page for xstack filter on trac.ffmpeg.org, your all inputs must have same size and that probably is erroring out that you ignore.
    – user12174
    Aug 13, 2020 at 10:04

1 Answer 1

0

I have tried it on the colab, plz check if https://colab.research.google.com/gist/xer-rex/90c426cd7dbdfd4ec3330a7c3b46f98f/sidebyside.ipynb helps?

4
  • Many thanks for your suggestion which looks very interesting. Unfortunately I have no knowledge of Python and can only use ffmpeg using the terminal
    – Ben Hardy
    Aug 12, 2020 at 3:35
  • My suggestion on colab has nothing to do with Python, i treat it as a Linux terminal, as you see i did !ffmpeg with exclamation mark at front, i can do !ls, !cp, !rm, ...
    – xer-rex
    Aug 12, 2020 at 23:12
  • thanks for your response. Sorry, this is a big learning curve! I tried your code substituting my video files and starting with "ffmpeg" not "iffmpeg" but received this message: At least one output file must be specified zsh: command not found: -filter_complex I assume there will be many formatting issues because I am using ffmpeg on a mac terminal?
    – Ben Hardy
    Aug 13, 2020 at 6:59
  • I think it's just the matter of ffmpeg version on colab it uses ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
    – xer-rex
    Aug 13, 2020 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.