OpenWrt编译的mjpg-streamer软件包与官方编译的不一致

    OpenWrt编译的mjpg-streamer软件包居然与官方编译的是不一样的版本。不管是当前trunk还是barrier breaker版都是有这个问题。自行编译的不支持yuv格式输出,也就是说如果挂载的摄像头不支持jpeg格式直接输出那就没戏了。但是官方的mjpg-streamer就没有这个问题。先看看自己编译出来的与官方的版本在input_uvc.so模块帮助上的区别。

官方版本:

root@OpenWrt:/tmp# mjpg_streamer -i "input_uvc.so --help"
MJPG Streamer Version: svn rev: exported
 ---------------------------------------------------------------
 Help for input plugin..: UVC webcam grabber
 ---------------------------------------------------------------
 The following parameters can be passed to this plugin:

 [-d | --device ].......: video device to open (your camera)
 [-r | --resolution ]...: the resolution of the video device,
                          can be one of the following strings:
                          QSIF QCIF CGA QVGA CIF VGA 
                          SVGA XGA SXGA 
                          or a custom value like the following
                          example: 640x480
 [-f | --fps ]..........: frames per second
 [-y | --yuv ]..........: enable YUYV format and disable MJPEG mode
 [-q | --quality ]......: JPEG compression quality in percent 
                          (activates YUYV format, disables MJPEG)
 [-m | --minimum_size ].: drop frames smaller then this limit, useful
                          if the webcam produces small-sized garbage frames
                          may happen under low light conditions
 [-n | --no_dynctrl ]...: do not initalize dynctrls of Linux-UVC driver
 [-l | --led ]..........: switch the LED "on", "off", let it "blink" or leave
                          it up to the driver using the value "auto"
 ---------------------------------------------------------------

input_init() return value signals to exit



注意,这里可以带y参数,即可以开启支持YUYV格式。然后是自己编译的版本的:

root@OpenWrt:~# mjpg_streamer -i "input_uvc.so --help"
MJPG Streamer Version: svn rev: exported
 ---------------------------------------------------------------
 Help for input plugin..: UVC webcam grabber
 ---------------------------------------------------------------
 The following parameters can be passed to this plugin:

 [-d | --device ].......: video device to open (your camera)
 [-r | --resolution ]...: the resolution of the video device,
                          can be one of the following strings:
                          QSIF QCIF CGA QVGA CIF VGA 
                          SVGA XGA SXGA 
                          or a custom value like the following
                          example: 640x480
 [-f | --fps ]..........: frames per second
                          (activates YUYV format, disables MJPEG)
 [-m | --minimum_size ].: drop frames smaller then this limit, useful
                          if the webcam produces small-sized garbage frames
                          may happen under low light conditions
 [-n | --no_dynctrl ]...: do not initalize dynctrls of Linux-UVC driver
 [-l | --led ]..........: switch the LED "on", "off", let it "blink" or leave
                          it up to the driver using the value "auto"
 ---------------------------------------------------------------

 [-t | --tvnorm ] ......: set TV-Norm pal, ntsc or secam
 ---------------------------------------------------------------

input_init() return value signals to exit



注:自己编译的不带y参数,即不支持YUYV格式,还多了个支持的参数t,用来设置pal、ntsc制式的。查看openwrt下载的mjpg-streamer源码也没发现支持y参数。mjpg-streamer包的路径是./feeds/packages/multimedia/mjpg-streamer。patches目录下的补丁文件也没见到对y参数支持的补丁。Makefile文件主要内容:

#
# Copyright (C) 2006-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=mjpg-streamer
PKG_REV:=182
PKG_VERSION:=r$(PKG_REV)
PKG_RELEASE:=1
PKG_MAINTAINER:=Roger D <[email protected]>

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).1.tar.bz2
PKG_SOURCE_URL:=https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer-experimental
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_PROTO:=svn

PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILE:=LICENSE



注意上面的PKG_SOURCE_URL路径,最末尾有个“-experimental”,意思是实验性的意思。google上搜搜mjpg-streamer OpenWrt编译的mjpg-streamer软件包与官方编译的不一致_第1张图片

https://svn.code.sf.net/p/mjpg-streamer/code/点击进去OpenWrt编译的mjpg-streamer软件包与官方编译的不一致_第2张图片

发现mjpg-streamer有带不带“experimental”版本的区别。进一步进去查看代码带“experimental”是不支持y参数的,不带“experimental”版支持y参数,并且input_uvc插件的帮助说明与官方的一样。想不通官方为什么这么整。决定自己切换到不带“experimental”版本。

首先删除openwrt源码目录下的mjpg-streamer**.tar.gz文件。修改mjpg-streamer包路径./feeds/packages/multimedia/mjpg-streamer/下的Makefile文件,将PKG_SOURCE_URL:=https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer-experimental改成PKG_SOURCE_URL:=https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer。删除patches下的010-enable_additional_plugins.patch和020-remove_gcc_debug_options.patch补丁文件。

然后重新编译mjpg-streamer软件包:

make package/mjpg-streamer/prepare V=s
make package/mjpg-streamer/install V=s

再重新安装mjpg-streamer软件包,ok。



你可能感兴趣的:(OpenWrt编译的mjpg-streamer软件包与官方编译的不一致)