[FFmpeg-user] merge quad layout in one run

Füreder Peter Peter.Fuereder at vetmeduni.ac.at
Fri Oct 5 11:36:19 CEST 2012


hi

i have a question regarding overlays

i record from 4 axis network cameras the following way

ffmpeg -f rtsp -i 'rtsp://<user>:<password>@<your cam ip>:554/axis-media/media.amp?udp' -vcodec copy -acodec copy -aspect 16:9 -s 1280x720 -ar 16000 -ab 64000 -y 'cam1.mp4' &

ffmpeg -f rtsp -i 'rtsp://<user>:<password>@<your cam ip>:554/axis-media/media.amp?udp' -vcodec copy -acodec copy -aspect 16:9 -s 1280x720 -ar 16000 -ab 64000 -y 'cam2.mp4' &

ffmpeg -f rtsp -i 'rtsp://<user>:<password>@<your cam ip>:554/axis-media/media.amp?udp' -vcodec copy -acodec copy -aspect 16:9 -s 1280x720 -ar 16000 -ab 64000 -y 'cam3.mp4' &

ffmpeg -f rtsp -i 'rtsp://<user>:<password>@<your cam ip>:554/axis-media/media.amp?udp' -vcodec copy -acodec copy -aspect 16:9 -s 1280x720 -ar 16000 -ab 64000 -y 'cam4.mp4' &


After that i merge em into a quad layout with 3 steps

ffmpeg -i cam1.mp4 -vf "movie=cam2.mp4 [in1]; [in]pad=1280*2:720[in0]; [in0][in1] overlay=1280:0 [out]" -ar 16000 -ab 64000 -y out1.mp4
ffmpeg -i cam3.mp4 -vf "movie=cam4.mp4 [in1]; [in]pad=1280*2:720[in0]; [in0][in1] overlay=1280:0 [out]" -ar 16000 -ab 64000 -y out2.mp4
ffmpeg -i out1.mp4 -vf "movie=out2.mp4 [in1]; [in]pad=1280*2:720*2[in0]; [in0][in1] overlay=0:720 [out]" -ar 16000 -ab 64000 -y out-merged.mp4

i tried to put the overlay merge into one command line but i failed horribly
has anyone done this before or has an idea how to make a quad layout in one run ?

thx

wfg
     peter füreder



More information about the ffmpeg-user mailing list