Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ######################################################################
- #Copyright (C) 2025 Kris Occhipinti
- #https://filmsbykris.com
- #This program is free software: you can redistribute it and/or modify
- #it under the terms of the GNU General Public License as published by
- #the Free Software Foundation version 3 of the License.
- #This program is distributed in the hope that it will be useful,
- #but WITHOUT ANY WARRANTY; without even the implied warranty of
- #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- #GNU General Public License for more details.
- #You should have received a copy of the GNU General Public License
- #along with this program. If not, see <http://www.gnu.org/licenses/>.
- ######################################################################
- # Stream a grid of videos from cameras
- #channel 1 is a lower resolution on thingino over channel 0
- # this is better for streaming multiple cameras
- cam_01="rtsp://thingino:thingino@camera-01:554/ch1"
- cam_02="rtsp://thingino:thingino@camera-02:554/ch1"
- cam_03="rtsp://thingino:thingino@camera-03:554/ch1"
- # I only have 3 cameras so create black video to fill last spot
- # Create a black video source
- black="color=c=black:s=640x360" # adjust resolution to match other videos
- top_row="[0:v][1:v]hstack=inputs=2[top];"
- bottom_row="[2:v][3:v]hstack=inputs=2[bottom];"
- stack="[top][bottom]vstack=inputs=2[v]"
- ffmpeg -i "$cam_01" -i "$cam_02" -i "$cam_03" -f lavfi -i "$black" \
- -filter_complex "${top_row}${bottom_row}${stack}" \
- -map "[v]" -c:v libx264 -f nut - | ffplay -i -
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement