diff --git a/board/common/overlay/usr/bin/motion b/board/common/overlay/usr/bin/motion deleted file mode 100755 index aaad5bcba4..0000000000 --- a/board/common/overlay/usr/bin/motion +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -MOTION_SVN="/usr/bin/motion-svn" -MOTION_MRDAVE="/usr/bin/motion-mrdave" - -motion=$MOTION_MRDAVE - -echo "using motion binary $motion" - -exec $motion "$@" - diff --git a/configs/bananapi_defconfig b/configs/bananapi_defconfig index da762e6179..4d9d6b1159 100644 --- a/configs/bananapi_defconfig +++ b/configs/bananapi_defconfig @@ -36,7 +36,6 @@ BR2_PACKAGE_FFMPEG_NONFREE=y BR2_PACKAGE_FFMPEG_SWSCALE=y BR2_PACKAGE_LIBWEBCAM=y BR2_PACKAGE_MOTION=y -BR2_PACKAGE_MOTION_MRDAVE=y BR2_PACKAGE_GZIP=y BR2_PACKAGE_CIFS_UTILS=y # BR2_PACKAGE_E2FSPROGS_BADBLOCKS is not set diff --git a/configs/cubietruck_defconfig b/configs/cubietruck_defconfig index 4ec228642f..e4c0b8d605 100644 --- a/configs/cubietruck_defconfig +++ b/configs/cubietruck_defconfig @@ -36,7 +36,6 @@ BR2_PACKAGE_FFMPEG_NONFREE=y BR2_PACKAGE_FFMPEG_SWSCALE=y BR2_PACKAGE_LIBWEBCAM=y BR2_PACKAGE_MOTION=y -BR2_PACKAGE_MOTION_MRDAVE=y BR2_PACKAGE_GZIP=y BR2_PACKAGE_CIFS_UTILS=y # BR2_PACKAGE_E2FSPROGS_BADBLOCKS is not set diff --git a/configs/odroidc1_defconfig b/configs/odroidc1_defconfig index 804be1b71a..1589a0ed1b 100644 --- a/configs/odroidc1_defconfig +++ b/configs/odroidc1_defconfig @@ -40,7 +40,6 @@ BR2_PACKAGE_FFMPEG_GPL=y BR2_PACKAGE_FFMPEG_NONFREE=y BR2_PACKAGE_FFMPEG_SWSCALE=y BR2_PACKAGE_MOTION=y -BR2_PACKAGE_MOTION_MRDAVE=y BR2_PACKAGE_GZIP=y BR2_PACKAGE_CIFS_UTILS=y # BR2_PACKAGE_E2FSPROGS_BADBLOCKS is not set diff --git a/configs/odroidc2_defconfig b/configs/odroidc2_defconfig index 496ba15db6..090bf77454 100644 --- a/configs/odroidc2_defconfig +++ b/configs/odroidc2_defconfig @@ -29,7 +29,6 @@ BR2_PACKAGE_FFMPEG_GPL=y BR2_PACKAGE_FFMPEG_NONFREE=y BR2_PACKAGE_FFMPEG_SWSCALE=y BR2_PACKAGE_MOTION=y -BR2_PACKAGE_MOTION_MRDAVE=y BR2_PACKAGE_GZIP=y BR2_PACKAGE_CIFS_UTILS=y # BR2_PACKAGE_E2FSPROGS_BADBLOCKS is not set diff --git a/configs/odroidxu4_defconfig b/configs/odroidxu4_defconfig index 2625a3801f..f603222b49 100644 --- a/configs/odroidxu4_defconfig +++ b/configs/odroidxu4_defconfig @@ -31,7 +31,6 @@ BR2_PACKAGE_FFMPEG_GPL=y BR2_PACKAGE_FFMPEG_NONFREE=y BR2_PACKAGE_FFMPEG_SWSCALE=y BR2_PACKAGE_MOTION=y -BR2_PACKAGE_MOTION_MRDAVE=y BR2_PACKAGE_GZIP=y BR2_PACKAGE_CIFS_UTILS=y # BR2_PACKAGE_E2FSPROGS_BADBLOCKS is not set diff --git a/configs/raspberrypi2_defconfig b/configs/raspberrypi2_defconfig index 92fb66e7b8..d3a1332bd1 100644 --- a/configs/raspberrypi2_defconfig +++ b/configs/raspberrypi2_defconfig @@ -35,7 +35,6 @@ BR2_PACKAGE_FFMPEG_SWSCALE=y BR2_PACKAGE_LIBWEBCAM=y BR2_PACKAGE_MOTION=y BR2_PACKAGE_MOTION_MMAL=y -BR2_PACKAGE_MOTION_MRDAVE=y BR2_PACKAGE_STREAMEYE=y BR2_PACKAGE_GZIP=y BR2_PACKAGE_CIFS_UTILS=y diff --git a/configs/raspberrypi3_defconfig b/configs/raspberrypi3_defconfig index 65c8243857..02aaabbb1f 100644 --- a/configs/raspberrypi3_defconfig +++ b/configs/raspberrypi3_defconfig @@ -35,7 +35,6 @@ BR2_PACKAGE_FFMPEG_SWSCALE=y BR2_PACKAGE_LIBWEBCAM=y BR2_PACKAGE_MOTION=y BR2_PACKAGE_MOTION_MMAL=y -BR2_PACKAGE_MOTION_MRDAVE=y BR2_PACKAGE_STREAMEYE=y BR2_PACKAGE_GZIP=y BR2_PACKAGE_CIFS_UTILS=y diff --git a/configs/raspberrypi_defconfig b/configs/raspberrypi_defconfig index 75391ab10c..ad64dba719 100644 --- a/configs/raspberrypi_defconfig +++ b/configs/raspberrypi_defconfig @@ -34,7 +34,6 @@ BR2_PACKAGE_FFMPEG_SWSCALE=y BR2_PACKAGE_LIBWEBCAM=y BR2_PACKAGE_MOTION=y BR2_PACKAGE_MOTION_MMAL=y -BR2_PACKAGE_MOTION_MRDAVE=y BR2_PACKAGE_STREAMEYE=y BR2_PACKAGE_GZIP=y BR2_PACKAGE_CIFS_UTILS=y diff --git a/package/Config.in b/package/Config.in index 7fc43f64f7..c56b13c510 100644 --- a/package/Config.in +++ b/package/Config.in @@ -28,7 +28,6 @@ menu "Audio and video applications" source "package/mjpegtools/Config.in" source "package/motion/Config.in" source "package/motion-mmal/Config.in" - source "package/motion-mrdave/Config.in" source "package/modplugtools/Config.in" source "package/mpd/Config.in" source "package/mpd-mpc/Config.in" diff --git a/package/motion-mrdave/001-h264-crf-from-vbr.patch b/package/motion-mrdave/001-h264-crf-from-vbr.patch deleted file mode 100644 index 26bf800035..0000000000 --- a/package/motion-mrdave/001-h264-crf-from-vbr.patch +++ /dev/null @@ -1,75 +0,0 @@ -From e65ea2454d6dcc759e2f4fd38548f6844a2c820b Mon Sep 17 00:00:00 2001 -From: Calin Crisan -Date: Sun, 3 Jul 2016 19:49:06 +0300 -Subject: [PATCH 1/3] h264 codec: set crf option based on configured vbr - ---- - ffmpeg.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/ffmpeg.c b/ffmpeg.c -index df2b47e..ed192ca 100644 ---- a/ffmpeg.c -+++ b/ffmpeg.c -@@ -295,7 +295,11 @@ struct ffmpeg *ffmpeg_open(char *ffmpeg_video_codec, char *filename, - if (c->codec_id == MY_CODEC_ID_H264 || - c->codec_id == MY_CODEC_ID_HEVC){ - av_dict_set(&opts, "preset", "ultrafast", 0); -- av_dict_set(&opts, "crf", "18", 0); -+ -+ /* transforrm vbr (2 - 31) into crf (0 - 51) by scaling */ -+ char crf[4]; -+ snprintf(crf, 4, "%d", (int) ((vbr - 2) * 1.758)); -+ - av_dict_set(&opts, "tune", "zerolatency", 0); - } - if (strcmp(ffmpeg_video_codec, "ffv1") == 0) c->strict_std_compliance = -2; - -From b4138ee0ddc8a7b76b82eb1c80e5d5216dfcb8ce Mon Sep 17 00:00:00 2001 -From: Calin Crisan -Date: Wed, 6 Jul 2016 16:58:09 +0300 -Subject: [PATCH 2/3] h264 codec: fixed crf from vbr: the vbr range is actually - 1 to 32767 - ---- - ffmpeg.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/ffmpeg.c b/ffmpeg.c -index ed192ca..0f80a09 100644 ---- a/ffmpeg.c -+++ b/ffmpeg.c -@@ -296,9 +296,9 @@ struct ffmpeg *ffmpeg_open(char *ffmpeg_video_codec, char *filename, - c->codec_id == MY_CODEC_ID_HEVC){ - av_dict_set(&opts, "preset", "ultrafast", 0); - -- /* transforrm vbr (2 - 31) into crf (0 - 51) by scaling */ -+ /* transform vbr (1 - 32767) into crf (0 - 51) by scaling */ - char crf[4]; -- snprintf(crf, 4, "%d", (int) ((vbr - 2) * 1.758)); -+ snprintf(crf, 4, "%d", (int) ((vbr - 1) * 51.0 / 32766)); - - av_dict_set(&opts, "tune", "zerolatency", 0); - } - -From 675b4befb339e23a74615a1c64ecdd51470e824e Mon Sep 17 00:00:00 2001 -From: Calin Crisan -Date: Sun, 17 Jul 2016 16:51:27 +0300 -Subject: [PATCH 3/3] ffmpeg/h264: actually pass the crf value to the options - ---- - ffmpeg.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/ffmpeg.c b/ffmpeg.c -index 0f80a09..b21572a 100644 ---- a/ffmpeg.c -+++ b/ffmpeg.c -@@ -300,6 +300,7 @@ struct ffmpeg *ffmpeg_open(char *ffmpeg_video_codec, char *filename, - char crf[4]; - snprintf(crf, 4, "%d", (int) ((vbr - 1) * 51.0 / 32766)); - -+ av_dict_set(&opts, "crf", crf, 0); - av_dict_set(&opts, "tune", "zerolatency", 0); - } - if (strcmp(ffmpeg_video_codec, "ffv1") == 0) c->strict_std_compliance = -2; diff --git a/package/motion-mrdave/002-mask-resizing-support.patch b/package/motion-mrdave/002-mask-resizing-support.patch deleted file mode 100644 index 75d94ce182..0000000000 --- a/package/motion-mrdave/002-mask-resizing-support.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 787fad43fe1ef9e80b23a8ee7542ad5f5906e7ec Mon Sep 17 00:00:00 2001 -From: Calin Crisan -Date: Sat, 17 Sep 2016 21:18:46 +0300 -Subject: [PATCH] automatically resize mask image if size differs from that of - the captured image - ---- - motion_guide.html | 4 ++-- - picture.c | 43 ++++++++++++++++++++++++++++--------------- - 2 files changed, 30 insertions(+), 17 deletions(-) - -diff --git a/motion_guide.html b/motion_guide.html -index e127b2c..4526324 100644 ---- a/motion_guide.html -+++ b/motion_guide.html -@@ -2559,8 +2559,8 @@ - -

