mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 05:36:32 +00:00
fnc rtsp: limit max resolution
This commit is contained in:
parent
dfe313bd9f
commit
b0166b054c
@ -124,6 +124,27 @@ RESOLUTION_CHOICES = [
|
||||
('3280x2464', '3280x2464')
|
||||
]
|
||||
|
||||
RTSP_RESOLUTION_CHOICES = [
|
||||
('320x200', '320x200'),
|
||||
('320x240', '320x240'),
|
||||
('640x480', '640x480'),
|
||||
('800x480', '800x480'),
|
||||
('800x600', '800x600'),
|
||||
('1024x576', '1024x576'),
|
||||
('1024x768', '1024x768'),
|
||||
('1280x720', '1280x720'),
|
||||
('1280x800', '1280x800'),
|
||||
('1280x960', '1280x960'),
|
||||
('1280x1024', '1280x1024'),
|
||||
('1296x972', '1296x972'),
|
||||
('1440x960', '1440x960'),
|
||||
('1440x1024', '1440x1024'),
|
||||
('1600x1200', '1600x1200'),
|
||||
('1640x922', '1640x922'),
|
||||
('1640x1232', '1640x1232'),
|
||||
('1920x1080', '1920x1080')
|
||||
]
|
||||
|
||||
ROTATION_CHOICES = [
|
||||
('0', '0°'),
|
||||
('90', '90°'),
|
||||
@ -311,6 +332,8 @@ def _get_raspimjpeg_settings(camera_id):
|
||||
'imxfx': 'none',
|
||||
'width': 640,
|
||||
'height': 480,
|
||||
'rtsp_width': 640,
|
||||
'rtsp_height': 480,
|
||||
'rotation': 0,
|
||||
'vflip': False,
|
||||
'hflip': False,
|
||||
@ -372,6 +395,7 @@ def _get_raspimjpeg_settings(camera_id):
|
||||
s['sharpness'] = (s['sharpness'] + 100) / 2
|
||||
|
||||
s['resolution'] = '%sx%s' % (s.pop('width'), s.pop('height'))
|
||||
s['rtspResolution'] = '%sx%s' % (s.pop('rtsp_width'), s.pop('rtsp_height'))
|
||||
|
||||
s = dict(('se' + n[0].upper() + n[1:], v) for (n, v) in s.items())
|
||||
|
||||
@ -383,6 +407,8 @@ def _set_raspimjpeg_settings(camera_id, s):
|
||||
|
||||
s['width'] = int(s['resolution'].split('x')[0])
|
||||
s['height'] = int(s.pop('resolution').split('x')[1])
|
||||
s['rtsp_width'] = int(s['rtspResolution'].split('x')[0])
|
||||
s['rtsp_height'] = int(s.pop('rtspResolution').split('x')[1])
|
||||
|
||||
s['zoom'] = '%.2f,%.2f,%.2f,%.2f' % (
|
||||
s.pop('zoomx') / 100.0, s.pop('zoomy') / 100.0,
|
||||
@ -705,13 +731,33 @@ def seResolution():
|
||||
return None
|
||||
|
||||
return {
|
||||
'label': 'Video Resolution',
|
||||
'label': 'MJPEG Video Resolution',
|
||||
'description': 'the video resolution (larger values produce better quality but require more CPU power, larger storage space and bandwidth)',
|
||||
'type': 'choices',
|
||||
'choices': RESOLUTION_CHOICES,
|
||||
'section': 'device',
|
||||
'camera': True,
|
||||
'required': True,
|
||||
'depends': ['seProto==mjpeg'],
|
||||
'get': _get_raspimjpeg_settings,
|
||||
'set': _set_raspimjpeg_settings,
|
||||
'get_set_dict': True
|
||||
}
|
||||
|
||||
@additional_config
|
||||
def seRtspResolution():
|
||||
if not _get_streameye_enabled():
|
||||
return None
|
||||
|
||||
return {
|
||||
'label': 'RTSP Video Resolution',
|
||||
'description': 'the video resolution (larger values produce better quality but require more CPU power, larger storage space and bandwidth)',
|
||||
'type': 'choices',
|
||||
'choices': RTSP_RESOLUTION_CHOICES,
|
||||
'section': 'device',
|
||||
'camera': True,
|
||||
'required': True,
|
||||
'depends': ['seProto==rtsp'],
|
||||
'get': _get_raspimjpeg_settings,
|
||||
'set': _set_raspimjpeg_settings,
|
||||
'get_set_dict': True
|
||||
|
@ -130,6 +130,14 @@ function start() {
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --${line}"
|
||||
done < ${RASPIMJPEG_CONF}
|
||||
|
||||
video_height=$(grep -e ^rtsp_height ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
if [ -n "${video_height}" ]; then
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --height ${video_height}"
|
||||
fi
|
||||
video_width=$(grep -e ^rtsp_width ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
if [ -n "${video_width}" ]; then
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --width ${video_width}"
|
||||
fi
|
||||
video_iso=$(grep -e ^iso ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
if [ -n "${video_iso}" ]; then
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --ISO ${video_iso}"
|
||||
|
@ -124,6 +124,27 @@ RESOLUTION_CHOICES = [
|
||||
('3280x2464', '3280x2464')
|
||||
]
|
||||
|
||||
RTSP_RESOLUTION_CHOICES = [
|
||||
('320x200', '320x200'),
|
||||
('320x240', '320x240'),
|
||||
('640x480', '640x480'),
|
||||
('800x480', '800x480'),
|
||||
('800x600', '800x600'),
|
||||
('1024x576', '1024x576'),
|
||||
('1024x768', '1024x768'),
|
||||
('1280x720', '1280x720'),
|
||||
('1280x800', '1280x800'),
|
||||
('1280x960', '1280x960'),
|
||||
('1280x1024', '1280x1024'),
|
||||
('1296x972', '1296x972'),
|
||||
('1440x960', '1440x960'),
|
||||
('1440x1024', '1440x1024'),
|
||||
('1600x1200', '1600x1200'),
|
||||
('1640x922', '1640x922'),
|
||||
('1640x1232', '1640x1232'),
|
||||
('1920x1080', '1920x1080')
|
||||
]
|
||||
|
||||
ROTATION_CHOICES = [
|
||||
('0', '0°'),
|
||||
('90', '90°'),
|
||||
@ -311,6 +332,8 @@ def _get_raspimjpeg_settings(camera_id):
|
||||
'imxfx': 'none',
|
||||
'width': 640,
|
||||
'height': 480,
|
||||
'rtsp_width': 640,
|
||||
'rtsp_height': 480,
|
||||
'rotation': 0,
|
||||
'vflip': False,
|
||||
'hflip': False,
|
||||
@ -372,6 +395,7 @@ def _get_raspimjpeg_settings(camera_id):
|
||||
s['sharpness'] = (s['sharpness'] + 100) / 2
|
||||
|
||||
s['resolution'] = '%sx%s' % (s.pop('width'), s.pop('height'))
|
||||
s['rtspResolution'] = '%sx%s' % (s.pop('rtsp_width'), s.pop('rtsp_height'))
|
||||
|
||||
s = dict(('se' + n[0].upper() + n[1:], v) for (n, v) in s.items())
|
||||
|
||||
@ -383,6 +407,8 @@ def _set_raspimjpeg_settings(camera_id, s):
|
||||
|
||||
s['width'] = int(s['resolution'].split('x')[0])
|
||||
s['height'] = int(s.pop('resolution').split('x')[1])
|
||||
s['rtsp_width'] = int(s['rtspResolution'].split('x')[0])
|
||||
s['rtsp_height'] = int(s.pop('rtspResolution').split('x')[1])
|
||||
|
||||
s['zoom'] = '%.2f,%.2f,%.2f,%.2f' % (
|
||||
s.pop('zoomx') / 100.0, s.pop('zoomy') / 100.0,
|
||||
@ -705,13 +731,33 @@ def seResolution():
|
||||
return None
|
||||
|
||||
return {
|
||||
'label': 'Video Resolution',
|
||||
'label': 'MJPEG Video Resolution',
|
||||
'description': 'the video resolution (larger values produce better quality but require more CPU power, larger storage space and bandwidth)',
|
||||
'type': 'choices',
|
||||
'choices': RESOLUTION_CHOICES,
|
||||
'section': 'device',
|
||||
'camera': True,
|
||||
'required': True,
|
||||
'depends': ['seProto==mjpeg'],
|
||||
'get': _get_raspimjpeg_settings,
|
||||
'set': _set_raspimjpeg_settings,
|
||||
'get_set_dict': True
|
||||
}
|
||||
|
||||
@additional_config
|
||||
def seRtspResolution():
|
||||
if not _get_streameye_enabled():
|
||||
return None
|
||||
|
||||
return {
|
||||
'label': 'RTSP Video Resolution',
|
||||
'description': 'the video resolution (larger values produce better quality but require more CPU power, larger storage space and bandwidth)',
|
||||
'type': 'choices',
|
||||
'choices': RTSP_RESOLUTION_CHOICES,
|
||||
'section': 'device',
|
||||
'camera': True,
|
||||
'required': True,
|
||||
'depends': ['seProto==rtsp'],
|
||||
'get': _get_raspimjpeg_settings,
|
||||
'set': _set_raspimjpeg_settings,
|
||||
'get_set_dict': True
|
||||
|
@ -130,6 +130,14 @@ function start() {
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --${line}"
|
||||
done < ${RASPIMJPEG_CONF}
|
||||
|
||||
video_height=$(grep -e ^rtsp_height ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
if [ -n "${video_height}" ]; then
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --height ${video_height}"
|
||||
fi
|
||||
video_width=$(grep -e ^rtsp_width ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
if [ -n "${video_width}" ]; then
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --width ${video_width}"
|
||||
fi
|
||||
video_iso=$(grep -e ^iso ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
if [ -n "${video_iso}" ]; then
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --ISO ${video_iso}"
|
||||
|
@ -124,6 +124,27 @@ RESOLUTION_CHOICES = [
|
||||
('3280x2464', '3280x2464')
|
||||
]
|
||||
|
||||
RTSP_RESOLUTION_CHOICES = [
|
||||
('320x200', '320x200'),
|
||||
('320x240', '320x240'),
|
||||
('640x480', '640x480'),
|
||||
('800x480', '800x480'),
|
||||
('800x600', '800x600'),
|
||||
('1024x576', '1024x576'),
|
||||
('1024x768', '1024x768'),
|
||||
('1280x720', '1280x720'),
|
||||
('1280x800', '1280x800'),
|
||||
('1280x960', '1280x960'),
|
||||
('1280x1024', '1280x1024'),
|
||||
('1296x972', '1296x972'),
|
||||
('1440x960', '1440x960'),
|
||||
('1440x1024', '1440x1024'),
|
||||
('1600x1200', '1600x1200'),
|
||||
('1640x922', '1640x922'),
|
||||
('1640x1232', '1640x1232'),
|
||||
('1920x1080', '1920x1080')
|
||||
]
|
||||
|
||||
ROTATION_CHOICES = [
|
||||
('0', '0°'),
|
||||
('90', '90°'),
|
||||
@ -311,6 +332,8 @@ def _get_raspimjpeg_settings(camera_id):
|
||||
'imxfx': 'none',
|
||||
'width': 640,
|
||||
'height': 480,
|
||||
'rtsp_width': 640,
|
||||
'rtsp_height': 480,
|
||||
'rotation': 0,
|
||||
'vflip': False,
|
||||
'hflip': False,
|
||||
@ -372,6 +395,7 @@ def _get_raspimjpeg_settings(camera_id):
|
||||
s['sharpness'] = (s['sharpness'] + 100) / 2
|
||||
|
||||
s['resolution'] = '%sx%s' % (s.pop('width'), s.pop('height'))
|
||||
s['rtspResolution'] = '%sx%s' % (s.pop('rtsp_width'), s.pop('rtsp_height'))
|
||||
|
||||
s = dict(('se' + n[0].upper() + n[1:], v) for (n, v) in s.items())
|
||||
|
||||
@ -383,6 +407,8 @@ def _set_raspimjpeg_settings(camera_id, s):
|
||||
|
||||
s['width'] = int(s['resolution'].split('x')[0])
|
||||
s['height'] = int(s.pop('resolution').split('x')[1])
|
||||
s['rtsp_width'] = int(s['rtspResolution'].split('x')[0])
|
||||
s['rtsp_height'] = int(s.pop('rtspResolution').split('x')[1])
|
||||
|
||||
s['zoom'] = '%.2f,%.2f,%.2f,%.2f' % (
|
||||
s.pop('zoomx') / 100.0, s.pop('zoomy') / 100.0,
|
||||
@ -705,13 +731,33 @@ def seResolution():
|
||||
return None
|
||||
|
||||
return {
|
||||
'label': 'Video Resolution',
|
||||
'label': 'MJPEG Video Resolution',
|
||||
'description': 'the video resolution (larger values produce better quality but require more CPU power, larger storage space and bandwidth)',
|
||||
'type': 'choices',
|
||||
'choices': RESOLUTION_CHOICES,
|
||||
'section': 'device',
|
||||
'camera': True,
|
||||
'required': True,
|
||||
'depends': ['seProto==mjpeg'],
|
||||
'get': _get_raspimjpeg_settings,
|
||||
'set': _set_raspimjpeg_settings,
|
||||
'get_set_dict': True
|
||||
}
|
||||
|
||||
@additional_config
|
||||
def seRtspResolution():
|
||||
if not _get_streameye_enabled():
|
||||
return None
|
||||
|
||||
return {
|
||||
'label': 'RTSP Video Resolution',
|
||||
'description': 'the video resolution (larger values produce better quality but require more CPU power, larger storage space and bandwidth)',
|
||||
'type': 'choices',
|
||||
'choices': RTSP_RESOLUTION_CHOICES,
|
||||
'section': 'device',
|
||||
'camera': True,
|
||||
'required': True,
|
||||
'depends': ['seProto==rtsp'],
|
||||
'get': _get_raspimjpeg_settings,
|
||||
'set': _set_raspimjpeg_settings,
|
||||
'get_set_dict': True
|
||||
|
@ -130,6 +130,14 @@ function start() {
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --${line}"
|
||||
done < ${RASPIMJPEG_CONF}
|
||||
|
||||
video_height=$(grep -e ^rtsp_height ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
if [ -n "${video_height}" ]; then
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --height ${video_height}"
|
||||
fi
|
||||
video_width=$(grep -e ^rtsp_width ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
if [ -n "${video_width}" ]; then
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --width ${video_width}"
|
||||
fi
|
||||
video_iso=$(grep -e ^iso ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
if [ -n "${video_iso}" ]; then
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --ISO ${video_iso}"
|
||||
|
@ -124,6 +124,27 @@ RESOLUTION_CHOICES = [
|
||||
('3280x2464', '3280x2464')
|
||||
]
|
||||
|
||||
RTSP_RESOLUTION_CHOICES = [
|
||||
('320x200', '320x200'),
|
||||
('320x240', '320x240'),
|
||||
('640x480', '640x480'),
|
||||
('800x480', '800x480'),
|
||||
('800x600', '800x600'),
|
||||
('1024x576', '1024x576'),
|
||||
('1024x768', '1024x768'),
|
||||
('1280x720', '1280x720'),
|
||||
('1280x800', '1280x800'),
|
||||
('1280x960', '1280x960'),
|
||||
('1280x1024', '1280x1024'),
|
||||
('1296x972', '1296x972'),
|
||||
('1440x960', '1440x960'),
|
||||
('1440x1024', '1440x1024'),
|
||||
('1600x1200', '1600x1200'),
|
||||
('1640x922', '1640x922'),
|
||||
('1640x1232', '1640x1232'),
|
||||
('1920x1080', '1920x1080')
|
||||
]
|
||||
|
||||
ROTATION_CHOICES = [
|
||||
('0', '0°'),
|
||||
('90', '90°'),
|
||||
@ -311,6 +332,8 @@ def _get_raspimjpeg_settings(camera_id):
|
||||
'imxfx': 'none',
|
||||
'width': 640,
|
||||
'height': 480,
|
||||
'rtsp_width': 640,
|
||||
'rtsp_height': 480,
|
||||
'rotation': 0,
|
||||
'vflip': False,
|
||||
'hflip': False,
|
||||
@ -372,6 +395,7 @@ def _get_raspimjpeg_settings(camera_id):
|
||||
s['sharpness'] = (s['sharpness'] + 100) / 2
|
||||
|
||||
s['resolution'] = '%sx%s' % (s.pop('width'), s.pop('height'))
|
||||
s['rtspResolution'] = '%sx%s' % (s.pop('rtsp_width'), s.pop('rtsp_height'))
|
||||
|
||||
s = dict(('se' + n[0].upper() + n[1:], v) for (n, v) in s.items())
|
||||
|
||||
@ -383,6 +407,8 @@ def _set_raspimjpeg_settings(camera_id, s):
|
||||
|
||||
s['width'] = int(s['resolution'].split('x')[0])
|
||||
s['height'] = int(s.pop('resolution').split('x')[1])
|
||||
s['rtsp_width'] = int(s['rtspResolution'].split('x')[0])
|
||||
s['rtsp_height'] = int(s.pop('rtspResolution').split('x')[1])
|
||||
|
||||
s['zoom'] = '%.2f,%.2f,%.2f,%.2f' % (
|
||||
s.pop('zoomx') / 100.0, s.pop('zoomy') / 100.0,
|
||||
@ -705,13 +731,33 @@ def seResolution():
|
||||
return None
|
||||
|
||||
return {
|
||||
'label': 'Video Resolution',
|
||||
'label': 'MJPEG Video Resolution',
|
||||
'description': 'the video resolution (larger values produce better quality but require more CPU power, larger storage space and bandwidth)',
|
||||
'type': 'choices',
|
||||
'choices': RESOLUTION_CHOICES,
|
||||
'section': 'device',
|
||||
'camera': True,
|
||||
'required': True,
|
||||
'depends': ['seProto==mjpeg'],
|
||||
'get': _get_raspimjpeg_settings,
|
||||
'set': _set_raspimjpeg_settings,
|
||||
'get_set_dict': True
|
||||
}
|
||||
|
||||
@additional_config
|
||||
def seRtspResolution():
|
||||
if not _get_streameye_enabled():
|
||||
return None
|
||||
|
||||
return {
|
||||
'label': 'RTSP Video Resolution',
|
||||
'description': 'the video resolution (larger values produce better quality but require more CPU power, larger storage space and bandwidth)',
|
||||
'type': 'choices',
|
||||
'choices': RTSP_RESOLUTION_CHOICES,
|
||||
'section': 'device',
|
||||
'camera': True,
|
||||
'required': True,
|
||||
'depends': ['seProto==rtsp'],
|
||||
'get': _get_raspimjpeg_settings,
|
||||
'set': _set_raspimjpeg_settings,
|
||||
'get_set_dict': True
|
||||
|
@ -130,6 +130,14 @@ function start() {
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --${line}"
|
||||
done < ${RASPIMJPEG_CONF}
|
||||
|
||||
video_height=$(grep -e ^rtsp_height ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
if [ -n "${video_height}" ]; then
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --height ${video_height}"
|
||||
fi
|
||||
video_width=$(grep -e ^rtsp_width ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
if [ -n "${video_width}" ]; then
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --width ${video_width}"
|
||||
fi
|
||||
video_iso=$(grep -e ^iso ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
if [ -n "${video_iso}" ]; then
|
||||
raspimjpeg_opts="${raspimjpeg_opts} --ISO ${video_iso}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user