From 1dfff736aa4eb57bf3626aac980327bf178fb619 Mon Sep 17 00:00:00 2001 From: Joo Aun Saw Date: Thu, 24 Oct 2019 10:59:40 +1100 Subject: [PATCH 1/6] motion: do not encode nal as first frame --- ...000-do-not-encode-nal-as-first-frame.patch | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 package/motion/2000-do-not-encode-nal-as-first-frame.patch diff --git a/package/motion/2000-do-not-encode-nal-as-first-frame.patch b/package/motion/2000-do-not-encode-nal-as-first-frame.patch new file mode 100644 index 0000000000..e637311f03 --- /dev/null +++ b/package/motion/2000-do-not-encode-nal-as-first-frame.patch @@ -0,0 +1,75 @@ +commit 6c47f0cded1ef1f119f91f2c6f572d6620776dff +Author: Joo Aun Saw +Date: Wed Oct 23 10:45:13 2019 +1100 + + ffmpeg: do not encode NAL as the first video frame + +diff --git a/src/ffmpeg.c b/src/ffmpeg.c +index 3af961a..76f3824 100644 +--- a/src/ffmpeg.c ++++ b/src/ffmpeg.c +@@ -192,16 +192,17 @@ static void ffmpeg_free_nal(struct ffmpeg *ffmpeg){ + } + } + +-static void ffmpeg_encode_nal(struct ffmpeg *ffmpeg){ ++static int ffmpeg_encode_nal(struct ffmpeg *ffmpeg){ + // h264_v4l2m2m has NAL units separated from the first frame, which makes + // some players very unhappy. + if ((ffmpeg->pkt.pts == 0) && (!(ffmpeg->pkt.flags & AV_PKT_FLAG_KEY))) { + ffmpeg_free_nal(ffmpeg); + ffmpeg->nal_info_len = ffmpeg->pkt.size; + ffmpeg->nal_info = malloc(ffmpeg->nal_info_len); +- if (ffmpeg->nal_info) ++ if (ffmpeg->nal_info) { + memcpy(ffmpeg->nal_info, &ffmpeg->pkt.data[0], ffmpeg->nal_info_len); +- else ++ return 1; ++ } else + ffmpeg->nal_info_len = 0; + } else if (ffmpeg->nal_info) { + int old_size = ffmpeg->pkt.size; +@@ -210,6 +211,7 @@ static void ffmpeg_encode_nal(struct ffmpeg *ffmpeg){ + memcpy(&ffmpeg->pkt.data[0], ffmpeg->nal_info, ffmpeg->nal_info_len); + ffmpeg_free_nal(ffmpeg); + } ++ return 0; + } + + static int ffmpeg_timelapse_exists(const char *fname){ +@@ -463,7 +465,10 @@ static int ffmpeg_encode_video(struct ffmpeg *ffmpeg){ + } + + if (ffmpeg->preferred_codec == USER_CODEC_V4L2M2M){ +- ffmpeg_encode_nal(ffmpeg); ++ if (ffmpeg_encode_nal(ffmpeg)) { ++ // Throw special return code ++ return -2; ++ } + } + + return 0; +@@ -489,7 +494,10 @@ static int ffmpeg_encode_video(struct ffmpeg *ffmpeg){ + + /* This kills compiler warnings. Nal setting is only for recent ffmpeg versions*/ + if (ffmpeg->preferred_codec == USER_CODEC_V4L2M2M){ +- ffmpeg_encode_nal(ffmpeg); ++ if (ffmpeg_encode_nal(ffmpeg)) { ++ // Throw special return code ++ return -2; ++ } + } + + return 0; +@@ -529,7 +537,10 @@ static int ffmpeg_encode_video(struct ffmpeg *ffmpeg){ + + /* This kills compiler warnings. Nal setting is only for recent ffmpeg versions*/ + if (ffmpeg->preferred_codec == USER_CODEC_V4L2M2M){ +- ffmpeg_encode_nal(ffmpeg); ++ if (ffmpeg_encode_nal(ffmpeg)) { ++ // Throw special return code ++ return -2; ++ } + } + + return 0; From 341121d8ca6acf4f3521af6f7c5d12bc2ab890c8 Mon Sep 17 00:00:00 2001 From: Joo Aun Saw Date: Thu, 24 Oct 2019 10:59:58 +1100 Subject: [PATCH 2/6] motion: fix video initial pts --- .../motion/2001-fix-video-initial-pts.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 package/motion/2001-fix-video-initial-pts.patch diff --git a/package/motion/2001-fix-video-initial-pts.patch b/package/motion/2001-fix-video-initial-pts.patch new file mode 100644 index 0000000000..b827cc0a41 --- /dev/null +++ b/package/motion/2001-fix-video-initial-pts.patch @@ -0,0 +1,19 @@ +commit 54030816e03a31b8af3c53132636bb9bb97b0673 +Author: Joo Aun Saw +Date: Wed Oct 23 00:55:31 2019 +1100 + + use current frame timestamp as movie initial PTS reference point + +diff --git a/src/motion.c b/src/motion.c +index e394c19..9d3cd24 100644 +--- a/src/motion.c ++++ b/src/motion.c +@@ -536,7 +536,7 @@ static void motion_detected(struct context *cnt, int dev, struct image_data *img + + /* EVENT_FIRSTMOTION triggers on_event_start_command and event_ffmpeg_newfile */ + event(cnt, EVENT_FIRSTMOTION, img, NULL, NULL, +- &cnt->imgs.image_ring[cnt->imgs.image_ring_out].timestamp_tv); ++ &img->timestamp_tv); + + MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, _("Motion detected - starting event %d"), + cnt->event_nr); From b0166b054c5fa2eff198aa67ed8545c20a7ae408 Mon Sep 17 00:00:00 2001 From: Joo Aun Saw Date: Mon, 28 Oct 2019 00:39:17 +1100 Subject: [PATCH 3/6] fnc rtsp: limit max resolution --- .../motioneye-modules/streameyectl.py | 48 ++++++++++++++++++- .../raspberrypi/overlay/usr/bin/streameye.sh | 8 ++++ .../motioneye-modules/streameyectl.py | 48 ++++++++++++++++++- .../raspberrypi2/overlay/usr/bin/streameye.sh | 8 ++++ .../motioneye-modules/streameyectl.py | 48 ++++++++++++++++++- .../raspberrypi3/overlay/usr/bin/streameye.sh | 8 ++++ .../motioneye-modules/streameyectl.py | 48 ++++++++++++++++++- .../raspberrypi4/overlay/usr/bin/streameye.sh | 8 ++++ 8 files changed, 220 insertions(+), 4 deletions(-) diff --git a/board/raspberrypi/motioneye-modules/streameyectl.py b/board/raspberrypi/motioneye-modules/streameyectl.py index 2a83fac414..c08a6a844e 100755 --- a/board/raspberrypi/motioneye-modules/streameyectl.py +++ b/board/raspberrypi/motioneye-modules/streameyectl.py @@ -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 diff --git a/board/raspberrypi/overlay/usr/bin/streameye.sh b/board/raspberrypi/overlay/usr/bin/streameye.sh index bb642cb8ac..6c9c26549d 100755 --- a/board/raspberrypi/overlay/usr/bin/streameye.sh +++ b/board/raspberrypi/overlay/usr/bin/streameye.sh @@ -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}" diff --git a/board/raspberrypi2/motioneye-modules/streameyectl.py b/board/raspberrypi2/motioneye-modules/streameyectl.py index 2a83fac414..c08a6a844e 100755 --- a/board/raspberrypi2/motioneye-modules/streameyectl.py +++ b/board/raspberrypi2/motioneye-modules/streameyectl.py @@ -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 diff --git a/board/raspberrypi2/overlay/usr/bin/streameye.sh b/board/raspberrypi2/overlay/usr/bin/streameye.sh index bb642cb8ac..6c9c26549d 100755 --- a/board/raspberrypi2/overlay/usr/bin/streameye.sh +++ b/board/raspberrypi2/overlay/usr/bin/streameye.sh @@ -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}" diff --git a/board/raspberrypi3/motioneye-modules/streameyectl.py b/board/raspberrypi3/motioneye-modules/streameyectl.py index 2a83fac414..c08a6a844e 100755 --- a/board/raspberrypi3/motioneye-modules/streameyectl.py +++ b/board/raspberrypi3/motioneye-modules/streameyectl.py @@ -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 diff --git a/board/raspberrypi3/overlay/usr/bin/streameye.sh b/board/raspberrypi3/overlay/usr/bin/streameye.sh index bb642cb8ac..6c9c26549d 100755 --- a/board/raspberrypi3/overlay/usr/bin/streameye.sh +++ b/board/raspberrypi3/overlay/usr/bin/streameye.sh @@ -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}" diff --git a/board/raspberrypi4/motioneye-modules/streameyectl.py b/board/raspberrypi4/motioneye-modules/streameyectl.py index 2a83fac414..c08a6a844e 100755 --- a/board/raspberrypi4/motioneye-modules/streameyectl.py +++ b/board/raspberrypi4/motioneye-modules/streameyectl.py @@ -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 diff --git a/board/raspberrypi4/overlay/usr/bin/streameye.sh b/board/raspberrypi4/overlay/usr/bin/streameye.sh index bb642cb8ac..6c9c26549d 100755 --- a/board/raspberrypi4/overlay/usr/bin/streameye.sh +++ b/board/raspberrypi4/overlay/usr/bin/streameye.sh @@ -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}" From 76dd55cc66827aa897ae5c1275b10d5696a0dea7 Mon Sep 17 00:00:00 2001 From: Joo Aun Saw Date: Mon, 28 Oct 2019 00:58:45 +1100 Subject: [PATCH 4/6] fnc rtsp: fix resolution not restored from config file --- board/raspberrypi/motioneye-modules/streameyectl.py | 10 +++++----- board/raspberrypi/overlay/usr/bin/streameye.sh | 4 ++-- board/raspberrypi2/motioneye-modules/streameyectl.py | 10 +++++----- board/raspberrypi2/overlay/usr/bin/streameye.sh | 4 ++-- board/raspberrypi3/motioneye-modules/streameyectl.py | 10 +++++----- board/raspberrypi3/overlay/usr/bin/streameye.sh | 4 ++-- board/raspberrypi4/motioneye-modules/streameyectl.py | 10 +++++----- board/raspberrypi4/overlay/usr/bin/streameye.sh | 4 ++-- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/board/raspberrypi/motioneye-modules/streameyectl.py b/board/raspberrypi/motioneye-modules/streameyectl.py index c08a6a844e..07fc5576b9 100755 --- a/board/raspberrypi/motioneye-modules/streameyectl.py +++ b/board/raspberrypi/motioneye-modules/streameyectl.py @@ -332,8 +332,8 @@ def _get_raspimjpeg_settings(camera_id): 'imxfx': 'none', 'width': 640, 'height': 480, - 'rtsp_width': 640, - 'rtsp_height': 480, + 'rtspWidth': 640, + 'rtspHeight': 480, 'rotation': 0, 'vflip': False, 'hflip': False, @@ -395,7 +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['rtspResolution'] = '%sx%s' % (s.pop('rtspWidth'), s.pop('rtspHeight')) s = dict(('se' + n[0].upper() + n[1:], v) for (n, v) in s.items()) @@ -407,8 +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['rtspWidth'] = int(s['rtspResolution'].split('x')[0]) + s['rtspHeight'] = int(s.pop('rtspResolution').split('x')[1]) s['zoom'] = '%.2f,%.2f,%.2f,%.2f' % ( s.pop('zoomx') / 100.0, s.pop('zoomy') / 100.0, diff --git a/board/raspberrypi/overlay/usr/bin/streameye.sh b/board/raspberrypi/overlay/usr/bin/streameye.sh index 6c9c26549d..9dc9992776 100755 --- a/board/raspberrypi/overlay/usr/bin/streameye.sh +++ b/board/raspberrypi/overlay/usr/bin/streameye.sh @@ -130,11 +130,11 @@ function start() { raspimjpeg_opts="${raspimjpeg_opts} --${line}" done < ${RASPIMJPEG_CONF} - video_height=$(grep -e ^rtsp_height ${RASPIMJPEG_CONF} | cut -d ' ' -f 2) + video_height=$(grep -e ^rtspHeight ${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) + video_width=$(grep -e ^rtspWidth ${RASPIMJPEG_CONF} | cut -d ' ' -f 2) if [ -n "${video_width}" ]; then raspimjpeg_opts="${raspimjpeg_opts} --width ${video_width}" fi diff --git a/board/raspberrypi2/motioneye-modules/streameyectl.py b/board/raspberrypi2/motioneye-modules/streameyectl.py index c08a6a844e..07fc5576b9 100755 --- a/board/raspberrypi2/motioneye-modules/streameyectl.py +++ b/board/raspberrypi2/motioneye-modules/streameyectl.py @@ -332,8 +332,8 @@ def _get_raspimjpeg_settings(camera_id): 'imxfx': 'none', 'width': 640, 'height': 480, - 'rtsp_width': 640, - 'rtsp_height': 480, + 'rtspWidth': 640, + 'rtspHeight': 480, 'rotation': 0, 'vflip': False, 'hflip': False, @@ -395,7 +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['rtspResolution'] = '%sx%s' % (s.pop('rtspWidth'), s.pop('rtspHeight')) s = dict(('se' + n[0].upper() + n[1:], v) for (n, v) in s.items()) @@ -407,8 +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['rtspWidth'] = int(s['rtspResolution'].split('x')[0]) + s['rtspHeight'] = int(s.pop('rtspResolution').split('x')[1]) s['zoom'] = '%.2f,%.2f,%.2f,%.2f' % ( s.pop('zoomx') / 100.0, s.pop('zoomy') / 100.0, diff --git a/board/raspberrypi2/overlay/usr/bin/streameye.sh b/board/raspberrypi2/overlay/usr/bin/streameye.sh index 6c9c26549d..9dc9992776 100755 --- a/board/raspberrypi2/overlay/usr/bin/streameye.sh +++ b/board/raspberrypi2/overlay/usr/bin/streameye.sh @@ -130,11 +130,11 @@ function start() { raspimjpeg_opts="${raspimjpeg_opts} --${line}" done < ${RASPIMJPEG_CONF} - video_height=$(grep -e ^rtsp_height ${RASPIMJPEG_CONF} | cut -d ' ' -f 2) + video_height=$(grep -e ^rtspHeight ${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) + video_width=$(grep -e ^rtspWidth ${RASPIMJPEG_CONF} | cut -d ' ' -f 2) if [ -n "${video_width}" ]; then raspimjpeg_opts="${raspimjpeg_opts} --width ${video_width}" fi diff --git a/board/raspberrypi3/motioneye-modules/streameyectl.py b/board/raspberrypi3/motioneye-modules/streameyectl.py index c08a6a844e..07fc5576b9 100755 --- a/board/raspberrypi3/motioneye-modules/streameyectl.py +++ b/board/raspberrypi3/motioneye-modules/streameyectl.py @@ -332,8 +332,8 @@ def _get_raspimjpeg_settings(camera_id): 'imxfx': 'none', 'width': 640, 'height': 480, - 'rtsp_width': 640, - 'rtsp_height': 480, + 'rtspWidth': 640, + 'rtspHeight': 480, 'rotation': 0, 'vflip': False, 'hflip': False, @@ -395,7 +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['rtspResolution'] = '%sx%s' % (s.pop('rtspWidth'), s.pop('rtspHeight')) s = dict(('se' + n[0].upper() + n[1:], v) for (n, v) in s.items()) @@ -407,8 +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['rtspWidth'] = int(s['rtspResolution'].split('x')[0]) + s['rtspHeight'] = int(s.pop('rtspResolution').split('x')[1]) s['zoom'] = '%.2f,%.2f,%.2f,%.2f' % ( s.pop('zoomx') / 100.0, s.pop('zoomy') / 100.0, diff --git a/board/raspberrypi3/overlay/usr/bin/streameye.sh b/board/raspberrypi3/overlay/usr/bin/streameye.sh index 6c9c26549d..9dc9992776 100755 --- a/board/raspberrypi3/overlay/usr/bin/streameye.sh +++ b/board/raspberrypi3/overlay/usr/bin/streameye.sh @@ -130,11 +130,11 @@ function start() { raspimjpeg_opts="${raspimjpeg_opts} --${line}" done < ${RASPIMJPEG_CONF} - video_height=$(grep -e ^rtsp_height ${RASPIMJPEG_CONF} | cut -d ' ' -f 2) + video_height=$(grep -e ^rtspHeight ${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) + video_width=$(grep -e ^rtspWidth ${RASPIMJPEG_CONF} | cut -d ' ' -f 2) if [ -n "${video_width}" ]; then raspimjpeg_opts="${raspimjpeg_opts} --width ${video_width}" fi diff --git a/board/raspberrypi4/motioneye-modules/streameyectl.py b/board/raspberrypi4/motioneye-modules/streameyectl.py index c08a6a844e..07fc5576b9 100755 --- a/board/raspberrypi4/motioneye-modules/streameyectl.py +++ b/board/raspberrypi4/motioneye-modules/streameyectl.py @@ -332,8 +332,8 @@ def _get_raspimjpeg_settings(camera_id): 'imxfx': 'none', 'width': 640, 'height': 480, - 'rtsp_width': 640, - 'rtsp_height': 480, + 'rtspWidth': 640, + 'rtspHeight': 480, 'rotation': 0, 'vflip': False, 'hflip': False, @@ -395,7 +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['rtspResolution'] = '%sx%s' % (s.pop('rtspWidth'), s.pop('rtspHeight')) s = dict(('se' + n[0].upper() + n[1:], v) for (n, v) in s.items()) @@ -407,8 +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['rtspWidth'] = int(s['rtspResolution'].split('x')[0]) + s['rtspHeight'] = int(s.pop('rtspResolution').split('x')[1]) s['zoom'] = '%.2f,%.2f,%.2f,%.2f' % ( s.pop('zoomx') / 100.0, s.pop('zoomy') / 100.0, diff --git a/board/raspberrypi4/overlay/usr/bin/streameye.sh b/board/raspberrypi4/overlay/usr/bin/streameye.sh index 6c9c26549d..9dc9992776 100755 --- a/board/raspberrypi4/overlay/usr/bin/streameye.sh +++ b/board/raspberrypi4/overlay/usr/bin/streameye.sh @@ -130,11 +130,11 @@ function start() { raspimjpeg_opts="${raspimjpeg_opts} --${line}" done < ${RASPIMJPEG_CONF} - video_height=$(grep -e ^rtsp_height ${RASPIMJPEG_CONF} | cut -d ' ' -f 2) + video_height=$(grep -e ^rtspHeight ${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) + video_width=$(grep -e ^rtspWidth ${RASPIMJPEG_CONF} | cut -d ' ' -f 2) if [ -n "${video_width}" ]; then raspimjpeg_opts="${raspimjpeg_opts} --width ${video_width}" fi From afe04651916bc72c2edc76476267dc4dbcaf732c Mon Sep 17 00:00:00 2001 From: Joo Aun Saw Date: Mon, 28 Oct 2019 10:18:49 +1100 Subject: [PATCH 5/6] fnc rtsp: do not use mjpeg resolution config when in rtsp mode --- board/raspberrypi/overlay/usr/bin/streameye.sh | 2 +- board/raspberrypi2/overlay/usr/bin/streameye.sh | 2 +- board/raspberrypi3/overlay/usr/bin/streameye.sh | 2 +- board/raspberrypi4/overlay/usr/bin/streameye.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/board/raspberrypi/overlay/usr/bin/streameye.sh b/board/raspberrypi/overlay/usr/bin/streameye.sh index 9dc9992776..bc13ae2a45 100755 --- a/board/raspberrypi/overlay/usr/bin/streameye.sh +++ b/board/raspberrypi/overlay/usr/bin/streameye.sh @@ -114,7 +114,7 @@ function start() { fi modprobe v4l2loopback video_nr=${vidid} if [ -e "${video_path}" ]; then - valid_opts=("analoggain" "awb" "awbgains" "bitrate" "brightness" "colfx" "contrast" "denoise" "digitalgain" "drc" "ev" "exposure" "flicker" "framerate" "height" "hflip" "imxfx" "intra" "irefresh" "level" "metering" "profile" "roi" "rotation" "saturation" "sharpness" "shutter" "vflip" "vstab" "width" "mjpegbitrate" "mjpegframerate" "mjpegwidth" "mjpegheight") + valid_opts=("analoggain" "awb" "awbgains" "bitrate" "brightness" "colfx" "contrast" "denoise" "digitalgain" "drc" "ev" "exposure" "flicker" "framerate" "hflip" "imxfx" "intra" "irefresh" "level" "metering" "profile" "roi" "rotation" "saturation" "sharpness" "shutter" "vflip" "vstab" "mjpegbitrate" "mjpegframerate" "mjpegwidth" "mjpegheight") raspimjpeg_opts="--videoout ${video_path}" while read line; do key=$(echo ${line} | cut -d ' ' -f 1) diff --git a/board/raspberrypi2/overlay/usr/bin/streameye.sh b/board/raspberrypi2/overlay/usr/bin/streameye.sh index 9dc9992776..bc13ae2a45 100755 --- a/board/raspberrypi2/overlay/usr/bin/streameye.sh +++ b/board/raspberrypi2/overlay/usr/bin/streameye.sh @@ -114,7 +114,7 @@ function start() { fi modprobe v4l2loopback video_nr=${vidid} if [ -e "${video_path}" ]; then - valid_opts=("analoggain" "awb" "awbgains" "bitrate" "brightness" "colfx" "contrast" "denoise" "digitalgain" "drc" "ev" "exposure" "flicker" "framerate" "height" "hflip" "imxfx" "intra" "irefresh" "level" "metering" "profile" "roi" "rotation" "saturation" "sharpness" "shutter" "vflip" "vstab" "width" "mjpegbitrate" "mjpegframerate" "mjpegwidth" "mjpegheight") + valid_opts=("analoggain" "awb" "awbgains" "bitrate" "brightness" "colfx" "contrast" "denoise" "digitalgain" "drc" "ev" "exposure" "flicker" "framerate" "hflip" "imxfx" "intra" "irefresh" "level" "metering" "profile" "roi" "rotation" "saturation" "sharpness" "shutter" "vflip" "vstab" "mjpegbitrate" "mjpegframerate" "mjpegwidth" "mjpegheight") raspimjpeg_opts="--videoout ${video_path}" while read line; do key=$(echo ${line} | cut -d ' ' -f 1) diff --git a/board/raspberrypi3/overlay/usr/bin/streameye.sh b/board/raspberrypi3/overlay/usr/bin/streameye.sh index 9dc9992776..bc13ae2a45 100755 --- a/board/raspberrypi3/overlay/usr/bin/streameye.sh +++ b/board/raspberrypi3/overlay/usr/bin/streameye.sh @@ -114,7 +114,7 @@ function start() { fi modprobe v4l2loopback video_nr=${vidid} if [ -e "${video_path}" ]; then - valid_opts=("analoggain" "awb" "awbgains" "bitrate" "brightness" "colfx" "contrast" "denoise" "digitalgain" "drc" "ev" "exposure" "flicker" "framerate" "height" "hflip" "imxfx" "intra" "irefresh" "level" "metering" "profile" "roi" "rotation" "saturation" "sharpness" "shutter" "vflip" "vstab" "width" "mjpegbitrate" "mjpegframerate" "mjpegwidth" "mjpegheight") + valid_opts=("analoggain" "awb" "awbgains" "bitrate" "brightness" "colfx" "contrast" "denoise" "digitalgain" "drc" "ev" "exposure" "flicker" "framerate" "hflip" "imxfx" "intra" "irefresh" "level" "metering" "profile" "roi" "rotation" "saturation" "sharpness" "shutter" "vflip" "vstab" "mjpegbitrate" "mjpegframerate" "mjpegwidth" "mjpegheight") raspimjpeg_opts="--videoout ${video_path}" while read line; do key=$(echo ${line} | cut -d ' ' -f 1) diff --git a/board/raspberrypi4/overlay/usr/bin/streameye.sh b/board/raspberrypi4/overlay/usr/bin/streameye.sh index 9dc9992776..bc13ae2a45 100755 --- a/board/raspberrypi4/overlay/usr/bin/streameye.sh +++ b/board/raspberrypi4/overlay/usr/bin/streameye.sh @@ -114,7 +114,7 @@ function start() { fi modprobe v4l2loopback video_nr=${vidid} if [ -e "${video_path}" ]; then - valid_opts=("analoggain" "awb" "awbgains" "bitrate" "brightness" "colfx" "contrast" "denoise" "digitalgain" "drc" "ev" "exposure" "flicker" "framerate" "height" "hflip" "imxfx" "intra" "irefresh" "level" "metering" "profile" "roi" "rotation" "saturation" "sharpness" "shutter" "vflip" "vstab" "width" "mjpegbitrate" "mjpegframerate" "mjpegwidth" "mjpegheight") + valid_opts=("analoggain" "awb" "awbgains" "bitrate" "brightness" "colfx" "contrast" "denoise" "digitalgain" "drc" "ev" "exposure" "flicker" "framerate" "hflip" "imxfx" "intra" "irefresh" "level" "metering" "profile" "roi" "rotation" "saturation" "sharpness" "shutter" "vflip" "vstab" "mjpegbitrate" "mjpegframerate" "mjpegwidth" "mjpegheight") raspimjpeg_opts="--videoout ${video_path}" while read line; do key=$(echo ${line} | cut -d ' ' -f 1) From 49cd141cf1eca31330d84be9c7cef55e5f0c5aa9 Mon Sep 17 00:00:00 2001 From: Joo Aun Saw Date: Wed, 30 Oct 2019 11:49:33 +1100 Subject: [PATCH 6/6] motion: upgrade to latest version --- ...000-do-not-encode-nal-as-first-frame.patch | 75 ------------------- .../motion/2001-fix-video-initial-pts.patch | 19 ----- package/motion/motion.hash | 2 +- package/motion/motion.mk | 2 +- 4 files changed, 2 insertions(+), 96 deletions(-) delete mode 100644 package/motion/2000-do-not-encode-nal-as-first-frame.patch delete mode 100644 package/motion/2001-fix-video-initial-pts.patch diff --git a/package/motion/2000-do-not-encode-nal-as-first-frame.patch b/package/motion/2000-do-not-encode-nal-as-first-frame.patch deleted file mode 100644 index e637311f03..0000000000 --- a/package/motion/2000-do-not-encode-nal-as-first-frame.patch +++ /dev/null @@ -1,75 +0,0 @@ -commit 6c47f0cded1ef1f119f91f2c6f572d6620776dff -Author: Joo Aun Saw -Date: Wed Oct 23 10:45:13 2019 +1100 - - ffmpeg: do not encode NAL as the first video frame - -diff --git a/src/ffmpeg.c b/src/ffmpeg.c -index 3af961a..76f3824 100644 ---- a/src/ffmpeg.c -+++ b/src/ffmpeg.c -@@ -192,16 +192,17 @@ static void ffmpeg_free_nal(struct ffmpeg *ffmpeg){ - } - } - --static void ffmpeg_encode_nal(struct ffmpeg *ffmpeg){ -+static int ffmpeg_encode_nal(struct ffmpeg *ffmpeg){ - // h264_v4l2m2m has NAL units separated from the first frame, which makes - // some players very unhappy. - if ((ffmpeg->pkt.pts == 0) && (!(ffmpeg->pkt.flags & AV_PKT_FLAG_KEY))) { - ffmpeg_free_nal(ffmpeg); - ffmpeg->nal_info_len = ffmpeg->pkt.size; - ffmpeg->nal_info = malloc(ffmpeg->nal_info_len); -- if (ffmpeg->nal_info) -+ if (ffmpeg->nal_info) { - memcpy(ffmpeg->nal_info, &ffmpeg->pkt.data[0], ffmpeg->nal_info_len); -- else -+ return 1; -+ } else - ffmpeg->nal_info_len = 0; - } else if (ffmpeg->nal_info) { - int old_size = ffmpeg->pkt.size; -@@ -210,6 +211,7 @@ static void ffmpeg_encode_nal(struct ffmpeg *ffmpeg){ - memcpy(&ffmpeg->pkt.data[0], ffmpeg->nal_info, ffmpeg->nal_info_len); - ffmpeg_free_nal(ffmpeg); - } -+ return 0; - } - - static int ffmpeg_timelapse_exists(const char *fname){ -@@ -463,7 +465,10 @@ static int ffmpeg_encode_video(struct ffmpeg *ffmpeg){ - } - - if (ffmpeg->preferred_codec == USER_CODEC_V4L2M2M){ -- ffmpeg_encode_nal(ffmpeg); -+ if (ffmpeg_encode_nal(ffmpeg)) { -+ // Throw special return code -+ return -2; -+ } - } - - return 0; -@@ -489,7 +494,10 @@ static int ffmpeg_encode_video(struct ffmpeg *ffmpeg){ - - /* This kills compiler warnings. Nal setting is only for recent ffmpeg versions*/ - if (ffmpeg->preferred_codec == USER_CODEC_V4L2M2M){ -- ffmpeg_encode_nal(ffmpeg); -+ if (ffmpeg_encode_nal(ffmpeg)) { -+ // Throw special return code -+ return -2; -+ } - } - - return 0; -@@ -529,7 +537,10 @@ static int ffmpeg_encode_video(struct ffmpeg *ffmpeg){ - - /* This kills compiler warnings. Nal setting is only for recent ffmpeg versions*/ - if (ffmpeg->preferred_codec == USER_CODEC_V4L2M2M){ -- ffmpeg_encode_nal(ffmpeg); -+ if (ffmpeg_encode_nal(ffmpeg)) { -+ // Throw special return code -+ return -2; -+ } - } - - return 0; diff --git a/package/motion/2001-fix-video-initial-pts.patch b/package/motion/2001-fix-video-initial-pts.patch deleted file mode 100644 index b827cc0a41..0000000000 --- a/package/motion/2001-fix-video-initial-pts.patch +++ /dev/null @@ -1,19 +0,0 @@ -commit 54030816e03a31b8af3c53132636bb9bb97b0673 -Author: Joo Aun Saw -Date: Wed Oct 23 00:55:31 2019 +1100 - - use current frame timestamp as movie initial PTS reference point - -diff --git a/src/motion.c b/src/motion.c -index e394c19..9d3cd24 100644 ---- a/src/motion.c -+++ b/src/motion.c -@@ -536,7 +536,7 @@ static void motion_detected(struct context *cnt, int dev, struct image_data *img - - /* EVENT_FIRSTMOTION triggers on_event_start_command and event_ffmpeg_newfile */ - event(cnt, EVENT_FIRSTMOTION, img, NULL, NULL, -- &cnt->imgs.image_ring[cnt->imgs.image_ring_out].timestamp_tv); -+ &img->timestamp_tv); - - MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, _("Motion detected - starting event %d"), - cnt->event_nr); diff --git a/package/motion/motion.hash b/package/motion/motion.hash index dcc8cae6e1..31b2cd735d 100644 --- a/package/motion/motion.hash +++ b/package/motion/motion.hash @@ -1,5 +1,5 @@ # locally computed hash sha256 2074b935bdfe28f84c2c3233274b06908336778f303bb13530d4299c3f8aa4e2 motion-release-4.1.1.tar.gz sha256 c8d40976b41da8eb9f9f7128599403a312fc26b7226bf3787d75f78cb5a6cc6e motion-release-4.2.2.tar.gz -sha256 dba1d32c9a777f4e822d26ded25f24072b7234c70dc9850f8ea61564c0a8eca5 motion-5c8ac5282b3e980270555c1d2c6f710829a2856e.tar.gz +sha256 3cd3492701f8a097ac9f594e4235417c10e0a5f92d591cd2a8f3f86efca4c64c motion-8f18946261ebee45a33ce423c9154b0f94997b51.tar.gz diff --git a/package/motion/motion.mk b/package/motion/motion.mk index 8919cbef6a..dc2d26cba0 100644 --- a/package/motion/motion.mk +++ b/package/motion/motion.mk @@ -4,7 +4,7 @@ # ################################################################################ -MOTION_VERSION = 5c8ac5282b3e980270555c1d2c6f710829a2856e +MOTION_VERSION = 8f18946261ebee45a33ce423c9154b0f94997b51 MOTION_SITE = $(call github,Motion-Project,motion,$(MOTION_VERSION)) MOTION_AUTORECONF = YES MOTION_DEPENDENCIES = host-pkgconf ffmpeg jpeg libmicrohttpd