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

Added Picture-in-PIcture that doesn't flicker #124

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
16 changes: 14 additions & 2 deletions displaycameras
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,18 @@ startupfailure=false
feedfailure=false
for i in ${!camera_names[*]}
do
if [[ ${windows[$i]} =~ "PIP" ]]
then
pip="--layer=3"
else
pip=""
fi
startupretry=0
feedretry=0
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 &"
player="omxplayer ${pip} --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 &"
echo "Starting omxplayer for ${camera_names[$i]}"
eval $player
sleep $startsleep
Expand Down Expand Up @@ -214,13 +220,19 @@ for i in ${!camera_names[*]}
do
if [ "`omxplayer_dbuscontrol ${camera_names[$i]} getplaystatus`" != "Playing" -o "`omxplayer_dbuscontrol ${camera_names[$i]} getposition`" = "0s" ]
then
if [[ ${windows[$i]} =~ "PIP" ]]
then
pip="--layer=3"
else
pip=""
fi
rm -f $PIDFILE
pkill rotatedisplays
omxplayer_dbuscontrol ${camera_names[$i]} quit
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 &"
player="omxplayer ${pip} --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 &"
echo "Starting omxplayer for ${camera_names[$i]}"
eval $player
sleep $startsleep
Expand Down
5 changes: 5 additions & 0 deletions layout.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
# on a full-HD monitor. If this suites your needs, modify only the camera names to taste
# and feed URLs to what your cameras or NVR provides.

# If you are going to place a small window over a larger one (Picture in Picture) name
# your window with "PIP" in the name, ie: "upper_left_PIP"
# Otherwise the PIP window will flicker.

# Window names

# 2x2 screen with 3 off-screen windows

windows=(upper_left upper_right lower_left lower_right off_screen off_screen2 off_screen3)
# Make sure to account for each window above in the list below.

Expand Down