1

I was wondering is possible to from 1 video i copy 3 more, then rotate them all by 90 degrees, then move they center with ffmpeg commands? To be clearer what im saying here is picuture what i want to to do: enter image description here

  • Can you illustrate the rotation aspect and then describe what kind of movement you would like? – Gyan Mar 28 '16 at 6:15
  • @Mulvya first, i want to rotate all 3 videos for 120 degrees, so 1 video will be at 0 degrees, another at 120, another at 270, and last at 360 but that is same as 0 degrees, so when they all are rotated like that, i want to move them, like in the picture to get empty cube in middle of screen surrounded by 4 videos. – Vuzimir Samp Mar 28 '16 at 7:40
  • Did you mean 90? The illustration shows orthogonal placement. So, video 1 is 0 degrees, video 2 is 90, video 3 is -90 and video 4 is 0. Is that right? – Gyan Mar 28 '16 at 8:50
  • Yeah 90, and in middle i need to make a white space to be empty... – Vuzimir Samp Mar 29 '16 at 5:28
2

Use

ffmpeg -i video.mp4 \
       -filter_complex "[0:v]split=4[a][b][c][d]; \
                        [a]pad=iw+2*ih:iw+2*ih:ih:0:white[base]; \
                        [b]transpose=cclock[br]; \
                        [c]transpose=clock[cr]; \
                        [base][br]overlay=0:w[two]; \
                        [two][cr]overlay=W-w:w[three]; \
                        [three][d]overlay=h:H-h[v]" \
-map "[v]" out.mp4

As per your confirmation, I haven't rotated the video at the bottom. In case it had to be rotated 180, use

ffmpeg -i video.mp4 \
       -filter_complex "[0:v]split=4[a][b][c][d]; \
                        [a]pad=iw+2*ih:iw+2*ih:ih:0:white[base]; \
                        [b]transpose=cclock[br]; \
                        [c]transpose=clock[cr]; \
                        [d]hflip,vflip[dr]; \ 
                        [base][br]overlay=0:w[two]; \
                        [two][cr]overlay=W-w:w[three]; \
                        [three][dr]overlay=h:H-h[v]" \
-map "[v]" out.mp4

There will be no audio exported with these commands. To preserve audio, insert -map 0:a -c:a copy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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