Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Aug 2013 15:03:09 GMT
From:      Kozlov Sergey <kozlov.sergey.404@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/181527: New port: multimedia/mjpg-streamer HTTP video streaming daemon
Message-ID:  <201308251503.r7PF39cT020534@oldred.freebsd.org>
Resent-Message-ID: <201308251510.r7PFA07q009813@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         181527
>Category:       ports
>Synopsis:       New port: multimedia/mjpg-streamer HTTP video streaming daemon
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 25 15:10:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Kozlov Sergey
>Release:        9.1-RELEASE amd64
>Organization:
ARC
>Environment:
FreeBSD fbsd-sandbox 9.1-RELEASE-p6 FreeBSD 9.1-RELEASE-p6 #0: Wed Aug 21 20:40:52 UTC 2013     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
New port: multimedia/mjpg-streamer

MJPG-streamer takes JPGs from Linux-UVC compatible webcams, filesystem or
other input plugins and streams them as M-JPEG via HTTP to webbrowsers,
VLC and other software. It is the successor of uvc-streamer, a Linux-UVC
streaming application with Pan/Tilt
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	mjpg-streamer
#	mjpg-streamer/Makefile
#	mjpg-streamer/pkg-descr
#	mjpg-streamer/pkg-plist
#	mjpg-streamer/distinfo
#	mjpg-streamer/files
#	mjpg-streamer/files/patch-Makefile
#	mjpg-streamer/files/patch-plugins-output__http-httpd.c
#	mjpg-streamer/files/patch-plugins-output__http-Makefile
#	mjpg-streamer/files/patch-plugins-output__file-Makefile
#	mjpg-streamer/files/pkg-message.in
#	mjpg-streamer/files/patch-plugins-input__uvc-uvcvideo.h
#	mjpg-streamer/files/patch-plugins-input__uvc-uvc__compat.h
#	mjpg-streamer/files/patch-plugins-input__uvc-Makefile
#	mjpg-streamer/files/patch-plugins-input__testpicture-Makefile
#	mjpg-streamer/files/patch-utils.c
#	mjpg-streamer/files/mjpg_streamer.in
#
echo c - mjpg-streamer
mkdir -p mjpg-streamer > /dev/null 2>&1
echo x - mjpg-streamer/Makefile
sed 's/^X//' >mjpg-streamer/Makefile << '3c37aa9215fb7db5da427c2dc6d0f847'
X# Created by: Kozlov Sergey <kozlov.sergey.404@gmail.com>
X# $FreeBSD$
X
XPORTNAME=	mjpg-streamer
XPORTVERSION=	r63
XCATEGORIES=	multimedia net
XMASTER_SITES=	SF
XMASTER_SITE_SUBDIR=	${PORTNAME}/${PORTNAME}/Sourcecode
X
XMAINTAINER=	kozlov.sergey.404@gmail.com
XCOMMENT=	HTTP video streaming daemon
X
XLICENSE=	GPLv2
X
XBUILD_DEPENDS=	${LOCALBASE}/include/linux/videodev.h:${PORTSDIR}/multimedia/v4l_compat
X
XAPP_BINARY=	mjpg_streamer
XCFLAGS+=	-I${LOCALBASE}/include
XLDFLAGS+=	-L${LOCALBASE}/lib
XDEBUG_FLAGS+=	-DDEBUG
XUSE_LDCONFIG=	${PREFIX}/lib/${PORTNAME}
X
XOPTIONS_DEFINE=	DEBUG
XOPTIONS_MULTI=	INPUT_PLUGINS OUTPUT_PLUGINS
XOPTIONS_MULTI_INPUT_PLUGINS=	TESTPICTURE UVC
XOPTIONS_MULTI_OUTPUT_PLUGINS=	HTTP FILE
X
XTESTPICTURE_DESC=	Test picture plugin
XUVC_DESC=	Linux-UVC V4L2 plugin
X
XHTTP_DESC=	HTTP streaming plugin
XFILE_DESC=	File output plugin
X
XOPTIONS_DEFAULT=	TESTPICTURE UVC HTTP FILE
X
X.include <bsd.port.options.mk>
X
X.if ${PORT_OPTIONS:MTESTPICTURE}
XMJPEG_STREAMER_PLUGINS+=	input_testpicture.so
XPLIST_SUB+=	TESTPICTURE=""
X.else
XPLIST_SUB+=	TESTPICTURE="@comment "
X.endif
X
X.if ${PORT_OPTIONS:MUVC}
XMJPEG_STREAMER_PLUGINS+=	input_uvc.so
XLIB_DEPENDS+=	jpeg:${PORTSDIR}/graphics/jpeg
XPLIST_SUB+=	UVC=""
X.else
XPLIST_SUB+=	UVC="@comment "
X.endif
X
X.if ${PORT_OPTIONS:MHTTP}
XMJPEG_STREAMER_PLUGINS+=	output_http.so
XPLIST_SUB+=	HTTP=""
X.else
XPLIST_SUB+=	HTTP="@comment "
X.endif
X
X.if ${PORT_OPTIONS:MFILE}
XMJPEG_STREAMER_PLUGINS+=	output_file.so
XPLIST_SUB+=	FILE=""
X.else
XPLIST_SUB+=	FILE="@comment "
X.endif
X
X.if ${PORT_OPTIONS:MHTTP}
X.if ${PORT_OPTIONS:MUVC}
XUSE_RC_SUBR=	mjpg_streamer
XSUB_FILES+=	pkg-message
X
Xpost-install:
X	@${CAT} ${PKGMESSAGE}
X.endif
X.endif
X
XALL_TARGET=	${APP_BINARY} ${MJPEG_STREAMER_PLUGINS}
X
Xdo-install:
X	${INSTALL_PROGRAM} ${WRKSRC}/${APP_BINARY} ${PREFIX}/bin
X	${MKDIR} ${PREFIX}/lib/${PORTNAME}
X	@for plugin in ${MJPEG_STREAMER_PLUGINS}; do \
X		${INSTALL_LIB} ${WRKSRC}/$${plugin} ${PREFIX}/lib/${PORTNAME}; \
X	done
X.if ${PORT_OPTIONS:MHTTP}
X	cd ${WRKSRC}/www && \
X	${COPYTREE_SHARE} "*" ${WWWDIR}
X.endif
X
X.include <bsd.port.mk>
3c37aa9215fb7db5da427c2dc6d0f847
echo x - mjpg-streamer/pkg-descr
sed 's/^X//' >mjpg-streamer/pkg-descr << '5f7d2128d334aab6020d11182fc27566'
XMJPG-streamer takes JPGs from Linux-UVC compatible webcams, filesystem or 
Xother input plugins and streams them as M-JPEG via HTTP to webbrowsers, 
XVLC and other software. It is the successor of uvc-streamer, a Linux-UVC 
Xstreaming application with Pan/Tilt
X
XWWW: http://sourceforge.net/projects/mjpg-streamer/
5f7d2128d334aab6020d11182fc27566
echo x - mjpg-streamer/pkg-plist
sed 's/^X//' >mjpg-streamer/pkg-plist << 'd54f3f8e3c2df79c15e06c184777dfb6'
X@comment $FreeBSD$
Xbin/mjpg_streamer
X%%TESTPICTURE%%lib/mjpg-streamer/input_testpicture.so
X%%UVC%%lib/mjpg-streamer/input_uvc.so
X%%FILE%%lib/mjpg-streamer/output_file.so
X%%HTTP%%lib/mjpg-streamer/output_http.so
X%%HTTP%%%%WWWDIR%%/java.html
X%%HTTP%%%%WWWDIR%%/control.htm
X%%HTTP%%%%WWWDIR%%/java_control.html
X%%HTTP%%%%WWWDIR%%/stream.html
X%%HTTP%%%%WWWDIR%%/static.html
X%%HTTP%%%%WWWDIR%%/java_simple.html
X%%HTTP%%%%WWWDIR%%/bodybg.gif
X%%HTTP%%%%WWWDIR%%/static_simple.html
X%%HTTP%%%%WWWDIR%%/favicon.png
X%%HTTP%%%%WWWDIR%%/javascript.html
X%%HTTP%%%%WWWDIR%%/functions.js
X%%HTTP%%%%WWWDIR%%/index.html
X%%HTTP%%%%WWWDIR%%/stream_simple.html
X%%HTTP%%%%WWWDIR%%/javascript_simple.html
X%%HTTP%%%%WWWDIR%%/fix.css
X%%HTTP%%%%WWWDIR%%/favicon.ico
X%%HTTP%%%%WWWDIR%%/style.css
X%%HTTP%%%%WWWDIR%%/sidebarbg.gif
X%%HTTP%%%%WWWDIR%%/example.jpg
X%%HTTP%%%%WWWDIR%%/cambozola.jar
X%%HTTP%%%%WWWDIR%%/LICENSE.txt
X%%HTTP%%@dirrm %%WWWDIR%%
X@dirrm lib/mjpg-streamer
d54f3f8e3c2df79c15e06c184777dfb6
echo x - mjpg-streamer/distinfo
sed 's/^X//' >mjpg-streamer/distinfo << '14fcdaabc310ba011b44df11dcd9ac80'
XSHA256 (mjpg-streamer-r63.tar.gz) = 311d00b48c638f95e5e4837ad6aa5c54d76b0824a2b8e5f7c59a4b6f2652f4f8
XSIZE (mjpg-streamer-r63.tar.gz) = 478235
14fcdaabc310ba011b44df11dcd9ac80
echo c - mjpg-streamer/files
mkdir -p mjpg-streamer/files > /dev/null 2>&1
echo x - mjpg-streamer/files/patch-Makefile
sed 's/^X//' >mjpg-streamer/files/patch-Makefile << '3f23201315d2180a1daed4ccb5b9d829'
X--- Makefile.orig	2008-06-16 14:23:53.000000000 +0300
X+++ Makefile	2013-08-24 05:01:20.000000000 +0300
X@@ -7,11 +7,8 @@
X #
X ###############################################################
X 
X-CC = gcc
X 
X-CFLAGS += -O2 -DLINUX -D_GNU_SOURCE -Wall
X-#CFLAGS += -O2 -DDEBUG -DLINUX -D_GNU_SOURCE -Wall
X-LFLAGS += -lpthread -ldl
X+LFLAGS += -pthread
X 
X APP_BINARY=mjpg_streamer
X OBJECTS=mjpg_streamer.o utils.o
3f23201315d2180a1daed4ccb5b9d829
echo x - mjpg-streamer/files/patch-plugins-output__http-httpd.c
sed 's/^X//' >mjpg-streamer/files/patch-plugins-output__http-httpd.c << '2199336a2652fa27305827699c89fce3'
X--- plugins/output_http/httpd.c.orig	2008-06-16 14:23:47.000000000 +0300
X+++ plugins/output_http/httpd.c	2013-08-24 04:52:20.000000000 +0300
X@@ -33,6 +33,8 @@
X #include <fcntl.h>
X #include <syslog.h>
X 
X+#include <netinet/in.h>
X+
X #include "../../mjpg_streamer.h"
X #include "../../utils.h"
X #include "httpd.h"
2199336a2652fa27305827699c89fce3
echo x - mjpg-streamer/files/patch-plugins-output__http-Makefile
sed 's/^X//' >mjpg-streamer/files/patch-plugins-output__http-Makefile << '35b2d441c87be7356e89e7088c2dfb69'
X--- plugins/output_http/Makefile.orig	2008-06-16 14:23:47.000000000 +0300
X+++ plugins/output_http/Makefile	2013-08-24 05:01:32.000000000 +0300
X@@ -7,11 +7,10 @@
X #
X ###############################################################
X 
X-CC = gcc
X 
X OTHER_HEADERS = ../../mjpg_streamer.h ../../utils.h ../output.h ../input.h
X 
X-CFLAGS += -O2 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC
X+CFLAGS += -shared -fPIC
X #CFLAGS += -DDEBUG
X LFLAGS += -lpthread -ldl
X 
35b2d441c87be7356e89e7088c2dfb69
echo x - mjpg-streamer/files/patch-plugins-output__file-Makefile
sed 's/^X//' >mjpg-streamer/files/patch-plugins-output__file-Makefile << 'dfc50f94e750a93881bd62984f7014a7'
X--- plugins/output_file/Makefile.orig	2008-06-16 14:23:47.000000000 +0300
X+++ plugins/output_file/Makefile	2013-08-24 05:01:30.000000000 +0300
X@@ -7,11 +7,10 @@
X #
X ###############################################################
X 
X-CC = gcc
X 
X OTHER_HEADERS = ../../mjpg_streamer.h ../../utils.h ../output.h ../input.h
X 
X-CFLAGS += -O2 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC
X+CFLAGS += -shared -fPIC
X LFLAGS += -lpthread -ldl
X 
X all: output_file.so
dfc50f94e750a93881bd62984f7014a7
echo x - mjpg-streamer/files/pkg-message.in
sed 's/^X//' >mjpg-streamer/files/pkg-message.in << '8980c4e8eb4421dc4fa4c91634b2ad7a'
X=============================================================================
X
XTo launch MJPG-streamer demo, run
X%%PREFIX%%/rc.d/mjpg_streamer start
X
XThen point your browser to
Xhttp://your.server.com:8080
X
XTo run MJPG-streamer at startup, add
X'mjpg_streamer_enable="YES"' to /etc/rc.conf
X
X=============================================================================
8980c4e8eb4421dc4fa4c91634b2ad7a
echo x - mjpg-streamer/files/patch-plugins-input__uvc-uvcvideo.h
sed 's/^X//' >mjpg-streamer/files/patch-plugins-input__uvc-uvcvideo.h << '5209d627baa79fa63063bc930b9fd529'
X--- plugins/input_uvc/uvcvideo.h.orig	2008-06-16 14:23:51.000000000 +0300
X+++ plugins/input_uvc/uvcvideo.h	2013-08-24 04:50:23.000000000 +0300
X@@ -25,7 +25,7 @@
X #ifndef _USB_VIDEO_H_
X #define _USB_VIDEO_H_
X 
X-#include <linux/kernel.h>
X+#include <sys/types.h>
X #include <linux/videodev.h>
X 
X /* Compatibility */
5209d627baa79fa63063bc930b9fd529
echo x - mjpg-streamer/files/patch-plugins-input__uvc-uvc__compat.h
sed 's/^X//' >mjpg-streamer/files/patch-plugins-input__uvc-uvc__compat.h << '289a8b5793d4a529a0b5db282f209d00'
X--- plugins/input_uvc/uvc_compat.h.orig	2008-06-16 14:23:51.000000000 +0300
X+++ plugins/input_uvc/uvc_compat.h	2013-08-24 04:49:30.000000000 +0300
X@@ -26,14 +26,13 @@
X #ifndef _UVC_COMPAT_H
X #define _UVC_COMPAT_H
X 
X-#include <linux/version.h>
X #ifndef __KERNEL__
X #ifndef __user
X #define __user
X #endif
X #endif
X 
X-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
X+#if 0
X /*
X  * Extended control API
X  */
X@@ -85,7 +84,7 @@
X 
X #endif
X 
X-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
X+#if 0
X /*
X  * Frame size and frame rate enumeration
X  *
289a8b5793d4a529a0b5db282f209d00
echo x - mjpg-streamer/files/patch-plugins-input__uvc-Makefile
sed 's/^X//' >mjpg-streamer/files/patch-plugins-input__uvc-Makefile << 'c7d703f5dea9c86df3d18c6e3e0d9325'
X--- plugins/input_uvc/Makefile.orig	2008-06-16 14:23:51.000000000 +0300
X+++ plugins/input_uvc/Makefile	2013-08-24 05:02:59.000000000 +0300
X@@ -7,11 +7,10 @@
X #
X ###############################################################
X 
X-CC = gcc
X 
X OTHER_HEADERS = ../../mjpg_streamer.h ../../utils.h ../output.h ../input.h
X 
X-CFLAGS += -O2 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC
X+CFLAGS += -shared -fPIC ${LDFLAGS}
X #CFLAGS += -DDEBUG
X LFLAGS += -lpthread -ldl
X 
c7d703f5dea9c86df3d18c6e3e0d9325
echo x - mjpg-streamer/files/patch-plugins-input__testpicture-Makefile
sed 's/^X//' >mjpg-streamer/files/patch-plugins-input__testpicture-Makefile << 'acf9a07855ebf440b82e0a72e2c833e6'
X--- plugins/input_testpicture/Makefile.orig	2008-06-16 14:23:51.000000000 +0300
X+++ plugins/input_testpicture/Makefile	2013-08-24 05:02:26.000000000 +0300
X@@ -7,11 +7,10 @@
X #
X ###############################################################
X 
X-CC = gcc
X 
X OTHER_HEADERS = ../../mjpg_streamer.h ../../utils.h ../output.h ../input.h
X 
X-CFLAGS += -O2 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC
X+CFLAGS += -shared -fPIC
X #CFLAGS += -DDEBUG
X LFLAGS += -lpthread -ldl
X 
acf9a07855ebf440b82e0a72e2c833e6
echo x - mjpg-streamer/files/patch-utils.c
sed 's/^X//' >mjpg-streamer/files/patch-utils.c << '7227db8bdceff792df432eee65169ef2'
X--- utils.c.orig	2008-06-16 14:23:53.000000000 +0300
X+++ utils.c	2013-08-24 04:23:19.000000000 +0300
X@@ -23,10 +23,10 @@
X #include <stdio.h>
X #include <stdlib.h>
X #include <unistd.h>
X-#include <linux/types.h>
X+#include <sys/types.h>
X #include <string.h>
X #include <fcntl.h>
X-#include <wait.h>
X+#include <sys/wait.h>
X #include <time.h>
X #include <limits.h>
X 
7227db8bdceff792df432eee65169ef2
echo x - mjpg-streamer/files/mjpg_streamer.in
sed 's/^X//' >mjpg-streamer/files/mjpg_streamer.in << '0ea4f09bf588e0842697695f11d03329'
X#!/bin/sh
X
X# $FreeBSD$
X#
X# PROVIDE: mjpg_streamer
X# REQUIRE: LOGIN
X# KEYWORD: shutdown
X#
X# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
X# to enable this service:
X#
X# mjpg_streamer_enable="YES"
X# #optional
X# mjpg_streamer_flags=""
X
X. /etc/rc.subr
X
Xname=mjpg_streamer
Xrcvar=mjpg_streamer_enable
X
Xcommand=%%PREFIX%%/bin/${name}
Xcommand_args="-b"
X
Xmjpg_streamer_enable="NO"
Xmjpg_streamer_flags="-o 'output_http.so -w %%WWWDIR%%'"
X
Xload_rc_config $name
Xrun_rc_command "$1"
0ea4f09bf588e0842697695f11d03329
exit



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308251503.r7PF39cT020534>