Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow changing camera orientation and crop #43

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions displaycameras
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions example_layouts/layout.conf.1024x600
Original file line number Diff line number Diff line change
Expand Up @@ -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"
10 changes: 10 additions & 0 deletions example_layouts/layout.conf.1280x1028
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ camera_feeds=(
"<Camera stream URL>" \
)

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"
10 changes: 10 additions & 0 deletions example_layouts/layout.conf.1280x720
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ camera_feeds=(
"<Camera stream URL>" \
)

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"
10 changes: 10 additions & 0 deletions example_layouts/layout.conf.1280x768
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ camera_feeds=(
"<Camera stream URL>" \
)

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"
9 changes: 9 additions & 0 deletions example_layouts/layout.conf.1280x800
Original file line number Diff line number Diff line change
Expand Up @@ -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"
10 changes: 10 additions & 0 deletions example_layouts/layout.conf.1440x900
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ camera_feeds=(
"<Camera stream URL>" \
)

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"
21 changes: 21 additions & 0 deletions example_layouts/layout.conf.1440x900.3x3
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,26 @@ camera_feeds=( \
"<Camera stream URL>" \
)

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"
13 changes: 13 additions & 0 deletions example_layouts/layout.conf.1920x1080.10on3x3
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,18 @@ camera_feeds=( \
"<Camera stream URL>" \
)

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"
19 changes: 19 additions & 0 deletions example_layouts/layout.conf.1920x1080.14mid-res-on-2x2
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,25 @@ camera_feeds=( \
"<RTSP URL>" \
)

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)
Expand Down
8 changes: 8 additions & 0 deletions example_layouts/layout.conf.1920x1080.1x1
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,13 @@ camera_feeds=( \
"<Camera stream URL>" \
)

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"
22 changes: 22 additions & 0 deletions example_layouts/layout.conf.1920x1080.3x3
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,27 @@ camera_feeds=( \
"<Camera stream URL>" \
)

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"
9 changes: 9 additions & 0 deletions example_layouts/layout.conf.1920x1080.4on1x1
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions example_layouts/layout.conf.1920x1200.6on2x2
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,16 @@ camera_feeds=( \
"<Camera stream URL>" \
)

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"
7 changes: 7 additions & 0 deletions example_layouts/layout.conf.640x480
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,17 @@ camera_feeds=( \
"<RTSP URL>" \
)

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"
11 changes: 11 additions & 0 deletions example_layouts/layout.conf.large_left
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ camera_feeds=( \
"<Camera stream URL>" \
)

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.
Expand Down
11 changes: 11 additions & 0 deletions example_layouts/layout.examples
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,16 @@
#"<Camera stream URL>" \
#)

#camera_orientations=(
# Camera display orientation. Possible values are 0, 90, 180 and 270
#"0" \
#"0" \
#"0" \
#"0" \
#"0" \
#"0" \
#)


# Are we rotating?
# rotation="true"
Empty file modified install.sh
100644 → 100755
Empty file.
10 changes: 10 additions & 0 deletions layout.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ camera_feeds=( \
"<Camera stream URL>" \
)

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"

Expand Down