您好,登錄后才能下訂單哦!
這篇文章主要介紹OpenWrt編譯的mjpg-streamer軟件包與官方編譯的不一致怎么辦,文中介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們一定要看完!
OpenWrt編譯的mjpg-streamer軟件包居然與官方編譯的是不一樣的版本。不管是當(dāng)前trunk還是barrier breaker版都是有這個問題。自行編譯的不支持yuv格式輸出,也就是說如果掛載的攝像頭不支持jpeg格式直接輸出那就沒戲了。但是官方的mjpg-streamer就沒有這個問題。先看看自己編譯出來的與官方的版本在input_uvc.so模塊幫助上的區(qū)別。
官方版本:
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參數(shù),即可以開啟支持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參數(shù),即不支持YUYV格式,還多了個支持的參數(shù)t,用來設(shè)置pal、ntsc制式的。查看openwrt下載的mjpg-streamer源碼也沒發(fā)現(xiàn)支持y參數(shù)。mjpg-streamer包的路徑是./feeds/packages/multimedia/mjpg-streamer。patches目錄下的補丁文件也沒見到對y參數(shù)支持的補丁。Makefile文件主要內(nèi)容:
# # 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 <rogerdammit@gmail.com> 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
https://svn.code.sf.net/p/mjpg-streamer/code/點擊進(jìn)去
發(fā)現(xiàn)mjpg-streamer有帶不帶“experimental”版本的區(qū)別。進(jìn)一步進(jìn)去查看代碼帶“experimental”是不支持y參數(shù)的,不帶“experimental”版支持y參數(shù),并且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軟件包與官方編譯的不一致怎么辦”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。