mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 05:36:32 +00:00
add mjpeg options config readouts to frontend
This commit is contained in:
parent
86b428a61a
commit
c27b8a9f51
118
board/raspberrypi/motioneye-modules/streameyectl.py
Normal file → Executable file
118
board/raspberrypi/motioneye-modules/streameyectl.py
Normal file → Executable file
@ -59,7 +59,7 @@ AWB_CHOICES = [
|
|||||||
('incandescent', 'Incandescent'),
|
('incandescent', 'Incandescent'),
|
||||||
('flash', 'Flash'),
|
('flash', 'Flash'),
|
||||||
('horizon', 'Horizon'),
|
('horizon', 'Horizon'),
|
||||||
('greyworld', 'Greyworld')
|
('greyworld', 'Greyworld')
|
||||||
]
|
]
|
||||||
|
|
||||||
METERING_CHOICES = [
|
METERING_CHOICES = [
|
||||||
@ -412,9 +412,13 @@ def _get_streameye_settings(camera_id):
|
|||||||
'seProto': 'mjpeg',
|
'seProto': 'mjpeg',
|
||||||
'seAuthMode': 'disabled',
|
'seAuthMode': 'disabled',
|
||||||
'sePort': 8081,
|
'sePort': 8081,
|
||||||
'seRTSPPort': 554
|
'seRTSPPort': 554,
|
||||||
|
'seMJPEGWidth': 640,
|
||||||
|
'seMJPEGHeight': 480,
|
||||||
|
'seMJPEGFramerate': 5,
|
||||||
|
'seMJPEGBitrate': 1000000
|
||||||
}
|
}
|
||||||
|
|
||||||
if os.path.exists(STREAMEYE_CONF):
|
if os.path.exists(STREAMEYE_CONF):
|
||||||
logging.debug('reading streameye settings from %s' % STREAMEYE_CONF)
|
logging.debug('reading streameye settings from %s' % STREAMEYE_CONF)
|
||||||
|
|
||||||
@ -442,15 +446,40 @@ def _get_streameye_settings(camera_id):
|
|||||||
if m:
|
if m:
|
||||||
s['seProto'] = m[0]
|
s['seProto'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_WIDTH="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGWidth'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_HEIGHT="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGHeight'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_FRAMERATE="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGFramerate'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_BITRATE="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGBitrate'] = m[0]
|
||||||
|
|
||||||
|
s['seMJPEGRes'] = '%sx%s' % (s.pop('seMJPEGWidth'), s.pop('seMJPEGHeight'))
|
||||||
|
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
|
||||||
def _set_streameye_settings(camera_id, s):
|
def _set_streameye_settings(camera_id, s):
|
||||||
s = dict(s)
|
s = dict(s)
|
||||||
|
s['seMJPEGWidth'] = int(s['seMJPEGRes'].split('x')[0])
|
||||||
|
s['seMJPEGHeight'] = int(s.pop('seMJPEGRes').split('x')[1])
|
||||||
|
|
||||||
s.setdefault('sePort', 8081)
|
s.setdefault('sePort', 8081)
|
||||||
s.setdefault('seRTSPPort', 554)
|
s.setdefault('seRTSPPort', 554)
|
||||||
s.setdefault('seAuthMode', 'disabled')
|
s.setdefault('seAuthMode', 'disabled')
|
||||||
|
s.setdefault('seMJPEGWidth', 640)
|
||||||
|
s.setdefault('seMJPEGHeight', 480)
|
||||||
|
s.setdefault('seMJPEGFramerate', 5)
|
||||||
|
s.setdefault('seMJPEGBitrate', 2000000)
|
||||||
|
|
||||||
main_config = config.get_main()
|
main_config = config.get_main()
|
||||||
username = main_config['@normal_username']
|
username = main_config['@normal_username']
|
||||||
password = main_config['@normal_password']
|
password = main_config['@normal_password']
|
||||||
@ -462,6 +491,10 @@ def _set_streameye_settings(camera_id, s):
|
|||||||
'PROTO="%s"' % s['seProto'],
|
'PROTO="%s"' % s['seProto'],
|
||||||
'PORT="%s"' % s['sePort'],
|
'PORT="%s"' % s['sePort'],
|
||||||
'RTSP_PORT="%s"' % s['seRTSPPort'],
|
'RTSP_PORT="%s"' % s['seRTSPPort'],
|
||||||
|
'MJPEG_WIDTH="%s"' % s['seMJPEGWidth'],
|
||||||
|
'MJPEG_HEIGHT="%s"' % s['seMJPEGHeight'],
|
||||||
|
'MJPEG_FRAMERATE="%s"' % s['seMJPEGFramerate'],
|
||||||
|
'MJPEG_BITRATE="%s"' % s['seMJPEGBitrate'],
|
||||||
'AUTH="%s"' % s['seAuthMode'],
|
'AUTH="%s"' % s['seAuthMode'],
|
||||||
'CREDENTIALS="%s:%s:%s"' % (username, password, realm)
|
'CREDENTIALS="%s:%s:%s"' % (username, password, realm)
|
||||||
]
|
]
|
||||||
@ -1158,6 +1191,27 @@ def seProto():
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seRTSPPort():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'Streaming RTSP Port',
|
||||||
|
'description': 'sets the TCP port on which the webcam streaming server listens',
|
||||||
|
'type': 'number',
|
||||||
|
'min': 0,
|
||||||
|
'max': 65535,
|
||||||
|
'section': 'streaming',
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@additional_config
|
@additional_config
|
||||||
def sePort():
|
def sePort():
|
||||||
if not _get_streameye_enabled():
|
if not _get_streameye_enabled():
|
||||||
@ -1172,7 +1226,6 @@ def sePort():
|
|||||||
'section': 'streaming',
|
'section': 'streaming',
|
||||||
'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
|
||||||
@ -1180,16 +1233,60 @@ def sePort():
|
|||||||
|
|
||||||
|
|
||||||
@additional_config
|
@additional_config
|
||||||
def seRTSPPort():
|
def seMJPEGRes():
|
||||||
if not _get_streameye_enabled():
|
if not _get_streameye_enabled():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'label': 'Streaming Port',
|
'label': 'MJPEG Resolution',
|
||||||
'description': 'sets the TCP port on which the webcam streaming server listens',
|
'description': 'the MJPEG resolution fed to the frontend and used for motion detection on remote machines when streaming RTSP',
|
||||||
|
'type': 'choices',
|
||||||
|
'choices': RESOLUTION_CHOICES,
|
||||||
|
'section': 'streaming',
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seMJPEGFramerate():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'MJPEG Frame Rate',
|
||||||
|
'description': 'the MJPEG Frame Rate fed to the frontend and used for motion detection on remote machines when streaming RTSP; for motion detection, 5 works good',
|
||||||
|
'type': 'range',
|
||||||
|
'min': 2,
|
||||||
|
'max': 30,
|
||||||
|
'snap': 0,
|
||||||
|
'ticks': "2|5|10|15|20|25|30",
|
||||||
|
'decimals': 0,
|
||||||
|
'section': 'streaming',
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seMJPEGBitrate():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'MJPEG Bitrate',
|
||||||
|
'description': 'the MJPEG Bitrate fed to the frontend and used for motion detection on remote machines when streaming RTSP; for motion detection, 2000000 works good',
|
||||||
'type': 'number',
|
'type': 'number',
|
||||||
'min': 0,
|
'min': 1000000,
|
||||||
'max': 65535,
|
'max': 25000000,
|
||||||
'section': 'streaming',
|
'section': 'streaming',
|
||||||
'camera': True,
|
'camera': True,
|
||||||
'required': True,
|
'required': True,
|
||||||
@ -1218,4 +1315,3 @@ def seAuthMode():
|
|||||||
'set': _set_streameye_settings,
|
'set': _set_streameye_settings,
|
||||||
'get_set_dict': True
|
'get_set_dict': True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
118
board/raspberrypi2/motioneye-modules/streameyectl.py
Normal file → Executable file
118
board/raspberrypi2/motioneye-modules/streameyectl.py
Normal file → Executable file
@ -59,7 +59,7 @@ AWB_CHOICES = [
|
|||||||
('incandescent', 'Incandescent'),
|
('incandescent', 'Incandescent'),
|
||||||
('flash', 'Flash'),
|
('flash', 'Flash'),
|
||||||
('horizon', 'Horizon'),
|
('horizon', 'Horizon'),
|
||||||
('greyworld', 'Greyworld')
|
('greyworld', 'Greyworld')
|
||||||
]
|
]
|
||||||
|
|
||||||
METERING_CHOICES = [
|
METERING_CHOICES = [
|
||||||
@ -412,9 +412,13 @@ def _get_streameye_settings(camera_id):
|
|||||||
'seProto': 'mjpeg',
|
'seProto': 'mjpeg',
|
||||||
'seAuthMode': 'disabled',
|
'seAuthMode': 'disabled',
|
||||||
'sePort': 8081,
|
'sePort': 8081,
|
||||||
'seRTSPPort': 554
|
'seRTSPPort': 554,
|
||||||
|
'seMJPEGWidth': 640,
|
||||||
|
'seMJPEGHeight': 480,
|
||||||
|
'seMJPEGFramerate': 5,
|
||||||
|
'seMJPEGBitrate': 1000000
|
||||||
}
|
}
|
||||||
|
|
||||||
if os.path.exists(STREAMEYE_CONF):
|
if os.path.exists(STREAMEYE_CONF):
|
||||||
logging.debug('reading streameye settings from %s' % STREAMEYE_CONF)
|
logging.debug('reading streameye settings from %s' % STREAMEYE_CONF)
|
||||||
|
|
||||||
@ -442,15 +446,40 @@ def _get_streameye_settings(camera_id):
|
|||||||
if m:
|
if m:
|
||||||
s['seProto'] = m[0]
|
s['seProto'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_WIDTH="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGWidth'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_HEIGHT="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGHeight'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_FRAMERATE="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGFramerate'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_BITRATE="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGBitrate'] = m[0]
|
||||||
|
|
||||||
|
s['seMJPEGRes'] = '%sx%s' % (s.pop('seMJPEGWidth'), s.pop('seMJPEGHeight'))
|
||||||
|
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
|
||||||
def _set_streameye_settings(camera_id, s):
|
def _set_streameye_settings(camera_id, s):
|
||||||
s = dict(s)
|
s = dict(s)
|
||||||
|
s['seMJPEGWidth'] = int(s['seMJPEGRes'].split('x')[0])
|
||||||
|
s['seMJPEGHeight'] = int(s.pop('seMJPEGRes').split('x')[1])
|
||||||
|
|
||||||
s.setdefault('sePort', 8081)
|
s.setdefault('sePort', 8081)
|
||||||
s.setdefault('seRTSPPort', 554)
|
s.setdefault('seRTSPPort', 554)
|
||||||
s.setdefault('seAuthMode', 'disabled')
|
s.setdefault('seAuthMode', 'disabled')
|
||||||
|
s.setdefault('seMJPEGWidth', 640)
|
||||||
|
s.setdefault('seMJPEGHeight', 480)
|
||||||
|
s.setdefault('seMJPEGFramerate', 5)
|
||||||
|
s.setdefault('seMJPEGBitrate', 2000000)
|
||||||
|
|
||||||
main_config = config.get_main()
|
main_config = config.get_main()
|
||||||
username = main_config['@normal_username']
|
username = main_config['@normal_username']
|
||||||
password = main_config['@normal_password']
|
password = main_config['@normal_password']
|
||||||
@ -462,6 +491,10 @@ def _set_streameye_settings(camera_id, s):
|
|||||||
'PROTO="%s"' % s['seProto'],
|
'PROTO="%s"' % s['seProto'],
|
||||||
'PORT="%s"' % s['sePort'],
|
'PORT="%s"' % s['sePort'],
|
||||||
'RTSP_PORT="%s"' % s['seRTSPPort'],
|
'RTSP_PORT="%s"' % s['seRTSPPort'],
|
||||||
|
'MJPEG_WIDTH="%s"' % s['seMJPEGWidth'],
|
||||||
|
'MJPEG_HEIGHT="%s"' % s['seMJPEGHeight'],
|
||||||
|
'MJPEG_FRAMERATE="%s"' % s['seMJPEGFramerate'],
|
||||||
|
'MJPEG_BITRATE="%s"' % s['seMJPEGBitrate'],
|
||||||
'AUTH="%s"' % s['seAuthMode'],
|
'AUTH="%s"' % s['seAuthMode'],
|
||||||
'CREDENTIALS="%s:%s:%s"' % (username, password, realm)
|
'CREDENTIALS="%s:%s:%s"' % (username, password, realm)
|
||||||
]
|
]
|
||||||
@ -1158,6 +1191,27 @@ def seProto():
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seRTSPPort():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'Streaming RTSP Port',
|
||||||
|
'description': 'sets the TCP port on which the webcam streaming server listens',
|
||||||
|
'type': 'number',
|
||||||
|
'min': 0,
|
||||||
|
'max': 65535,
|
||||||
|
'section': 'streaming',
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@additional_config
|
@additional_config
|
||||||
def sePort():
|
def sePort():
|
||||||
if not _get_streameye_enabled():
|
if not _get_streameye_enabled():
|
||||||
@ -1172,7 +1226,6 @@ def sePort():
|
|||||||
'section': 'streaming',
|
'section': 'streaming',
|
||||||
'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
|
||||||
@ -1180,16 +1233,60 @@ def sePort():
|
|||||||
|
|
||||||
|
|
||||||
@additional_config
|
@additional_config
|
||||||
def seRTSPPort():
|
def seMJPEGRes():
|
||||||
if not _get_streameye_enabled():
|
if not _get_streameye_enabled():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'label': 'Streaming Port',
|
'label': 'MJPEG Resolution',
|
||||||
'description': 'sets the TCP port on which the webcam streaming server listens',
|
'description': 'the MJPEG resolution fed to the frontend and used for motion detection on remote machines when streaming RTSP',
|
||||||
|
'type': 'choices',
|
||||||
|
'choices': RESOLUTION_CHOICES,
|
||||||
|
'section': 'streaming',
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seMJPEGFramerate():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'MJPEG Frame Rate',
|
||||||
|
'description': 'the MJPEG Frame Rate fed to the frontend and used for motion detection on remote machines when streaming RTSP; for motion detection, 5 works good',
|
||||||
|
'type': 'range',
|
||||||
|
'min': 2,
|
||||||
|
'max': 30,
|
||||||
|
'snap': 0,
|
||||||
|
'ticks': "2|5|10|15|20|25|30",
|
||||||
|
'decimals': 0,
|
||||||
|
'section': 'streaming',
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seMJPEGBitrate():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'MJPEG Bitrate',
|
||||||
|
'description': 'the MJPEG Bitrate fed to the frontend and used for motion detection on remote machines when streaming RTSP; for motion detection, 2000000 works good',
|
||||||
'type': 'number',
|
'type': 'number',
|
||||||
'min': 0,
|
'min': 1000000,
|
||||||
'max': 65535,
|
'max': 25000000,
|
||||||
'section': 'streaming',
|
'section': 'streaming',
|
||||||
'camera': True,
|
'camera': True,
|
||||||
'required': True,
|
'required': True,
|
||||||
@ -1218,4 +1315,3 @@ def seAuthMode():
|
|||||||
'set': _set_streameye_settings,
|
'set': _set_streameye_settings,
|
||||||
'get_set_dict': True
|
'get_set_dict': True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
118
board/raspberrypi3/motioneye-modules/streameyectl.py
Normal file → Executable file
118
board/raspberrypi3/motioneye-modules/streameyectl.py
Normal file → Executable file
@ -59,7 +59,7 @@ AWB_CHOICES = [
|
|||||||
('incandescent', 'Incandescent'),
|
('incandescent', 'Incandescent'),
|
||||||
('flash', 'Flash'),
|
('flash', 'Flash'),
|
||||||
('horizon', 'Horizon'),
|
('horizon', 'Horizon'),
|
||||||
('greyworld', 'Greyworld')
|
('greyworld', 'Greyworld')
|
||||||
]
|
]
|
||||||
|
|
||||||
METERING_CHOICES = [
|
METERING_CHOICES = [
|
||||||
@ -412,9 +412,13 @@ def _get_streameye_settings(camera_id):
|
|||||||
'seProto': 'mjpeg',
|
'seProto': 'mjpeg',
|
||||||
'seAuthMode': 'disabled',
|
'seAuthMode': 'disabled',
|
||||||
'sePort': 8081,
|
'sePort': 8081,
|
||||||
'seRTSPPort': 554
|
'seRTSPPort': 554,
|
||||||
|
'seMJPEGWidth': 640,
|
||||||
|
'seMJPEGHeight': 480,
|
||||||
|
'seMJPEGFramerate': 5,
|
||||||
|
'seMJPEGBitrate': 1000000
|
||||||
}
|
}
|
||||||
|
|
||||||
if os.path.exists(STREAMEYE_CONF):
|
if os.path.exists(STREAMEYE_CONF):
|
||||||
logging.debug('reading streameye settings from %s' % STREAMEYE_CONF)
|
logging.debug('reading streameye settings from %s' % STREAMEYE_CONF)
|
||||||
|
|
||||||
@ -442,15 +446,40 @@ def _get_streameye_settings(camera_id):
|
|||||||
if m:
|
if m:
|
||||||
s['seProto'] = m[0]
|
s['seProto'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_WIDTH="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGWidth'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_HEIGHT="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGHeight'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_FRAMERATE="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGFramerate'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_BITRATE="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGBitrate'] = m[0]
|
||||||
|
|
||||||
|
s['seMJPEGRes'] = '%sx%s' % (s.pop('seMJPEGWidth'), s.pop('seMJPEGHeight'))
|
||||||
|
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
|
||||||
def _set_streameye_settings(camera_id, s):
|
def _set_streameye_settings(camera_id, s):
|
||||||
s = dict(s)
|
s = dict(s)
|
||||||
|
s['seMJPEGWidth'] = int(s['seMJPEGRes'].split('x')[0])
|
||||||
|
s['seMJPEGHeight'] = int(s.pop('seMJPEGRes').split('x')[1])
|
||||||
|
|
||||||
s.setdefault('sePort', 8081)
|
s.setdefault('sePort', 8081)
|
||||||
s.setdefault('seRTSPPort', 554)
|
s.setdefault('seRTSPPort', 554)
|
||||||
s.setdefault('seAuthMode', 'disabled')
|
s.setdefault('seAuthMode', 'disabled')
|
||||||
|
s.setdefault('seMJPEGWidth', 640)
|
||||||
|
s.setdefault('seMJPEGHeight', 480)
|
||||||
|
s.setdefault('seMJPEGFramerate', 5)
|
||||||
|
s.setdefault('seMJPEGBitrate', 2000000)
|
||||||
|
|
||||||
main_config = config.get_main()
|
main_config = config.get_main()
|
||||||
username = main_config['@normal_username']
|
username = main_config['@normal_username']
|
||||||
password = main_config['@normal_password']
|
password = main_config['@normal_password']
|
||||||
@ -462,6 +491,10 @@ def _set_streameye_settings(camera_id, s):
|
|||||||
'PROTO="%s"' % s['seProto'],
|
'PROTO="%s"' % s['seProto'],
|
||||||
'PORT="%s"' % s['sePort'],
|
'PORT="%s"' % s['sePort'],
|
||||||
'RTSP_PORT="%s"' % s['seRTSPPort'],
|
'RTSP_PORT="%s"' % s['seRTSPPort'],
|
||||||
|
'MJPEG_WIDTH="%s"' % s['seMJPEGWidth'],
|
||||||
|
'MJPEG_HEIGHT="%s"' % s['seMJPEGHeight'],
|
||||||
|
'MJPEG_FRAMERATE="%s"' % s['seMJPEGFramerate'],
|
||||||
|
'MJPEG_BITRATE="%s"' % s['seMJPEGBitrate'],
|
||||||
'AUTH="%s"' % s['seAuthMode'],
|
'AUTH="%s"' % s['seAuthMode'],
|
||||||
'CREDENTIALS="%s:%s:%s"' % (username, password, realm)
|
'CREDENTIALS="%s:%s:%s"' % (username, password, realm)
|
||||||
]
|
]
|
||||||
@ -1158,6 +1191,27 @@ def seProto():
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seRTSPPort():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'Streaming RTSP Port',
|
||||||
|
'description': 'sets the TCP port on which the webcam streaming server listens',
|
||||||
|
'type': 'number',
|
||||||
|
'min': 0,
|
||||||
|
'max': 65535,
|
||||||
|
'section': 'streaming',
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@additional_config
|
@additional_config
|
||||||
def sePort():
|
def sePort():
|
||||||
if not _get_streameye_enabled():
|
if not _get_streameye_enabled():
|
||||||
@ -1172,7 +1226,6 @@ def sePort():
|
|||||||
'section': 'streaming',
|
'section': 'streaming',
|
||||||
'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
|
||||||
@ -1180,16 +1233,60 @@ def sePort():
|
|||||||
|
|
||||||
|
|
||||||
@additional_config
|
@additional_config
|
||||||
def seRTSPPort():
|
def seMJPEGRes():
|
||||||
if not _get_streameye_enabled():
|
if not _get_streameye_enabled():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'label': 'Streaming Port',
|
'label': 'MJPEG Resolution',
|
||||||
'description': 'sets the TCP port on which the webcam streaming server listens',
|
'description': 'the MJPEG resolution fed to the frontend and used for motion detection on remote machines when streaming RTSP',
|
||||||
|
'type': 'choices',
|
||||||
|
'choices': RESOLUTION_CHOICES,
|
||||||
|
'section': 'streaming',
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seMJPEGFramerate():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'MJPEG Frame Rate',
|
||||||
|
'description': 'the MJPEG Frame Rate fed to the frontend and used for motion detection on remote machines when streaming RTSP; for motion detection, 5 works good',
|
||||||
|
'type': 'range',
|
||||||
|
'min': 2,
|
||||||
|
'max': 30,
|
||||||
|
'snap': 0,
|
||||||
|
'ticks': "2|5|10|15|20|25|30",
|
||||||
|
'decimals': 0,
|
||||||
|
'section': 'streaming',
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seMJPEGBitrate():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'MJPEG Bitrate',
|
||||||
|
'description': 'the MJPEG Bitrate fed to the frontend and used for motion detection on remote machines when streaming RTSP; for motion detection, 2000000 works good',
|
||||||
'type': 'number',
|
'type': 'number',
|
||||||
'min': 0,
|
'min': 1000000,
|
||||||
'max': 65535,
|
'max': 25000000,
|
||||||
'section': 'streaming',
|
'section': 'streaming',
|
||||||
'camera': True,
|
'camera': True,
|
||||||
'required': True,
|
'required': True,
|
||||||
@ -1218,4 +1315,3 @@ def seAuthMode():
|
|||||||
'set': _set_streameye_settings,
|
'set': _set_streameye_settings,
|
||||||
'get_set_dict': True
|
'get_set_dict': True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
118
board/raspberrypi4/motioneye-modules/streameyectl.py
Normal file → Executable file
118
board/raspberrypi4/motioneye-modules/streameyectl.py
Normal file → Executable file
@ -59,7 +59,7 @@ AWB_CHOICES = [
|
|||||||
('incandescent', 'Incandescent'),
|
('incandescent', 'Incandescent'),
|
||||||
('flash', 'Flash'),
|
('flash', 'Flash'),
|
||||||
('horizon', 'Horizon'),
|
('horizon', 'Horizon'),
|
||||||
('greyworld', 'Greyworld')
|
('greyworld', 'Greyworld')
|
||||||
]
|
]
|
||||||
|
|
||||||
METERING_CHOICES = [
|
METERING_CHOICES = [
|
||||||
@ -412,9 +412,13 @@ def _get_streameye_settings(camera_id):
|
|||||||
'seProto': 'mjpeg',
|
'seProto': 'mjpeg',
|
||||||
'seAuthMode': 'disabled',
|
'seAuthMode': 'disabled',
|
||||||
'sePort': 8081,
|
'sePort': 8081,
|
||||||
'seRTSPPort': 554
|
'seRTSPPort': 554,
|
||||||
|
'seMJPEGWidth': 640,
|
||||||
|
'seMJPEGHeight': 480,
|
||||||
|
'seMJPEGFramerate': 5,
|
||||||
|
'seMJPEGBitrate': 1000000
|
||||||
}
|
}
|
||||||
|
|
||||||
if os.path.exists(STREAMEYE_CONF):
|
if os.path.exists(STREAMEYE_CONF):
|
||||||
logging.debug('reading streameye settings from %s' % STREAMEYE_CONF)
|
logging.debug('reading streameye settings from %s' % STREAMEYE_CONF)
|
||||||
|
|
||||||
@ -442,15 +446,40 @@ def _get_streameye_settings(camera_id):
|
|||||||
if m:
|
if m:
|
||||||
s['seProto'] = m[0]
|
s['seProto'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_WIDTH="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGWidth'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_HEIGHT="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGHeight'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_FRAMERATE="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGFramerate'] = m[0]
|
||||||
|
|
||||||
|
m = re.findall('^MJPEG_BITRATE="?(\w+)"?', line)
|
||||||
|
if m:
|
||||||
|
s['seMJPEGBitrate'] = m[0]
|
||||||
|
|
||||||
|
s['seMJPEGRes'] = '%sx%s' % (s.pop('seMJPEGWidth'), s.pop('seMJPEGHeight'))
|
||||||
|
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
|
||||||
def _set_streameye_settings(camera_id, s):
|
def _set_streameye_settings(camera_id, s):
|
||||||
s = dict(s)
|
s = dict(s)
|
||||||
|
s['seMJPEGWidth'] = int(s['seMJPEGRes'].split('x')[0])
|
||||||
|
s['seMJPEGHeight'] = int(s.pop('seMJPEGRes').split('x')[1])
|
||||||
|
|
||||||
s.setdefault('sePort', 8081)
|
s.setdefault('sePort', 8081)
|
||||||
s.setdefault('seRTSPPort', 554)
|
s.setdefault('seRTSPPort', 554)
|
||||||
s.setdefault('seAuthMode', 'disabled')
|
s.setdefault('seAuthMode', 'disabled')
|
||||||
|
s.setdefault('seMJPEGWidth', 640)
|
||||||
|
s.setdefault('seMJPEGHeight', 480)
|
||||||
|
s.setdefault('seMJPEGFramerate', 5)
|
||||||
|
s.setdefault('seMJPEGBitrate', 2000000)
|
||||||
|
|
||||||
main_config = config.get_main()
|
main_config = config.get_main()
|
||||||
username = main_config['@normal_username']
|
username = main_config['@normal_username']
|
||||||
password = main_config['@normal_password']
|
password = main_config['@normal_password']
|
||||||
@ -462,6 +491,10 @@ def _set_streameye_settings(camera_id, s):
|
|||||||
'PROTO="%s"' % s['seProto'],
|
'PROTO="%s"' % s['seProto'],
|
||||||
'PORT="%s"' % s['sePort'],
|
'PORT="%s"' % s['sePort'],
|
||||||
'RTSP_PORT="%s"' % s['seRTSPPort'],
|
'RTSP_PORT="%s"' % s['seRTSPPort'],
|
||||||
|
'MJPEG_WIDTH="%s"' % s['seMJPEGWidth'],
|
||||||
|
'MJPEG_HEIGHT="%s"' % s['seMJPEGHeight'],
|
||||||
|
'MJPEG_FRAMERATE="%s"' % s['seMJPEGFramerate'],
|
||||||
|
'MJPEG_BITRATE="%s"' % s['seMJPEGBitrate'],
|
||||||
'AUTH="%s"' % s['seAuthMode'],
|
'AUTH="%s"' % s['seAuthMode'],
|
||||||
'CREDENTIALS="%s:%s:%s"' % (username, password, realm)
|
'CREDENTIALS="%s:%s:%s"' % (username, password, realm)
|
||||||
]
|
]
|
||||||
@ -1158,6 +1191,27 @@ def seProto():
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seRTSPPort():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'Streaming RTSP Port',
|
||||||
|
'description': 'sets the TCP port on which the webcam streaming server listens',
|
||||||
|
'type': 'number',
|
||||||
|
'min': 0,
|
||||||
|
'max': 65535,
|
||||||
|
'section': 'streaming',
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@additional_config
|
@additional_config
|
||||||
def sePort():
|
def sePort():
|
||||||
if not _get_streameye_enabled():
|
if not _get_streameye_enabled():
|
||||||
@ -1172,7 +1226,6 @@ def sePort():
|
|||||||
'section': 'streaming',
|
'section': 'streaming',
|
||||||
'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
|
||||||
@ -1180,16 +1233,60 @@ def sePort():
|
|||||||
|
|
||||||
|
|
||||||
@additional_config
|
@additional_config
|
||||||
def seRTSPPort():
|
def seMJPEGRes():
|
||||||
if not _get_streameye_enabled():
|
if not _get_streameye_enabled():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'label': 'Streaming Port',
|
'label': 'MJPEG Resolution',
|
||||||
'description': 'sets the TCP port on which the webcam streaming server listens',
|
'description': 'the MJPEG resolution fed to the frontend and used for motion detection on remote machines when streaming RTSP',
|
||||||
|
'type': 'choices',
|
||||||
|
'choices': RESOLUTION_CHOICES,
|
||||||
|
'section': 'streaming',
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seMJPEGFramerate():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'MJPEG Frame Rate',
|
||||||
|
'description': 'the MJPEG Frame Rate fed to the frontend and used for motion detection on remote machines when streaming RTSP; for motion detection, 5 works good',
|
||||||
|
'type': 'range',
|
||||||
|
'min': 2,
|
||||||
|
'max': 30,
|
||||||
|
'snap': 0,
|
||||||
|
'ticks': "2|5|10|15|20|25|30",
|
||||||
|
'decimals': 0,
|
||||||
|
'section': 'streaming',
|
||||||
|
'camera': True,
|
||||||
|
'required': True,
|
||||||
|
'depends': ['seProto==rtsp'],
|
||||||
|
'get': _get_streameye_settings,
|
||||||
|
'set': _set_streameye_settings,
|
||||||
|
'get_set_dict': True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@additional_config
|
||||||
|
def seMJPEGBitrate():
|
||||||
|
if not _get_streameye_enabled():
|
||||||
|
return None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'label': 'MJPEG Bitrate',
|
||||||
|
'description': 'the MJPEG Bitrate fed to the frontend and used for motion detection on remote machines when streaming RTSP; for motion detection, 2000000 works good',
|
||||||
'type': 'number',
|
'type': 'number',
|
||||||
'min': 0,
|
'min': 1000000,
|
||||||
'max': 65535,
|
'max': 25000000,
|
||||||
'section': 'streaming',
|
'section': 'streaming',
|
||||||
'camera': True,
|
'camera': True,
|
||||||
'required': True,
|
'required': True,
|
||||||
@ -1218,4 +1315,3 @@ def seAuthMode():
|
|||||||
'set': _set_streameye_settings,
|
'set': _set_streameye_settings,
|
||||||
'get_set_dict': True
|
'get_set_dict': True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user