diff --git a/displaycameras b/displaycameras old mode 100644 new mode 100755 index c8edf5b..8cfd906 --- a/displaycameras +++ b/displaycameras @@ -118,7 +118,17 @@ do x=$((i+$DISPLAY_SEQUENCE)) if [ "$x" -ge "${#camera_names[@]}" ]; then x=$((x-${#camera_names[@]})) fi - player="omxplayer --no-keys --no-osd --avdict rtsp_transport:tcp --win \"${window_positions[$x]}\" \"${camera_feeds[$i]}\" --live -n -1 --timeout "$omx_timeout" --dbus_name "org.mpris.MediaPlayer2.omxplayer.${camera_names[$i]}" >/dev/null &" + if [ ${#camera_crops[@]} -ne 0 ] && [ -n "${camera_crops[$i]}" ] && [ "${camera_crops[$i]}" != "false" ]; then + camera_crop="--crop \"${camera_crops[$i]}\"" + else + camera_crop="" + fi + if [ ${#camera_orientations[@]} -ne 0 ] && [ -n "${camera_orientations[$i]}" ] && [ "${camera_orientations[$i]}" != "0" ]; then + camera_orientation="--orientation \"${camera_orientations[$i]}\"" + else + camera_orientation="" + fi + player="omxplayer --no-keys --no-osd --avdict rtsp_transport:tcp $camera_crop $camera_orientation --win \"${window_positions[$x]}\" \"${camera_feeds[$i]}\" --live -n -1 --timeout "$omx_timeout" --dbus_name "org.mpris.MediaPlayer2.omxplayer.${camera_names[$i]}" >/dev/null &" echo "Starting omxplayer for ${camera_names[$i]}" eval $player sleep $startsleep @@ -220,7 +230,17 @@ do x=$((i+$DISPLAY_SEQUENCE)) if [ "$x" -ge "${#camera_names[@]}" ]; then x=$((x-${#camera_names[@]})) fi - player="omxplayer --no-keys --no-osd --avdict rtsp_transport:tcp --win \"${window_positions[$x]}\" \"${camera_feeds[$i]}\" --live -n -1 --timeout "$omx_timeout" --dbus_name "org.mpris.MediaPlayer2.omxplayer.${camera_names[$i]}" >/dev/null &" + if [ ${#camera_crops[@]} -ne 0 ] && [ -n "${camera_crops[$i]}" ] && [ "${camera_crops[$i]}" != "false" ]; then + camera_crop="--crop \"${camera_crops[$i]}\"" + else + camera_crop="" + fi + if [ ${#camera_orientations[@]} -ne 0 ] && [ -n "${camera_orientations[$i]}" ] && [ "${camera_orientations[$i]}" != "0" ]; then + camera_orientation="--orientation \"${camera_orientations[$i]}\"" + else + camera_orientation="" + fi + player="omxplayer --no-keys --no-osd --avdict rtsp_transport:tcp $camera_crop $camera_orientation --win \"${window_positions[$x]}\" \"${camera_feeds[$i]}\" --live -n -1 --timeout "$omx_timeout" --dbus_name "org.mpris.MediaPlayer2.omxplayer.${camera_names[$i]}" >/dev/null &" echo "Starting omxplayer for ${camera_names[$i]}" eval $player sleep $startsleep diff --git a/example_layouts/layout.conf.1024x600 b/example_layouts/layout.conf.1024x600 index ab6cdaf..47c0c02 100644 --- a/example_layouts/layout.conf.1024x600 +++ b/example_layouts/layout.conf.1024x600 @@ -38,6 +38,13 @@ camera_feeds=( "rtsp://xxx.xxx.xxx.xxx/yyyyy_1" \ ) +camera_orientations=( +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +) + + # Are we rotating cameras through the window matrix? Set this explicitly to # "false" if not desired in this display layout. rotate="true" diff --git a/example_layouts/layout.conf.1280x1028 b/example_layouts/layout.conf.1280x1028 index 59619a8..f7c8ae5 100644 --- a/example_layouts/layout.conf.1280x1028 +++ b/example_layouts/layout.conf.1280x1028 @@ -68,6 +68,16 @@ camera_feeds=( "" \ ) +camera_orientations=( +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +) + # Are we rotating cameras through the window matrix? Set this explicitly to # "false" if not desired in this display layout. rotate="false" diff --git a/example_layouts/layout.conf.1280x720 b/example_layouts/layout.conf.1280x720 index 3abc7e9..2d6a788 100644 --- a/example_layouts/layout.conf.1280x720 +++ b/example_layouts/layout.conf.1280x720 @@ -62,6 +62,16 @@ camera_feeds=( "" \ ) +camera_orientations=( +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +) + # Are we rotating cameras through the window matrix? Set this explicitly to # "false" if not desired in this display layout. rotate="true" diff --git a/example_layouts/layout.conf.1280x768 b/example_layouts/layout.conf.1280x768 index 8365662..889ed3e 100644 --- a/example_layouts/layout.conf.1280x768 +++ b/example_layouts/layout.conf.1280x768 @@ -62,6 +62,16 @@ camera_feeds=( "" \ ) +camera_orientations=( \ +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +) + # Are we rotating cameras through the window matrix? Set this explicitly to # "false" if not desired in this display layout. rotate="true" diff --git a/example_layouts/layout.conf.1280x800 b/example_layouts/layout.conf.1280x800 index 7339663..dc36eb8 100644 --- a/example_layouts/layout.conf.1280x800 +++ b/example_layouts/layout.conf.1280x800 @@ -52,5 +52,14 @@ camera_feeds=( \ "rtsp://example.com:7447/xxxxyyyyyyzzzz" \ ) +camera_orientations=( +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +) + + # Are we rotating cameras through the window matrix? (default false if not set h ere) # rotate="true" diff --git a/example_layouts/layout.conf.1440x900 b/example_layouts/layout.conf.1440x900 index 64dbb09..21d7cd5 100644 --- a/example_layouts/layout.conf.1440x900 +++ b/example_layouts/layout.conf.1440x900 @@ -60,6 +60,16 @@ camera_feeds=( "" \ ) +camera_orientations=( +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +) + # Are we rotating cameras through the window matrix? Set this explicitly to # "false" if not desired in this display layout. rotate="true" diff --git a/example_layouts/layout.conf.1440x900.3x3 b/example_layouts/layout.conf.1440x900.3x3 index 64a77dc..62442dc 100644 --- a/example_layouts/layout.conf.1440x900.3x3 +++ b/example_layouts/layout.conf.1440x900.3x3 @@ -91,5 +91,26 @@ camera_feeds=( \ "" \ ) +camera_orientations=( \ +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +) + + # Are we rotating cameras through the window matrix? (default false if not set here) rotate="true" diff --git a/example_layouts/layout.conf.1920x1080.10on3x3 b/example_layouts/layout.conf.1920x1080.10on3x3 index 3c9a54b..18a131e 100644 --- a/example_layouts/layout.conf.1920x1080.10on3x3 +++ b/example_layouts/layout.conf.1920x1080.10on3x3 @@ -74,5 +74,18 @@ camera_feeds=( \ "" \ ) +camera_orientations=( +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +) + # Are we rotating cameras through the window matrix? (default false if not set here) rotate="true" diff --git a/example_layouts/layout.conf.1920x1080.14mid-res-on-2x2 b/example_layouts/layout.conf.1920x1080.14mid-res-on-2x2 index 88c2ad9..51007b7 100644 --- a/example_layouts/layout.conf.1920x1080.14mid-res-on-2x2 +++ b/example_layouts/layout.conf.1920x1080.14mid-res-on-2x2 @@ -85,6 +85,25 @@ camera_feeds=( \ "" \ ) +camera_orientations=( \ +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +) + + # Are we rotating cameras through the window matrix? (default false if not set here) rotate="true" # Set a quick rotation cycle since we have 10 displays to rotate from off screen (about 1 minute) diff --git a/example_layouts/layout.conf.1920x1080.1x1 b/example_layouts/layout.conf.1920x1080.1x1 index b1ef6e6..219d1e0 100644 --- a/example_layouts/layout.conf.1920x1080.1x1 +++ b/example_layouts/layout.conf.1920x1080.1x1 @@ -53,5 +53,13 @@ camera_feeds=( \ "" \ ) +camera_orientations=( +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +) + # Are we rotating cameras through the window matrix? (default false if not set here) rotate="true" diff --git a/example_layouts/layout.conf.1920x1080.3x3 b/example_layouts/layout.conf.1920x1080.3x3 index 148b59e..8c8b23f 100644 --- a/example_layouts/layout.conf.1920x1080.3x3 +++ b/example_layouts/layout.conf.1920x1080.3x3 @@ -94,5 +94,27 @@ camera_feeds=( \ "" \ ) +camera_orientations=( +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +) + + # Are we rotating cameras through the window matrix? (default false if not set here) rotate="true" diff --git a/example_layouts/layout.conf.1920x1080.4on1x1 b/example_layouts/layout.conf.1920x1080.4on1x1 index 003d19e..61bdf8f 100644 --- a/example_layouts/layout.conf.1920x1080.4on1x1 +++ b/example_layouts/layout.conf.1920x1080.4on1x1 @@ -38,6 +38,15 @@ camera_feeds=( \ "rtsp://xxx.xxx.xxx.xxx:7447/yyyyyyyyy_0" \ ) +camera_orientations=( +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +) + + # Are we rotating cameras through the window matrix? (default false if not set here) rotate="true" rotatedelay=8 diff --git a/example_layouts/layout.conf.1920x1200.6on2x2 b/example_layouts/layout.conf.1920x1200.6on2x2 index 7af0f19..7ede0dd 100644 --- a/example_layouts/layout.conf.1920x1200.6on2x2 +++ b/example_layouts/layout.conf.1920x1200.6on2x2 @@ -63,5 +63,16 @@ camera_feeds=( \ "" \ ) +camera_orientations=( +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +) + + # Are we rotating cameras through the window matrix? (default false if not set here) rotate="true" diff --git a/example_layouts/layout.conf.640x480 b/example_layouts/layout.conf.640x480 index ab25cc3..75985a0 100644 --- a/example_layouts/layout.conf.640x480 +++ b/example_layouts/layout.conf.640x480 @@ -39,5 +39,12 @@ camera_feeds=( \ "rtsp://xxx.xxx.xxx.xxx/yyyyy_1" \ ) +camera_orientations=( +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +) + # Are we rotating cameras through the window matrix? (default false if not set h ere) rotate="true" diff --git a/example_layouts/layout.conf.7on2x2_with_2x2lowerleft_child_matrix_on1280x800 b/example_layouts/layout.conf.7on2x2_with_2x2lowerleft_child_matrix_on1280x800 index bdb1952..5bd8b66 100644 --- a/example_layouts/layout.conf.7on2x2_with_2x2lowerleft_child_matrix_on1280x800 +++ b/example_layouts/layout.conf.7on2x2_with_2x2lowerleft_child_matrix_on1280x800 @@ -60,5 +60,17 @@ camera_feeds=( \ "" \ ) +camera_orientations=( +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +) + # Are we rotating cameras through the window matrix? (default false if not set here) rotate="false" diff --git a/example_layouts/layout.conf.large_left b/example_layouts/layout.conf.large_left index c6bc232..3456e51 100644 --- a/example_layouts/layout.conf.large_left +++ b/example_layouts/layout.conf.large_left @@ -80,6 +80,17 @@ camera_feeds=( \ "" \ ) +camera_orientations=( +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +) + + # Are we rotating cameras through the window matrix? (default false if not set here) # You're REALLY not going to want to rotate these as the RPi will have to do # significant downscaling on the Hi-Res feed to display it in the smaller windows. diff --git a/example_layouts/layout.examples b/example_layouts/layout.examples index 9d8e090..e999fa7 100644 --- a/example_layouts/layout.examples +++ b/example_layouts/layout.examples @@ -193,5 +193,16 @@ #"" \ #) +#camera_orientations=( +# Camera display orientation. Possible values are 0, 90, 180 and 270 +#"0" \ +#"0" \ +#"0" \ +#"0" \ +#"0" \ +#"0" \ +#) + + # Are we rotating? # rotation="true" diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 diff --git a/layout.conf.default b/layout.conf.default index 214b81f..9bed775 100644 --- a/layout.conf.default +++ b/layout.conf.default @@ -68,6 +68,16 @@ camera_feeds=( \ "" \ ) +camera_orientations=( \ +# Camera display orientation. Possible values are 0, 90, 180 and 270 +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +"0" \ +) + # Are we rotating cameras through the window matrix? (default false if not set here) # rotate="true"