Here's an update for motion, I can't test it because my webcam no longer works on my machine ("uvideo0: could not open VS pipe: INVAL", same for motion and video(1)).
If anyone has a working installation could you give it a spin and report back please? Brooktree support is merged into the main package now. Index: Makefile =================================================================== RCS file: /cvs/ports/multimedia/motion/Makefile,v retrieving revision 1.14 diff -u -p -r1.14 Makefile --- Makefile 5 Jan 2018 05:12:27 -0000 1.14 +++ Makefile 5 Jan 2018 13:51:01 -0000 @@ -1,12 +1,11 @@ # $OpenBSD: Makefile,v 1.14 2018/01/05 05:12:27 bentley Exp $ +V= 4.1.1 COMMENT= motion detection software for video GH_ACCOUNT= Motion-Project GH_PROJECT= motion -GH_COMMIT= 9b4c16cae0ea77950cc156a9c82947ac51825f68 -V= 3.4.1 -REVISION= 4 +GH_TAGNAME= release-$V DISTNAME= motion-$V CATEGORIES= multimedia @@ -18,10 +17,13 @@ MAINTAINER= Stuart Henderson <sthen@open # GPL (according to source files, v2 only. website says v2+). PERMIT_PACKAGE_CDROM= Yes -WANTLIB += SDL avcodec avformat avutil c jpeg m pthread sqlite3 swscale +WANTLIB += avcodec avdevice avformat avutil c jpeg m pthread sqlite3 swscale FLAVOR?= -FLAVORS= bktr mysql pgsql +FLAVORS= mysql pgsql + +FLAVOR_COMMA= ${FLAVOR_EXT:S/-/,/g} +SUBST_VARS= FLAVOR_COMMA LIB_DEPENDS= databases/sqlite3 \ graphics/jpeg \ @@ -40,10 +42,6 @@ CONFIGURE_ARGS= --without-optimizecpu \ LDFLAGS="-L${LOCALBASE}/lib" \ CPPFLAGS="-I${LOCALBASE}/include" -.if ${FLAVOR:L:Mbktr} -CONFIGURE_ARGS+= --without-v4l -.endif - .if ${FLAVOR:L:Mmysql} LIB_DEPENDS+= databases/mariadb WANTLIB+= lib/mysql/mysqlclient z @@ -61,9 +59,6 @@ CONFIGURE_ARGS+= --without-pgsql NO_TEST= Yes -post-extract: - printf '#!/bin/sh\necho -n "$V-Git-${GH_COMMIT:C/[0-9a-f]{33}$//}"\n' > ${WRKSRC}/version.sh - post-patch: cd ${WRKSRC} && AUTOCONF_VERSION=${AUTOCONF_VERSION} \ AUTOMAKE_VERSION=${AUTOMAKE_VERSION} autoreconf -fiv @@ -71,6 +66,10 @@ post-patch: pre-configure: perl -pi -e s,/usr/local/etc,${SYSCONFDIR},g \ ${WRKSRC}/motion-dist.conf.in + +post-install: + cd ${PREFIX}/share/examples/motion; \ + rm -f motion.init-{Fedora,Debian,FreeBSD.sh} motion.service .include <bsd.port.arch.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/multimedia/motion/distinfo,v retrieving revision 1.6 diff -u -p -r1.6 distinfo --- distinfo 6 May 2017 15:10:18 -0000 1.6 +++ distinfo 5 Jan 2018 13:51:01 -0000 @@ -1,2 +1,2 @@ -SHA256 (motion-3.4.1-9b4c16ca.tar.gz) = kU6defhInQp1gPFmhb5x9RvxriQAgtiTNLoztn4Qwao= -SIZE (motion-3.4.1-9b4c16ca.tar.gz) = 387288 +SHA256 (motion-4.1.1.tar.gz) = IHS5Nb3+KPhMLDIzJ0sGkIM2d48wO7E1MNQpnD+KpOI= +SIZE (motion-4.1.1.tar.gz) = 447795 Index: patches/patch-Makefile_in =================================================================== RCS file: patches/patch-Makefile_in diff -N patches/patch-Makefile_in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-Makefile_in 5 Jan 2018 13:51:01 -0000 @@ -0,0 +1,23 @@ +$OpenBSD$ + +Index: Makefile.in +--- Makefile.in.orig ++++ Makefile.in +@@ -103,7 +103,7 @@ pre-mobject-info: + ################################################################################ + %.o: @top_srcdir@/%.c + @echo -e "\tCompiling $< into $@..." +- @$(CC) -c $(CFLAGS) -I@top_builddir@ $< -o $@ ++ $(CC) -c $(CFLAGS) -I@top_builddir@ $< -o $@ + + ################################################################################ + # Include the dependency file if it exists. # +@@ -122,7 +122,7 @@ endif + ################################################################################ + $(DEPEND_FILE): *.h $(SRC) + @echo "Generating dependencies, please wait..." +- @$(CC) $(CFLAGS) -I@top_builddir@ -M $(SRC) > .tmp ++ $(CC) $(CFLAGS) -I@top_builddir@ -M $(SRC) > .tmp + @mv -f .tmp $(DEPEND_FILE) + @echo + Index: patches/patch-configure_ac =================================================================== RCS file: patches/patch-configure_ac diff -N patches/patch-configure_ac --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-configure_ac 5 Jan 2018 13:51:01 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: configure.ac +--- configure.ac.orig ++++ configure.ac +@@ -106,7 +106,7 @@ if test "x${BKTR}" = "xyes"; then + fi + fi + if test "${V4L2}" = "yes"; then +- AC_CHECK_HEADERS(linux/videodev2.h,[V4L2="yes"],[V4L2="no"]) ++ AC_CHECK_HEADERS(sys/videoio.h,[V4L2="yes"],[V4L2="no"]) + fi + + if test "x${V4L2}" = "xyes"; then Index: patches/patch-event_c =================================================================== RCS file: patches/patch-event_c diff -N patches/patch-event_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-event_c 5 Jan 2018 13:51:01 -0000 @@ -0,0 +1,23 @@ +$OpenBSD$ + +Index: event.c +--- event.c.orig ++++ event.c +@@ -353,7 +353,7 @@ static void event_stream_put(struct context *cnt, + } + + +-#if defined(HAVE_V4L2) && !defined(__FreeBSD__) ++#if defined(HAVE_V4L2) && !defined(__FreeBSD__) && !defined(__OpenBSD__) + static void event_vlp_putpipe(struct context *cnt, + motion_event type ATTRIBUTE_UNUSED, + struct image_data *img_data, char *dummy ATTRIBUTE_UNUSED, void *devpipe, +@@ -1022,7 +1022,7 @@ struct event_handlers event_handlers[] = { + EVENT_IMAGE_SNAPSHOT, + event_image_snapshot + }, +-#if defined(HAVE_V4L2) && !defined(__FreeBSD__) ++#if defined(HAVE_V4L2) && !defined(__FreeBSD__) && !defined(__OpenBSD__) + { + EVENT_IMAGE, + event_vlp_putpipe Index: patches/patch-motion-dist_conf_in =================================================================== RCS file: /cvs/ports/multimedia/motion/patches/patch-motion-dist_conf_in,v retrieving revision 1.2 diff -u -p -r1.2 patch-motion-dist_conf_in --- patches/patch-motion-dist_conf_in 30 Jan 2015 20:58:18 -0000 1.2 +++ patches/patch-motion-dist_conf_in 5 Jan 2018 13:51:01 -0000 @@ -1,7 +1,8 @@ $OpenBSD: patch-motion-dist_conf_in,v 1.2 2015/01/30 20:58:18 sthen Exp $ ---- motion-dist.conf.in.orig Mon Jan 26 00:12:50 2015 -+++ motion-dist.conf.in Fri Jan 30 20:45:21 2015 -@@ -74,7 +74,7 @@ v4l2_palette 17 +Index: motion-dist.conf.in +--- motion-dist.conf.in.orig ++++ motion-dist.conf.in +@@ -49,7 +49,7 @@ v4l2_palette 17 # The video input to be used (default: -1) # Should normally be set to 0 or 1 for video/TV cards, and -1 for USB cameras # Set to 0 for uvideo(4) on OpenBSD Index: patches/patch-motion_c =================================================================== RCS file: patches/patch-motion_c diff -N patches/patch-motion_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-motion_c 5 Jan 2018 13:51:01 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: motion.c +--- motion.c.orig ++++ motion.c +@@ -1071,7 +1071,7 @@ static int motion_init(struct context *cnt) + /* create a reference frame */ + alg_update_reference_frame(cnt, RESET_REF_FRAME); + +-#if defined(HAVE_V4L2) && !defined(__FreeBSD__) ++#if defined(HAVE_V4L2) && !defined(__FreeBSD__) && !defined(__OpenBSD__) + /* open video loopback devices if enabled */ + if (cnt->conf.vidpipe) { + MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "Opening video loopback device for normal pictures"); Index: patches/patch-track_c =================================================================== RCS file: /cvs/ports/multimedia/motion/patches/patch-track_c,v retrieving revision 1.3 diff -u -p -r1.3 patch-track_c --- patches/patch-track_c 20 Nov 2015 11:57:19 -0000 1.3 +++ patches/patch-track_c 5 Jan 2018 13:51:01 -0000 @@ -1,15 +1,16 @@ $OpenBSD: patch-track_c,v 1.3 2015/11/20 11:57:19 sthen Exp $ ---- track.c.orig Thu Nov 19 18:38:24 2015 -+++ track.c Thu Nov 19 18:39:44 2015 -@@ -6,7 +6,11 @@ - * This program is published under the GNU Public license - */ - #ifdef MOTION_V4L2 +Index: track.c +--- track.c.orig ++++ track.c +@@ -9,7 +9,11 @@ + #include "motion.h" + + #ifdef HAVE_V4L2 +#if defined(HAVE_LINUX_VIDEODEV_H) #include <linux/videodev2.h> +#elif defined(HAVE_SYS_VIDEOIO_H) +#include <sys/videoio.h> +#endif - #endif /* MOTION_V4L2 */ - #include <math.h> - #include "motion.h" + #include "pwc-ioctl.h" + #endif + Index: patches/patch-video_v4l2_c =================================================================== RCS file: patches/patch-video_v4l2_c diff -N patches/patch-video_v4l2_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-video_v4l2_c 5 Jan 2018 13:51:01 -0000 @@ -0,0 +1,17 @@ +$OpenBSD$ + +Index: video_v4l2.c +--- video_v4l2.c.orig ++++ video_v4l2.c +@@ -23,7 +23,11 @@ + + #ifdef HAVE_V4L2 + ++#ifdef __OpenBSD__ ++#include <sys/videoio.h> ++#else + #include <linux/videodev2.h> ++#endif + + /* video4linux stuff */ + #define NORM_DEFAULT 0 Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/multimedia/motion/pkg/PLIST,v retrieving revision 1.4 diff -u -p -r1.4 PLIST --- pkg/PLIST 20 Nov 2015 11:57:19 -0000 1.4 +++ pkg/PLIST 5 Jan 2018 13:51:01 -0000 @@ -1,4 +1,5 @@ @comment $OpenBSD: PLIST,v 1.4 2015/11/20 11:57:19 sthen Exp $ +@pkgpath multimedia/motion,bktr${FLAVOR_COMMA} @newgroup _motion:704 @newuser _motion:704:_motion:daemon:motion user:/nonexistent:/sbin/nologin @bin bin/motion @@ -7,17 +8,18 @@ share/doc/motion/ share/doc/motion/CHANGELOG share/doc/motion/COPYING share/doc/motion/CREDITS -share/doc/motion/README +share/doc/motion/README.md +share/doc/motion/mask1.png share/doc/motion/motion_guide.html +share/doc/motion/normal.jpg +share/doc/motion/outputmotion1.jpg +share/doc/motion/outputnormal1.jpg share/examples/motion/ +share/examples/motion/camera1-dist.conf +share/examples/motion/camera2-dist.conf +share/examples/motion/camera3-dist.conf +share/examples/motion/camera4-dist.conf share/examples/motion/motion-dist.conf @sample ${SYSCONFDIR}/motion/ @sample ${SYSCONFDIR}/motion/motion.conf -@comment share/examples/motion/motion.init-Debian -@comment share/examples/motion/motion.init-Fedora -@comment share/examples/motion/motion.init-FreeBSD.sh -share/examples/motion/thread1-dist.conf -share/examples/motion/thread2-dist.conf -share/examples/motion/thread3-dist.conf -share/examples/motion/thread4-dist.conf @rcscript ${RCDIR}/motion