metalx1000

MPV Video Grid Multiple Cameras

Jun 14th, 2024 (edited)
1,259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.59 KB | None | 0 0
  1. # Plays 4 videos in a 2x2 grid with audio of all 4 videos
  2. mpv video_01.mp4 --external-file=video_02.mp4 --external-file=video_03.mp4 --external-file=video_04.mp4 --lavfi-complex='[vid1] [vid2] hstack [t1] ; [vid3] [vid4] hstack [t2] ; [t1] [t2] vstack [vo];[aid1][aid2][aid3][aid4]amix=inputs=4[ao]'
  3.  
  4. # Play 2 videos of different resolutions
  5. cam_01="rtsp://thingino:thingino@camera-01:554/ch0"
  6. cam_02="http://192.168.1.150:8081"
  7.  
  8. scale="1280:720"
  9.  
  10. mpv --lavfi-complex="[vid1]scale=${scale}[scaled1];[vid2]scale=${scale}[scaled2];[scaled1][scaled2]hstack[vo];" "$cam_01" --external-file="$cam_02"
  11.  
Advertisement
Add Comment
Please, Sign In to add comment