script kann ich falls interesse besteht ja mal bereitstellen.
Sehr gerne. Ich habe vor in nächster Zeit ein ähnliches Projekt umzusetzen, und da würde es mir sehr weiter helfen.
#!/bin/bash
cred=USER:PASS
omx="omxplayer --avdict rtsp_transport:tcp --win"
param="--no-keys --no-osd --fps 10 --live -n -1"
cam_1=rtsp://$cred@10.13.37.x:554/Streaming/Channels/2
cam_2=rtsp://$cred@10.13.37.x:554/Streaming/Channels/2
cam_sd_3=rtsp://$cred@10.13.37.x:554/videosd
cam_hd_3=rtsp://$cred@10.13.37.x:554/videohd
cam_4=rtsp://$cred@10.13.37.x:554/videoMain
cam_sd_5=rtsp://$cred@10.13.37.x:554/videoSub
cam_hd_5=rtsp://$cred@10.13.37.x:554/videoMain
cam_sd_6=rtsp://$cred@10.13.37.x:554/videoSub
cam_hd_6=rtsp://$cred@10.13.37.x:554/videoMain
livestream=http://news2weltcms-lh.akamaihd.net/i/News2WeltCMS_1@425444/index_3_av-p.m3u8
#mode 85 - 1280x720 16:9
pos51=0,0,640,450
pos52=640,0,1280,450
pos53=0,450,426,720
pos54=426,450,852,720
pos55=852,450,1280,720
6er)
grid="6er"
pos61=0,0,852,480
pos62=852,0,1280,240
pos63=852,240,1280,480
pos64=0,480,426,720
pos65=426,480,852,720
pos66=852,480,1280,720
###################
# 1 # 2 #
# #######
# # 3 #
###################
# 4 # 5 # 6 #
###################
sleep 5
if [[ -f /home/pi/lock/cam.running ]] ; then
echo found lockfile, use "rm -f /home/pi/lock/cam.running" to delete. exiting...
exit
fi
echo creating lockfile
touch /home/pi/lock/cam.running
for i in 5er 5.2er 4er ; do
if (screen -ls | grep $i) ; then
echo $i
killall omxplayer.bin
killall screen
fi
done
cam1="screen -dmS $grid-cam1 sh -c '$omx $pos61 $cam_1 $param --layer 6'";
cam2="screen -dmS $grid-cam2 sh -c '$omx $pos62 $cam_2 $param --layer 6'";
cam5="screen -dmS $grid-cam5 sh -c '$omx $pos63 $cam_sd_5 $param --layer 6'";
cam4="screen -dmS $grid-cam4 sh -c '$omx $pos64 $cam_4 $param --layer 6'";
cam6="screen -dmS $grid-cam6 sh -c '$omx $pos65 $cam_sd_6 $param --layer 6'";
news="screen -dmS $grid-news sh -c '$omx $pos66 $livestream $param --layer 6'";
camera_feeds=(cam1 cam2 cam5 cam4 cam6 news)
for i in "${camera_feeds[@]}"
do
if !(screen -list | grep $i) ; then
eval eval '$'$i
echo "$grid-$i is now running"
fi
done
rm -f /home/pi/lock/cam.running
echo done
;;
5er)
grid="5er"
###################
# 1 # 2 #
# # #
# # #
###################
# 3 # 4 # 5 #
###################
sleep 5
if [[ -f /home/pi/lock/cam.running ]] ; then
echo found lockfile, use "rm -f /home/pi/lock/cam.running" to delete. exiting...
exit
fi
echo creating lockfile
touch /home/pi/lock/cam.running
if (screen -list | grep -q cam4) ; then
screen -X -S cam4 kill
echo cam4 feed killed
fi
for i in 6er 5.2er 4er ; do
if (screen -list | grep $i) ; then
echo $i
killall omxplayer.bin
killall screen
fi
done
cam1="screen -dmS $grid-cam1 sh -c '$omx $pos51 $cam_1 $param --layer 5'";
cam6="screen -dmS $grid-cam6 sh -c '$omx $pos52 $cam_hd_6 $param --layer 5'";
cam2="screen -dmS $grid-cam2 sh -c '$omx $pos53 $cam_2 $param --layer 5'";
news="screen -dmS $grid-news sh -c '$omx $pos54 $livestream $param --layer 5'";
cam5="screen -dmS $grid-cam5 sh -c '$omx $pos55 $cam_sd_5 $param --layer 5'";
camera_feeds=(cam1 cam6 cam2 news cam5)
for i in "${camera_feeds[@]}"
do
if !(screen -list | grep $i) ; then
eval eval '$'$i
echo "$grid-$i is now running"
fi
done
rm -f /home/pi/lock/cam.running
echo done
;;
5.2er)
grid="5.2er"
pos51=0,0,640,450
pos52=640,0,1280,450
pos53=0,450,426,720
pos54=426,450,852,720
pos55=852,450,1280,720
<...>
;;
4er)
grid="4er"
pos41=0,0,840,720
pos42=840,0,1280,240
pos43=840,240,1280,480
pos44=840,480,1280,720
<...>
;;
kill)
killall screen
killall omxplayer.bin
rm -f /home/pi/lock/cam.running
;;
repair)
sleep 50
killall screen
killall omxplayer.bin
rm -f /home/pi/lock/cam.running
;;
*)
echo "Usage: /home/pi/cam.sh {6er|5er|5.2er|4er|kill|repair}"
rm -f /home/pi/lock/cam.running
echo done
exit 1
;;
esac
esac
case "$1" in
/pmnt/pfad/zum/script.sh 6er
Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.
Als Dankeschön schalten wir deinen Account werbefrei.