Use ffmpeg to create a split screen video out of 5 videos- 4 videos in landscape one in portrait I'm trying to create a series of split screen videos for students to work on remotely using ffmpeg. I need to create an ffmpeg split screen "template" for 5 videos, 1 in portrait and the other 4 in landscape. 
All the videos have the same resolution: 1280x720. One is 720x1280 (portrait) and the other 4 are 1280 x 720 (landscape)
I want to create a split screen of dimensions 1680x720 out of the 5 videos so the portrait video is 400x720 and the 4 landscape videos as 640x360. 
How do I modify this 2x2 grid ffmpeg code to allow this?:

ffmpeg -i input0.mp4 -i input1.mp4 -i input2.mp4 -i input3.mp4 -filter_complex "[0:v][1:v][2:v][3:v]xstack=inputs=4:layout=0_0|w0_0|0_h0|w0_h0[v]" -map "[v]" output.mp4
Assuming you want a layout of:

0 1 2
0 3 4


Command is:

ffmpeg -i input0.mp4 -i input1.mp4 -i input2.mp4 -i input3.mp4 -i input4.mp4 -filter_complex "[0]scale=-1:720[v0];[1]scale=-1:360[v1];[2]scale=-1:360[v2];[3]scale=-1:360[v3];[4]scale=-1:360[v4];[v0][v1][v2][v3][v4]xstack=inputs=5:layout=0_0|w0_0|w0+w1_0|w0_h1|w0+w1_h1[v]" -map "[v]" output.mp4