FFMPEG 9600x1080 5 video stitching outputs black video Hello everyone. I’m trying to merge 5 1920x1080 videos into a one big 9600x1080 clip. I’m using FFMPEG for it with the following script:

ffmpeg -i 1.avi -i 2.avi -i 3.avi -i 4.avi -i 5.avi -filter_complex "[1:v][0:v]scale2ref=oh*mdar:ih[1v][0v];[2:v][0v]scale2ref=oh*mdar:ih[2v][0v];[3:v][0v]scale2ref=oh*mdar:ih[3v][0v];[4:v][0v]scale2ref=oh*mdar:ih[4v][0v];[0v][1v][2v][3v][4v]hstack=5,scale='2*trunc(iw/2)':'2*trunc(ih/2)'" 5vid_final.mp4

I’ve also tried a simpler method:

ffmpeg -i 1.avi -i 2.avi -i 3.avi -i 4.avi -i 5.avi   -filter_complex hstack=inputs=5 s5.mp4

they both seem to work, but the problem is that when I play these files I get a black screen. I’ve tried stitching 4 videos (using the same commands as above) and I get propper playback, but when I add additional input, the output file is black during playback. Video details claim that the resolution is as it should be (9600x1080) which leads me to believe that it may not be FFMPEG’s fault? Or maybe it is?

I don’t even know how to check what’s causing the problem. Maybe someone has a verified 9600x1080 sample video or know where I could get one to try and play it locally? I would be grateful for any assistance you could spare.

Best regards RafałT

p.s. I could try and post my vid and maybe someone could check if it's viewable? If someone would like to help, I could post it somewhere online.

  • That resolution is above H.264 level limits. ffplay should still play it. Maybe VLC too
    – Gyan
    Jun 2, 2021 at 12:38
  • You dear Sir are a FREAKIN' genius! Thank you soooo much! I’ve tied using ffplay and it worked! I’m so happy. Thnak you again! Topic closed.
    – RafalT
    Jun 2, 2021 at 13:07

2 Answers 2


Thanks to @Gyan I was able to solve my problem. Guess VLC isn't natively able to support such resolutions. Maybe there's an option somewhere to do it, but ffplay works out-of-the-box so I won't be pursuing other routes. Topic closed. Thank you again @Gyan


This is likely not the fault of ffmpeg or VLC, but the specified resolution is above H.264 limits, as Gyan says in the comment. H.264 Max Resolution says the max resolution would be 9437184 luma sample rate (samples per frame), and while your resolution of four videos is 7680x1080 = 8294400, five videos is 9600x1080 = 10368000 which is above the limit. That is a huge resolution that may be supported by some decoders but is technically invalid.

If you really need such huge videos, look into HEVC, which at the max level supports up to 4278190080 luma sample rate.

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.