mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 05:36:32 +00:00
Merge pull request #1925 from ccrisan/streameye-rtsp-configurable-port
Fast network camera RTSP configurable port
This commit is contained in:
commit
9c65cc14fd
@ -411,6 +411,7 @@ def _get_streameye_settings(camera_id):
|
|||||||
'seProto': 'mjpeg',
|
'seProto': 'mjpeg',
|
||||||
'seAuthMode': 'disabled',
|
'seAuthMode': 'disabled',
|
||||||
'sePort': 8081,
|
'sePort': 8081,
|
||||||
|
'seRTSPPort': 554
|
||||||
}
|
}
|
||||||
|
|
||||||
if os.path.exists(STREAMEYE_CONF):
|
if os.path.exists(STREAMEYE_CONF):
|
||||||
@ -422,16 +423,21 @@ def _get_streameye_settings(camera_id):
|
|||||||
if not line:
|
if not line:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
m = re.findall('PORT="?(\d+)"?', line)
|
m = re.findall('^PORT="?(\d+)"?', line)
|
||||||
if m:
|
if m:
|
||||||
s['sePort'] = int(m[0])
|
s['sePort'] = int(m[0])
|
||||||
continue
|
continue
|
||||||
|
|
||||||
m = re.findall('AUTH="?(\w+)"?', line)
|
m = re.findall('^RTSP_PORT="?(\d+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seRTSPPort'] = int(m[0])
|
||||||
|
continue
|
||||||
|
|
||||||
|
m = re.findall('^AUTH="?(\w+)"?', line)
|
||||||
if m:
|
if m:
|
||||||
s['seAuthMode'] = m[0]
|
s['seAuthMode'] = m[0]
|
||||||
|
|
||||||
m = re.findall('PROTO="?(\w+)"?', line)
|
m = re.findall('^PROTO="?(\w+)"?', line)
|
||||||
if m:
|
if m:
|
||||||
s['seProto'] = m[0]
|
s['seProto'] = m[0]
|
||||||
|
|
||||||
@ -441,6 +447,7 @@ def _get_streameye_settings(camera_id):
|
|||||||
def _set_streameye_settings(camera_id, s):
|
def _set_streameye_settings(camera_id, s):
|
||||||
s = dict(s)
|
s = dict(s)
|
||||||
s.setdefault('sePort', 8081)
|
s.setdefault('sePort', 8081)
|
||||||
|
s.setdefault('seRTSPPort', 554)
|
||||||
s.setdefault('seAuthMode', 'disabled')
|
s.setdefault('seAuthMode', 'disabled')
|
||||||
|
|
||||||
main_config = config.get_main()
|
main_config = config.get_main()
|
||||||
@ -453,6 +460,7 @@ def _set_streameye_settings(camera_id, s):
|
|||||||
lines = [
|
lines = [
|
||||||
'PROTO="%s"' % s['seProto'],
|
'PROTO="%s"' % s['seProto'],
|
||||||
'PORT="%s"' % s['sePort'],
|
'PORT="%s"' % s['sePort'],
|
||||||
|
'RTSP_PORT="%s"' % s['seRTSPPort'],
|
||||||
'AUTH="%s"' % s['seAuthMode'],
|
'AUTH="%s"' % s['seAuthMode'],
|
||||||
'CREDENTIALS="%s:%s:%s"' % (username, password, realm)
|
'CREDENTIALS="%s:%s:%s"' % (username, password, realm)
|
||||||
]
|
]
|
||||||
@ -1193,12 +1201,35 @@ def sePort():
|
|||||||
'label': 'Streaming Port',
|
'label': 'Streaming Port',
|
||||||
'description': 'sets the TCP port on which the webcam streaming server listens',
|
'description': 'sets the TCP port on which the webcam streaming server listens',
|
||||||
'type': 'number',
|
'type': 'number',
|
||||||
'min': 1024,
|
'min': 0,
|
||||||
'max': 65535,
|
'max': 65535,
|
||||||
'section': 'streaming',
|
'section': 'streaming',
|
||||||
'advanced': True,
|
'advanced': True,
|
||||||
'camera': True,
|
'camera': True,
|
||||||
'required': True,
|
'required': True,
|
||||||
|
'depends': ['seProto==mjpeg'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seRTSPPort():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'Streaming Port',
|
||||||
|
'description': 'sets the TCP port on which the webcam streaming server listens',
|
||||||
|
'type': 'number',
|
||||||
|
'min': 0,
|
||||||
|
'max': 65535,
|
||||||
|
'section': 'streaming',
|
||||||
|
'advanced': True,
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
'get': _get_streameye_settings,
|
'get': _get_streameye_settings,
|
||||||
'set': _set_streameye_settings,
|
'set': _set_streameye_settings,
|
||||||
'get_set_dict': True
|
'get_set_dict': True
|
||||||
@ -1219,6 +1250,7 @@ def seAuthMode():
|
|||||||
'advanced': True,
|
'advanced': True,
|
||||||
'camera': True,
|
'camera': True,
|
||||||
'required': True,
|
'required': True,
|
||||||
|
'depends': ['seProto==mjpeg'],
|
||||||
'get': _get_streameye_settings,
|
'get': _get_streameye_settings,
|
||||||
'set': _set_streameye_settings,
|
'set': _set_streameye_settings,
|
||||||
'get_set_dict': True
|
'get_set_dict': True
|
||||||
|
@ -11,7 +11,7 @@ STREAMEYE_LOG=/var/log/streameye.log
|
|||||||
test -r ${RASPIMJPEG_CONF} || exit 1
|
test -r ${RASPIMJPEG_CONF} || exit 1
|
||||||
test -r ${STREAMEYE_CONF} || exit 1
|
test -r ${STREAMEYE_CONF} || exit 1
|
||||||
|
|
||||||
watch() {
|
function watch() {
|
||||||
source ${STREAMEYE_CONF}
|
source ${STREAMEYE_CONF}
|
||||||
count=0
|
count=0
|
||||||
while true; do
|
while true; do
|
||||||
@ -133,7 +133,7 @@ function configure_v4l2_cam() {
|
|||||||
v4l2-ctl ${video_arg} --set-ctrl=video_bitrate=${video_bitrate} &>/dev/null
|
v4l2-ctl ${video_arg} --set-ctrl=video_bitrate=${video_bitrate} &>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
invalid_opt () {
|
function invalid_opt() {
|
||||||
local e match="$1"
|
local e match="$1"
|
||||||
shift
|
shift
|
||||||
for e; do [[ "${e}" == "${match}" ]] && return 1; done
|
for e; do [[ "${e}" == "${match}" ]] && return 1; done
|
||||||
@ -153,8 +153,10 @@ function start() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
iptables -A INPUT -p tcp -s localhost --dport 554 -j ACCEPT
|
RTSP_PORT=${RTSP_PORT:-554}
|
||||||
iptables -A INPUT -p tcp --dport 554 -j DROP
|
|
||||||
|
iptables -A INPUT -p tcp -s localhost --dport ${RTSP_PORT} -j ACCEPT
|
||||||
|
iptables -A INPUT -p tcp --dport ${RTSP_PORT} -j DROP
|
||||||
|
|
||||||
audio_opts=""
|
audio_opts=""
|
||||||
if [ -n "${AUDIO_DEV}" ]; then
|
if [ -n "${AUDIO_DEV}" ]; then
|
||||||
@ -197,14 +199,14 @@ function start() {
|
|||||||
streameye_opts="${streameye_opts} -d"
|
streameye_opts="${streameye_opts} -d"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test-launch -p 554 -m h264 "\"( ${video_opts} ${audio_opts} )\"" &>${GSTREAMER_LOG} &
|
test-launch -p ${RTSP_PORT} -m h264 "\"( ${video_opts} ${audio_opts} )\"" &>${GSTREAMER_LOG} &
|
||||||
sleep 10
|
sleep 10
|
||||||
gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1:554/h264 latency=0 drop-on-latency=1 ! rtph264depay ! h264parse ! omxh264dec ! videorate ! video/x-raw,framerate=5/1 ! jpegenc ! filesink location=/dev/stdout | streameye ${streameye_opts} &>${STREAMEYE_LOG} &
|
gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1:${RTSP_PORT}/h264 latency=0 drop-on-latency=1 ! rtph264depay ! h264parse ! omxh264dec ! videorate ! video/x-raw,framerate=5/1 ! jpegenc ! filesink location=/dev/stdout | streameye ${streameye_opts} &>${STREAMEYE_LOG} &
|
||||||
sleep 5
|
sleep 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
iptables -D INPUT -p tcp --dport 554 -j DROP
|
iptables -D INPUT -p tcp --dport ${RTSP_PORT} -j DROP
|
||||||
iptables -D INPUT -p tcp -s localhost --dport 554 -j ACCEPT
|
iptables -D INPUT -p tcp -s localhost --dport ${RTSP_PORT} -j ACCEPT
|
||||||
|
|
||||||
else
|
else
|
||||||
pid=$(ps | grep raspimjpeg.py | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1)
|
pid=$(ps | grep raspimjpeg.py | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1)
|
||||||
|
@ -411,6 +411,7 @@ def _get_streameye_settings(camera_id):
|
|||||||
'seProto': 'mjpeg',
|
'seProto': 'mjpeg',
|
||||||
'seAuthMode': 'disabled',
|
'seAuthMode': 'disabled',
|
||||||
'sePort': 8081,
|
'sePort': 8081,
|
||||||
|
'seRTSPPort': 554
|
||||||
}
|
}
|
||||||
|
|
||||||
if os.path.exists(STREAMEYE_CONF):
|
if os.path.exists(STREAMEYE_CONF):
|
||||||
@ -422,16 +423,21 @@ def _get_streameye_settings(camera_id):
|
|||||||
if not line:
|
if not line:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
m = re.findall('PORT="?(\d+)"?', line)
|
m = re.findall('^PORT="?(\d+)"?', line)
|
||||||
if m:
|
if m:
|
||||||
s['sePort'] = int(m[0])
|
s['sePort'] = int(m[0])
|
||||||
continue
|
continue
|
||||||
|
|
||||||
m = re.findall('AUTH="?(\w+)"?', line)
|
m = re.findall('^RTSP_PORT="?(\d+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seRTSPPort'] = int(m[0])
|
||||||
|
continue
|
||||||
|
|
||||||
|
m = re.findall('^AUTH="?(\w+)"?', line)
|
||||||
if m:
|
if m:
|
||||||
s['seAuthMode'] = m[0]
|
s['seAuthMode'] = m[0]
|
||||||
|
|
||||||
m = re.findall('PROTO="?(\w+)"?', line)
|
m = re.findall('^PROTO="?(\w+)"?', line)
|
||||||
if m:
|
if m:
|
||||||
s['seProto'] = m[0]
|
s['seProto'] = m[0]
|
||||||
|
|
||||||
@ -441,6 +447,7 @@ def _get_streameye_settings(camera_id):
|
|||||||
def _set_streameye_settings(camera_id, s):
|
def _set_streameye_settings(camera_id, s):
|
||||||
s = dict(s)
|
s = dict(s)
|
||||||
s.setdefault('sePort', 8081)
|
s.setdefault('sePort', 8081)
|
||||||
|
s.setdefault('seRTSPPort', 554)
|
||||||
s.setdefault('seAuthMode', 'disabled')
|
s.setdefault('seAuthMode', 'disabled')
|
||||||
|
|
||||||
main_config = config.get_main()
|
main_config = config.get_main()
|
||||||
@ -453,6 +460,7 @@ def _set_streameye_settings(camera_id, s):
|
|||||||
lines = [
|
lines = [
|
||||||
'PROTO="%s"' % s['seProto'],
|
'PROTO="%s"' % s['seProto'],
|
||||||
'PORT="%s"' % s['sePort'],
|
'PORT="%s"' % s['sePort'],
|
||||||
|
'RTSP_PORT="%s"' % s['seRTSPPort'],
|
||||||
'AUTH="%s"' % s['seAuthMode'],
|
'AUTH="%s"' % s['seAuthMode'],
|
||||||
'CREDENTIALS="%s:%s:%s"' % (username, password, realm)
|
'CREDENTIALS="%s:%s:%s"' % (username, password, realm)
|
||||||
]
|
]
|
||||||
@ -1193,12 +1201,35 @@ def sePort():
|
|||||||
'label': 'Streaming Port',
|
'label': 'Streaming Port',
|
||||||
'description': 'sets the TCP port on which the webcam streaming server listens',
|
'description': 'sets the TCP port on which the webcam streaming server listens',
|
||||||
'type': 'number',
|
'type': 'number',
|
||||||
'min': 1024,
|
'min': 0,
|
||||||
'max': 65535,
|
'max': 65535,
|
||||||
'section': 'streaming',
|
'section': 'streaming',
|
||||||
'advanced': True,
|
'advanced': True,
|
||||||
'camera': True,
|
'camera': True,
|
||||||
'required': True,
|
'required': True,
|
||||||
|
'depends': ['seProto==mjpeg'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seRTSPPort():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'Streaming Port',
|
||||||
|
'description': 'sets the TCP port on which the webcam streaming server listens',
|
||||||
|
'type': 'number',
|
||||||
|
'min': 0,
|
||||||
|
'max': 65535,
|
||||||
|
'section': 'streaming',
|
||||||
|
'advanced': True,
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
'get': _get_streameye_settings,
|
'get': _get_streameye_settings,
|
||||||
'set': _set_streameye_settings,
|
'set': _set_streameye_settings,
|
||||||
'get_set_dict': True
|
'get_set_dict': True
|
||||||
@ -1219,6 +1250,7 @@ def seAuthMode():
|
|||||||
'advanced': True,
|
'advanced': True,
|
||||||
'camera': True,
|
'camera': True,
|
||||||
'required': True,
|
'required': True,
|
||||||
|
'depends': ['seProto==mjpeg'],
|
||||||
'get': _get_streameye_settings,
|
'get': _get_streameye_settings,
|
||||||
'set': _set_streameye_settings,
|
'set': _set_streameye_settings,
|
||||||
'get_set_dict': True
|
'get_set_dict': True
|
||||||
|
@ -11,7 +11,7 @@ STREAMEYE_LOG=/var/log/streameye.log
|
|||||||
test -r ${RASPIMJPEG_CONF} || exit 1
|
test -r ${RASPIMJPEG_CONF} || exit 1
|
||||||
test -r ${STREAMEYE_CONF} || exit 1
|
test -r ${STREAMEYE_CONF} || exit 1
|
||||||
|
|
||||||
watch() {
|
function watch() {
|
||||||
source ${STREAMEYE_CONF}
|
source ${STREAMEYE_CONF}
|
||||||
count=0
|
count=0
|
||||||
while true; do
|
while true; do
|
||||||
@ -133,7 +133,7 @@ function configure_v4l2_cam() {
|
|||||||
v4l2-ctl ${video_arg} --set-ctrl=video_bitrate=${video_bitrate} &>/dev/null
|
v4l2-ctl ${video_arg} --set-ctrl=video_bitrate=${video_bitrate} &>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
invalid_opt () {
|
function invalid_opt() {
|
||||||
local e match="$1"
|
local e match="$1"
|
||||||
shift
|
shift
|
||||||
for e; do [[ "${e}" == "${match}" ]] && return 1; done
|
for e; do [[ "${e}" == "${match}" ]] && return 1; done
|
||||||
@ -153,8 +153,10 @@ function start() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
iptables -A INPUT -p tcp -s localhost --dport 554 -j ACCEPT
|
RTSP_PORT=${RTSP_PORT:-554}
|
||||||
iptables -A INPUT -p tcp --dport 554 -j DROP
|
|
||||||
|
iptables -A INPUT -p tcp -s localhost --dport ${RTSP_PORT} -j ACCEPT
|
||||||
|
iptables -A INPUT -p tcp --dport ${RTSP_PORT} -j DROP
|
||||||
|
|
||||||
audio_opts=""
|
audio_opts=""
|
||||||
if [ -n "${AUDIO_DEV}" ]; then
|
if [ -n "${AUDIO_DEV}" ]; then
|
||||||
@ -197,14 +199,14 @@ function start() {
|
|||||||
streameye_opts="${streameye_opts} -d"
|
streameye_opts="${streameye_opts} -d"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test-launch -p 554 -m h264 "\"( ${video_opts} ${audio_opts} )\"" &>${GSTREAMER_LOG} &
|
test-launch -p ${RTSP_PORT} -m h264 "\"( ${video_opts} ${audio_opts} )\"" &>${GSTREAMER_LOG} &
|
||||||
sleep 10
|
sleep 10
|
||||||
gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1:554/h264 latency=0 drop-on-latency=1 ! rtph264depay ! h264parse ! omxh264dec ! videorate ! video/x-raw,framerate=5/1 ! jpegenc ! filesink location=/dev/stdout | streameye ${streameye_opts} &>${STREAMEYE_LOG} &
|
gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1:${RTSP_PORT}/h264 latency=0 drop-on-latency=1 ! rtph264depay ! h264parse ! omxh264dec ! videorate ! video/x-raw,framerate=5/1 ! jpegenc ! filesink location=/dev/stdout | streameye ${streameye_opts} &>${STREAMEYE_LOG} &
|
||||||
sleep 5
|
sleep 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
iptables -D INPUT -p tcp --dport 554 -j DROP
|
iptables -D INPUT -p tcp --dport ${RTSP_PORT} -j DROP
|
||||||
iptables -D INPUT -p tcp -s localhost --dport 554 -j ACCEPT
|
iptables -D INPUT -p tcp -s localhost --dport ${RTSP_PORT} -j ACCEPT
|
||||||
|
|
||||||
else
|
else
|
||||||
pid=$(ps | grep raspimjpeg.py | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1)
|
pid=$(ps | grep raspimjpeg.py | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1)
|
||||||
|
@ -411,6 +411,7 @@ def _get_streameye_settings(camera_id):
|
|||||||
'seProto': 'mjpeg',
|
'seProto': 'mjpeg',
|
||||||
'seAuthMode': 'disabled',
|
'seAuthMode': 'disabled',
|
||||||
'sePort': 8081,
|
'sePort': 8081,
|
||||||
|
'seRTSPPort': 554
|
||||||
}
|
}
|
||||||
|
|
||||||
if os.path.exists(STREAMEYE_CONF):
|
if os.path.exists(STREAMEYE_CONF):
|
||||||
@ -422,16 +423,21 @@ def _get_streameye_settings(camera_id):
|
|||||||
if not line:
|
if not line:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
m = re.findall('PORT="?(\d+)"?', line)
|
m = re.findall('^PORT="?(\d+)"?', line)
|
||||||
if m:
|
if m:
|
||||||
s['sePort'] = int(m[0])
|
s['sePort'] = int(m[0])
|
||||||
continue
|
continue
|
||||||
|
|
||||||
m = re.findall('AUTH="?(\w+)"?', line)
|
m = re.findall('^RTSP_PORT="?(\d+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seRTSPPort'] = int(m[0])
|
||||||
|
continue
|
||||||
|
|
||||||
|
m = re.findall('^AUTH="?(\w+)"?', line)
|
||||||
if m:
|
if m:
|
||||||
s['seAuthMode'] = m[0]
|
s['seAuthMode'] = m[0]
|
||||||
|
|
||||||
m = re.findall('PROTO="?(\w+)"?', line)
|
m = re.findall('^PROTO="?(\w+)"?', line)
|
||||||
if m:
|
if m:
|
||||||
s['seProto'] = m[0]
|
s['seProto'] = m[0]
|
||||||
|
|
||||||
@ -441,6 +447,7 @@ def _get_streameye_settings(camera_id):
|
|||||||
def _set_streameye_settings(camera_id, s):
|
def _set_streameye_settings(camera_id, s):
|
||||||
s = dict(s)
|
s = dict(s)
|
||||||
s.setdefault('sePort', 8081)
|
s.setdefault('sePort', 8081)
|
||||||
|
s.setdefault('seRTSPPort', 554)
|
||||||
s.setdefault('seAuthMode', 'disabled')
|
s.setdefault('seAuthMode', 'disabled')
|
||||||
|
|
||||||
main_config = config.get_main()
|
main_config = config.get_main()
|
||||||
@ -453,6 +460,7 @@ def _set_streameye_settings(camera_id, s):
|
|||||||
lines = [
|
lines = [
|
||||||
'PROTO="%s"' % s['seProto'],
|
'PROTO="%s"' % s['seProto'],
|
||||||
'PORT="%s"' % s['sePort'],
|
'PORT="%s"' % s['sePort'],
|
||||||
|
'RTSP_PORT="%s"' % s['seRTSPPort'],
|
||||||
'AUTH="%s"' % s['seAuthMode'],
|
'AUTH="%s"' % s['seAuthMode'],
|
||||||
'CREDENTIALS="%s:%s:%s"' % (username, password, realm)
|
'CREDENTIALS="%s:%s:%s"' % (username, password, realm)
|
||||||
]
|
]
|
||||||
@ -1193,12 +1201,35 @@ def sePort():
|
|||||||
'label': 'Streaming Port',
|
'label': 'Streaming Port',
|
||||||
'description': 'sets the TCP port on which the webcam streaming server listens',
|
'description': 'sets the TCP port on which the webcam streaming server listens',
|
||||||
'type': 'number',
|
'type': 'number',
|
||||||
'min': 1024,
|
'min': 0,
|
||||||
'max': 65535,
|
'max': 65535,
|
||||||
'section': 'streaming',
|
'section': 'streaming',
|
||||||
'advanced': True,
|
'advanced': True,
|
||||||
'camera': True,
|
'camera': True,
|
||||||
'required': True,
|
'required': True,
|
||||||
|
'depends': ['seProto==mjpeg'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seRTSPPort():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'Streaming Port',
|
||||||
|
'description': 'sets the TCP port on which the webcam streaming server listens',
|
||||||
|
'type': 'number',
|
||||||
|
'min': 0,
|
||||||
|
'max': 65535,
|
||||||
|
'section': 'streaming',
|
||||||
|
'advanced': True,
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
'get': _get_streameye_settings,
|
'get': _get_streameye_settings,
|
||||||
'set': _set_streameye_settings,
|
'set': _set_streameye_settings,
|
||||||
'get_set_dict': True
|
'get_set_dict': True
|
||||||
@ -1219,6 +1250,7 @@ def seAuthMode():
|
|||||||
'advanced': True,
|
'advanced': True,
|
||||||
'camera': True,
|
'camera': True,
|
||||||
'required': True,
|
'required': True,
|
||||||
|
'depends': ['seProto==mjpeg'],
|
||||||
'get': _get_streameye_settings,
|
'get': _get_streameye_settings,
|
||||||
'set': _set_streameye_settings,
|
'set': _set_streameye_settings,
|
||||||
'get_set_dict': True
|
'get_set_dict': True
|
||||||
|
@ -11,7 +11,7 @@ STREAMEYE_LOG=/var/log/streameye.log
|
|||||||
test -r ${RASPIMJPEG_CONF} || exit 1
|
test -r ${RASPIMJPEG_CONF} || exit 1
|
||||||
test -r ${STREAMEYE_CONF} || exit 1
|
test -r ${STREAMEYE_CONF} || exit 1
|
||||||
|
|
||||||
watch() {
|
function watch() {
|
||||||
source ${STREAMEYE_CONF}
|
source ${STREAMEYE_CONF}
|
||||||
count=0
|
count=0
|
||||||
while true; do
|
while true; do
|
||||||
@ -133,7 +133,7 @@ function configure_v4l2_cam() {
|
|||||||
v4l2-ctl ${video_arg} --set-ctrl=video_bitrate=${video_bitrate} &>/dev/null
|
v4l2-ctl ${video_arg} --set-ctrl=video_bitrate=${video_bitrate} &>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
invalid_opt () {
|
function invalid_opt() {
|
||||||
local e match="$1"
|
local e match="$1"
|
||||||
shift
|
shift
|
||||||
for e; do [[ "${e}" == "${match}" ]] && return 1; done
|
for e; do [[ "${e}" == "${match}" ]] && return 1; done
|
||||||
@ -153,8 +153,10 @@ function start() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
iptables -A INPUT -p tcp -s localhost --dport 554 -j ACCEPT
|
RTSP_PORT=${RTSP_PORT:-554}
|
||||||
iptables -A INPUT -p tcp --dport 554 -j DROP
|
|
||||||
|
iptables -A INPUT -p tcp -s localhost --dport ${RTSP_PORT} -j ACCEPT
|
||||||
|
iptables -A INPUT -p tcp --dport ${RTSP_PORT} -j DROP
|
||||||
|
|
||||||
audio_opts=""
|
audio_opts=""
|
||||||
if [ -n "${AUDIO_DEV}" ]; then
|
if [ -n "${AUDIO_DEV}" ]; then
|
||||||
@ -197,14 +199,14 @@ function start() {
|
|||||||
streameye_opts="${streameye_opts} -d"
|
streameye_opts="${streameye_opts} -d"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test-launch -p 554 -m h264 "\"( ${video_opts} ${audio_opts} )\"" &>${GSTREAMER_LOG} &
|
test-launch -p ${RTSP_PORT} -m h264 "\"( ${video_opts} ${audio_opts} )\"" &>${GSTREAMER_LOG} &
|
||||||
sleep 10
|
sleep 10
|
||||||
gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1:554/h264 latency=0 drop-on-latency=1 ! rtph264depay ! h264parse ! omxh264dec ! videorate ! video/x-raw,framerate=5/1 ! jpegenc ! filesink location=/dev/stdout | streameye ${streameye_opts} &>${STREAMEYE_LOG} &
|
gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1:${RTSP_PORT}/h264 latency=0 drop-on-latency=1 ! rtph264depay ! h264parse ! omxh264dec ! videorate ! video/x-raw,framerate=5/1 ! jpegenc ! filesink location=/dev/stdout | streameye ${streameye_opts} &>${STREAMEYE_LOG} &
|
||||||
sleep 5
|
sleep 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
iptables -D INPUT -p tcp --dport 554 -j DROP
|
iptables -D INPUT -p tcp --dport ${RTSP_PORT} -j DROP
|
||||||
iptables -D INPUT -p tcp -s localhost --dport 554 -j ACCEPT
|
iptables -D INPUT -p tcp -s localhost --dport ${RTSP_PORT} -j ACCEPT
|
||||||
|
|
||||||
else
|
else
|
||||||
pid=$(ps | grep raspimjpeg.py | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1)
|
pid=$(ps | grep raspimjpeg.py | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user