Creating a 2×2 Security Camera Matrix using FFmpeg

https://youtu.be/Xr1XTl0cAAE

FFmpeg Playlist: https://www.youtube.com/playlist?list=PLErU2HjQZ_ZOPDZ71Khzt5PX4X4j6flkg

Amcrest Playlist: https://www.youtube.com/playlist?list=PLErU2HjQZ_ZNYE224qh9K0hhaaIxU-rta

Set Video Sources as Shell Variables
VID_TL_CAMERA1="rtsp://user:password@ip_address:554/cam/realmonitor?channel=1&subtype=1"
VID_TR_CAMERA2="rtsp://user:password@ip_address:554/cam/realmonitor?channel=1&subtype=1"
VID_BL_CAMERA3="rtsp://user:password@ip_address:554/cam/realmonitor?channel=1&subtype=1"
VID_BR_CAMERA4="rtsp://user:password@ip_address:554/cam/realmonitor?channel=1&subtype=1"
Create 2×2 Video Matrix
ffmpeg -i $VID_TL_CAMERA1 -i $VID_TR_CAMERA2 -i $VID_BL_CAMERA3 -i $VID_BR_CAMERA4 -reorder_queue_size 4000 -max_delay 10000000 -filter_complex "[0:v][1:v]hstack[t];[2:v][3:v]hstack[b];[t][b]vstack[v]" -map "[v]" -f h264 -vcodec libx264 -b:v 2500k pipe:1|ffplay -i pipe:0
Create Side by Side Video Matrix
ffmpeg -i $VID_TL_CAMERA1 -i $VID_TR_CAMERA2 -reorder_queue_size 4000 -max_delay 10000000 -filter_complex "[0:v][1:v]hstack[v]" -map "[v]" -f h264 -vcodec libx264 -b:v 2500k pipe:1|ffplay -i pipe:0

Leave a comment

Your email address will not be published. Required fields are marked *