{"id":2919,"date":"2023-12-16T19:05:48","date_gmt":"2023-12-16T11:05:48","guid":{"rendered":"http:\/\/www.51cos.com\/?p=2919"},"modified":"2024-11-26T13:44:32","modified_gmt":"2024-11-26T05:44:32","slug":"mjpg-streameropenwrt%e5%ae%9e%e7%8e%b0%e4%b8%b2%e6%b5%81","status":"publish","type":"post","link":"http:\/\/www.51cos.com\/?p=2919","title":{"rendered":"mjpg-streamer+openwrt\u5b9e\u73b0\u4e32\u6d41"},"content":{"rendered":"<p>cat \/etc\/config\/mjpg-streamer<\/p>\n<p>\u5728https:\/\/downloads.openwrt.org\/releases\/packages-22.03\/aarch64_cortex-a53\/packages\/\u76ee\u524d\u4e2d\uff0c<br \/>\n\u4f9d\u6b21\u4e0b\u8f7d\u5e76\u7528opkg\u5b89\u88c5mjpg-streamer\uff1a<\/p>\n<p>https:\/\/downloads.openwrt.org\/releases\/packages-22.03\/aarch64_cortex-a53\/packages\/mjpg-streamer-www_1.0.0-5_aarch64_cortex-a53.ipk<br \/>\nhttps:\/\/downloads.openwrt.org\/releases\/packages-22.03\/aarch64_cortex-a53\/packages\/mjpg-streamer-input-uvc_1.0.0-5_aarch64_cortex-a53.ipk<br \/>\nhttps:\/\/downloads.openwrt.org\/releases\/packages-22.03\/aarch64_cortex-a53\/packages\/mjpg-streamer-output-http_1.0.0-5_aarch64_cortex-a53.ipk<\/p>\n<p>\u5b89\u88c5v4l-utils<br \/>\nhttp:\/\/downloads.openwrt.org\/releases\/22.03.3\/targets\/mediatek\/mt7622\/packages\/libstdcpp6_11.2.0-4_aarch64_cortex-a53.ipk<br \/>\nhttp:\/\/downloads.openwrt.org\/releases\/packages-22.03\/aarch64_cortex-a53\/packages\/libv4l_1.20.0-4_aarch64_cortex-a53.ipk<br \/>\nhttp:\/\/downloads.openwrt.org\/releases\/packages-22.03\/aarch64_cortex-a53\/packages\/v4l-utils_1.20.0-4_aarch64_cortex-a53.ipk<\/p>\n<p>root@OpenWrt:~# v4l2-ctl -V<br \/>\nFormat Video Capture:<br \/>\n        Width\/Height  : 320\/240<br \/>\n        Pixel Format  : &#8216;YUYV&#8217;<br \/>\n        Field         : None<br \/>\n        Bytes per Line: 640<br \/>\n        Size Image    : 153600<br \/>\n        Colorspace    : SRGB<\/p>\n<p>mjpg_streamer &#8211;input &#8220;input_uvc.so &#8211;device \/dev\/video0 &#8211;fps 60 &#8211;resolution 1920&#215;1080&#8221; &#8211;output &#8220;output_http.so &#8211;www \/www &#8211;port 8080&#8221;<\/p>\n<p>\/etc\/init.d\/mjpg-streamer enable   \/\/\u8bbe\u7f6e\u5f00\u673a\u81ea\u52a8\u542f\u52a8<br \/>\n\/etc\/init.d\/mjpg-streamer disable  \/\/\u7981\u6b62\u5f00\u673a\u81ea\u52a8\u542f\u52a8<br \/>\n\/etc\/init.d\/mjpg-streamer start    \/\/\u73b0\u5728\u542f\u52a8<br \/>\n\/etc\/init.d\/mjpg-streamer restart  \/\/\u91cd\u542f<br \/>\n\/etc\/init.d\/mjpg-streamer stop    \/\/\u505c\u6b62<\/p>\n<p>root@OpenWrt:~# mjpg_streamer -i &#8220;input_uvc.so &#8211;help&#8221;<br \/>\nMJPG Streamer Version.: 2.0<br \/>\n &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n Help for input plugin..: UVC webcam grabber<br \/>\n &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n The following parameters can be passed to this plugin:<\/p>\n<p> [-d | &#8211;device ]&#8230;&#8230;.: video device to open (your camera)<br \/>\n [-r | &#8211;resolution ]&#8230;: the resolution of the video device,<br \/>\n                          can be one of the following strings:<br \/>\n                          QQVGA QCIF CGA QVGA CIF PAL<br \/>\n                          VGA SVGA XGA HD SXGA UXGA<br \/>\n                          FHD<br \/>\n                          or a custom value like the following<br \/>\n                          example: 640&#215;480<br \/>\n [-f | &#8211;fps ]&#8230;&#8230;&#8230;.: frames per second<br \/>\n                          (camera may coerce to different value)<br \/>\n [-q | &#8211;quality ] &#8230;..: set quality of JPEG encoding<br \/>\n [-m | &#8211;minimum_size ].: drop frames smaller then this limit, useful<br \/>\n                          if the webcam produces small-sized garbage frames<br \/>\n                          may happen under low light conditions<br \/>\n [-e | &#8211;every_frame ]..: drop all frames except numbered<br \/>\n [-n | &#8211;no_dynctrl ]&#8230;: do not initalize dynctrls of Linux-UVC driver<br \/>\n [-l | &#8211;led ]&#8230;&#8230;&#8230;.: switch the LED &#8220;on&#8221;, &#8220;off&#8221;, let it &#8220;blink&#8221; or leave<br \/>\n                          it up to the driver using the value &#8220;auto&#8221;<br \/>\n [-t | &#8211;tvnorm ] &#8230;&#8230;: set TV-Norm pal, ntsc or secam<br \/>\n [-u | &#8211;uyvy ] &#8230;&#8230;..: Use UYVY format, default: MJPEG (uses more cpu power)<br \/>\n [-y | &#8211;yuv  ] &#8230;&#8230;..: Use YUV format, default: MJPEG (uses more cpu power)<br \/>\n [-fourcc ] &#8230;&#8230;&#8230;&#8230;: Use FOURCC codec &#8216;argopt&#8217;,<br \/>\n                          currently supported codecs are: RGB24, RGBP<br \/>\n [-timestamp ]&#8230;&#8230;&#8230;.: Populate frame timestamp with system time<br \/>\n [-softfps] &#8230;&#8230;&#8230;&#8230;: Drop frames to try and achieve this fps<br \/>\n                          set your camera to its maximum fps to avoid stuttering<br \/>\n [-timeout] &#8230;&#8230;&#8230;&#8230;: Timeout for device querying (seconds)<br \/>\n [-dv_timings] &#8230;&#8230;&#8230;: Enable DV timings queriyng and events processing<br \/>\n &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p> Optional parameters (may not be supported by all cameras):<\/p>\n<p> [-br ]&#8230;&#8230;&#8230;&#8230;&#8230;..: Set image brightness (auto or integer)<br \/>\n [-co ]&#8230;&#8230;&#8230;&#8230;&#8230;..: Set image contrast (integer)<br \/>\n [-sh ]&#8230;&#8230;&#8230;&#8230;&#8230;..: Set image sharpness (integer)<br \/>\n [-sa ]&#8230;&#8230;&#8230;&#8230;&#8230;..: Set image saturation (integer)<br \/>\n [-cb ]&#8230;&#8230;&#8230;&#8230;&#8230;..: Set color balance (auto or integer)<br \/>\n [-wb ]&#8230;&#8230;&#8230;&#8230;&#8230;..: Set white balance (auto or integer)<br \/>\n [-ex ]&#8230;&#8230;&#8230;&#8230;&#8230;..: Set exposure (auto, shutter-priority, aperature-priority, or integer)<br \/>\n [-bk ]&#8230;&#8230;&#8230;&#8230;&#8230;..: Set backlight compensation (integer)<br \/>\n [-rot ]&#8230;&#8230;&#8230;&#8230;&#8230;.: Set image rotation (0-359)<br \/>\n [-hf ]&#8230;&#8230;&#8230;&#8230;&#8230;..: Set horizontal flip (true\/false)<br \/>\n [-vf ]&#8230;&#8230;&#8230;&#8230;&#8230;..: Set vertical flip (true\/false)<br \/>\n [-pl ]&#8230;&#8230;&#8230;&#8230;&#8230;..: Set power line filter (disabled, 50hz, 60hz, auto)<br \/>\n [-gain ]&#8230;&#8230;&#8230;&#8230;&#8230;: Set gain (auto or integer)<br \/>\n [-cagc ]&#8230;&#8230;&#8230;&#8230;&#8230;: Set chroma gain control (auto or integer)<br \/>\n &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>cat \/etc\/config\/mjpg-streamer \u5728https:\/\/downloads.openwr [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2919","post","type-post","status-publish","format-standard","hentry","category-life"],"_links":{"self":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts\/2919","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2919"}],"version-history":[{"count":6,"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts\/2919\/revisions"}],"predecessor-version":[{"id":3015,"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts\/2919\/revisions\/3015"}],"wp:attachment":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2919"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}