How to merge four videos on one screen with ffmpeg -


this question has answer here:

i have video test.mp4, , need make appear 4 times @ once on screen. here found command makes 2 videos appear @ time

ffmpeg -i input0.avi -vf "movie=input1.avi [in1]; [in]pad=640*2:352[in0]; [in0][in1] overlay=640:0 [out]" out.avi 

but doesn't work mp4 videos, , need 4 videos @ time. thank in advance

four different inputs

enter image description here

ffmpeg -i input0 -i input1 -i input2 -i input3 -filter_complex \ "[0:v][1:v]hstack[top]; \  [2:v][3:v]hstack[bottom]; \  [top][bottom]vstack,format=yuv420p[v]; \  [0:a][1:a][2:a][3:a]amerge=inputs=4[a]" \ -map "[v]" -map "[a]" -ac 2 output.mp4 

two hstack instances make top , bottom, vstack combines those. amerge combines audio streams, -ac 2 downmixes them stereo.

same input

enter image description here

ffmpeg -i input \ -filter_complex "[0:v][0:v]hstack,split[top][bottom];[top][bottom]vstack,format=yuv420p[v]" \ -map "[v]" -map 0:a output.mp4 

note

you did not provide info inputs or ffmpeg build assumptions made , commands may not work you. commands assume of inputs have same width, height, frame rate, number of audio channels, audio sample rate, etc, , using recent ffmpeg.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -