forked from MikeMakes/Phoebe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiniAll.sh
42 lines (26 loc) · 1.04 KB
/
iniAll.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
############################# Description ######################################
#Start the entire camera monitoring and control scripts.
############################# Useful things and error handling ##############
#Check what RPi is this
PI=false
grep 'BCM2708' /proc/cpuinfo && PI=true
grep 'BCM2709' /proc/cpuinfo && PI=true
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Directory where this script is (Commentable in case it is not neccesary)
# A slicker error handling routine by William Shotts (www.linuxcommand.org):
PROGNAME=$(basename $0)
error_exit()
{
echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
exit 1
}
############################# The script starts here ##############################
if [ "$PI" = true ]; then
ffmpeg -f v4l2 -framerate 30 -video_size 640x480 -i /dev/video0 -tune zerolatency -f rtp rtp://10.42.0.1:1234 & PIDFF=$!
#chapuza. debe cerrarse el ffmpeg cuando se quiera cerrar el programa.
python mainpi.py
else
./Adhoc/ahon.sh
ffplay udp://10.42.0.1:1234
python mainpi.py
fi