Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • That indeed doesn't throw the error (thanks!), but the output has scaled the bottom video so that the height is stretched to match the top video. I'd like the bottom video to be the same aspect ratio it started with. Is there a simple modification to get that to work?
    – pts2
    Commented Jun 22, 2018 at 17:46
  • Use edited cmd with a recent version of ffmpeg
    – Gyan
    Commented Jun 22, 2018 at 17:51
  • In case it helps anyone in the future, I also wanted to add the audio from the top video (video1.mp4) and put it in the combined output.mp4 (the bottom video video2.mp4 has no audio). This code worked to do all of this: ffmpeg -i video1.mp4 -i video2.mp4 -filter_complex '[1][0]scale2ref=iw:ow/mdar[2nd][ref];[ref][2nd]vstack[vid];anullsrc[silent];[0:a][silent]amerge=inputs=2[a]' -map [vid] -map [a] -c:v libx264 -crf 23 -preset veryfast output.mp4
    – pts2
    Commented Jun 22, 2018 at 18:02
  • You can skip the audio filters and just do -map 0:a
    – Gyan
    Commented Jun 22, 2018 at 18:07