- The full path and filename for the masking pgm file. --This picture MUST have the same width and height as the frames being --captured and be in binary format. -+If needed, the mask will be resized to match the width and height of the frames being -+captured. - If you have one or more areas of the camera image in which you do NOT want motion detected (e.g. a tree that - moves in the wind or a corner of the picture where you can see cars/pedestrians passing by) you need a mask file. - This file is a picture that you create in your favorite photo editing program. The areas that you want detected must -diff --git a/picture.c b/picture.c -index 81be8f3..7ca4d7e 100644 ---- a/picture.c -+++ b/picture.c -@@ -963,9 +963,9 @@ void put_picture(struct context *cnt, char *file, unsigned char *image, int ftyp - */ - unsigned char *get_pgm(FILE *picture, int width, int height) - { -- int x = 0 , y = 0, maxval; -+ int x, y, mask_width, mask_height, maxval; - char line[256]; -- unsigned char *image; -+ unsigned char *image, *resized_image; - - line[255] = 0; - -@@ -986,18 +986,12 @@ unsigned char *get_pgm(FILE *picture, int width, int height) - if (!fgets(line, 255, picture)) - return NULL; - -- /* Check size */ -- if (sscanf(line, "%d %d", &x, &y) != 2) { -+ /* Read image size */ -+ if (sscanf(line, "%d %d", &mask_width, &mask_height) != 2) { - MOTION_LOG(ERR, TYPE_ALL, SHOW_ERRNO, "%s: Failed reading size in pgm file"); - return NULL; - } - -- if (x != width || y != height) { -- MOTION_LOG(ERR, TYPE_ALL, SHOW_ERRNO, "%s: Wrong image size %dx%d should be %dx%d", -- x, y, width, height); -- return NULL; -- } -- - /* Maximum value */ - line[0] = '#'; - while (line[0] == '#') -@@ -1011,15 +1005,34 @@ unsigned char *get_pgm(FILE *picture, int width, int height) - - /* Read data */ - -- image = mymalloc(width * height); -+ image = mymalloc(mask_width * mask_height); - -- for (y = 0; y < height; y++) { -- if ((int)fread(&image[y * width], 1, width, picture) != width) -+ for (y = 0; y < mask_height; y++) { -+ if ((int)fread(&image[y * mask_width], 1, mask_width, picture) != mask_width) - MOTION_LOG(ERR, TYPE_ALL, SHOW_ERRNO, "%s: Failed reading image data from pgm file"); - -- for (x = 0; x < width; x++) -- image[y * width + x] = (int)image[y * width + x] * 255 / maxval; -+ for (x = 0; x < mask_width; x++) -+ image[y * mask_width + x] = (int)image[y * mask_width + x] * 255 / maxval; -+ -+ } -+ -+ /* Resize mask if required */ -+ if (mask_width != width || mask_height != height) { -+ MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "%s: Mask needs resizing from %dx%d to %dx%d", -+ mask_width, mask_height, width, height); -+ -+ resized_image = mymalloc(width * height); -+ -+ for (y = 0; y < height; y++) { -+ for (x = 0; x < width; x++) { -+ resized_image[y * width + x] = image[ -+ (mask_height - 1) * y / (height - 1) * mask_width + -+ (mask_width - 1) * x / (width - 1)]; -+ } -+ } - -+ free(image); -+ image = resized_image; - } - - return image; diff --git a/package/motion-mrdave/Config.in b/package/motion-mrdave/Config.in deleted file mode 100644 index ca5c9f9624..0000000000 --- a/package/motion-mrdave/Config.in +++ /dev/null @@ -1,2 +0,0 @@ -config BR2_PACKAGE_MOTION_MRDAVE - bool "motion-mrdave" diff --git a/package/motion-mrdave/motion-mrdave.mk b/package/motion-mrdave/motion-mrdave.mk deleted file mode 100644 index 84d0c4a0b4..0000000000 --- a/package/motion-mrdave/motion-mrdave.mk +++ /dev/null @@ -1,18 +0,0 @@ -################################################################################ -# -# motion-mrdave -# -################################################################################ - -MOTION_MRDAVE_VERSION = 2caced3 -MOTION_MRDAVE_SITE = $(call github,mr-dave,motion,$(MOTION_MRDAVE_VERSION)) -MOTION_MRDAVE_AUTORECONF = YES -MOTION_MRDAVE_CONF_OPTS = --without-pgsql --without-sdl --without-sqlite3 --without-mysql --with-ffmpeg=$(STAGING_DIR)/usr/lib \ - --with-ffmpeg-headers=$(STAGING_DIR)/usr/include - -define MOTION_MRDAVE_INSTALL_TARGET_CMDS - cp $(@D)/motion $(TARGET_DIR)/usr/bin/motion-mrdave -endef - -$(eval $(autotools-package)) - diff --git a/package/motion/motion.mk b/package/motion/motion.mk index d082b3195a..f3815e37a4 100644 --- a/package/motion/motion.mk +++ b/package/motion/motion.mk @@ -4,14 +4,15 @@ # ################################################################################ -MOTION_SITE = http://www.lavrsen.dk/svn/motion/trunk -MOTION_SITE_METHOD = svn -MOTION_VERSION = r561 +MOTION_VERSION = 37b3595 +MOTION_SITE = $(call github,motion-project,motion,$(MOTION_VERSION)) +MOTION_AUTORECONF = YES MOTION_CONF_OPTS = --without-pgsql --without-sdl --without-sqlite3 --without-mysql --with-ffmpeg=$(STAGING_DIR)/usr/lib \ --with-ffmpeg-headers=$(STAGING_DIR)/usr/include define MOTION_INSTALL_TARGET_CMDS - cp $(@D)/motion $(TARGET_DIR)/usr/bin/motion-svn + cp $(@D)/motion $(TARGET_DIR)/usr/bin/motion endef $(eval $(autotools-package)) +