CubieBoard中文论坛

 找回密码
 立即注册
搜索
热搜: unable
查看: 3906|回复: 0

用这个参数启动cb2的MJPG-streamerCPU按占用53%

[复制链接]
发表于 2014-7-17 10:43:35 | 显示全部楼层 |阅读模式
本帖最后由 zixi0007 于 2014-7-17 12:33 编辑

用这个参数启动cb2的MJPG-streamerCPU按占用53%
启动命令:
mjpg_streamer -i "/usr/lib/input_uvc.so -d /dev/video0  -y -r 640x480 -f 10" -o "/usr/lib/output_http.so -p 8080 -w /usr/www"

cpu占用情况:
Tasks:  80 total,   1 running,  79 sleeping,   0 stopped,   0 zombie
%Cpu(s): 26.9 us,  0.4 sy,  0.0 ni, 72.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:    977276 total,   237008 used,   740268 free,    18956 buffers
KiB Swap:        0 total,        0 used,        0 free,    98976 cached


  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND           
9227 linaro    20   0 58720 4372 3224 S  52.7  0.4  19:29.18 mjpg_streamer     
9377 linaro    20   0  2496 1064  756 R   0.3  0.1   0:00.22 top               
    1 root      20   0  2632 1600  980 S   0.0  0.2   0:06.29 init              
    2 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kthreadd         
    3 root      20   0     0    0    0 S   0.0  0.0   0:04.03 ksoftirqd/0      
    4 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kworker/0:0      
    5 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kworker/u:0      
    6 root      rt   0     0    0    0 S   0.0  0.0   0:00.06 migration/0      
    7 root      rt   0     0    0    0 S   0.0  0.0   0:00.07 migration/1      
    8 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kworker/1:0      
    9 root      20   0     0    0    0 S   0.0  0.0   0:03.87 ksoftirqd/1      
   10 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 cpuset            
   11 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 khelper           
   12 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kdevtmpfs         
   13 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 netns            
   15 root      20   0     0    0    0 S   0.0  0.0   0:00.92 kworker/1:1      
   16 root      20   0     0    0    0 S   0.0  0.0   0:00.06 sync_supers  


下面是MJPG-streamer 支持的命令说明:
#/******************************************************************************
#                                                                              #
#      MJPG-streamer allows to stream JPG frames from an input-plugin          #
#      to several output plugins                                               #
#                                                                              #
#      Copyright (C) 2007 Tom St枚veken                                         #
#                                                                              #
# This program is free software; you can redistribute it and/or modify         #
# it under the terms of the GNU General Public License as published by         #
# the Free Software Foundation; version 2 of the License.                      #
#                                                                              #
# This program is distributed in the hope that it will be useful,              #
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
# GNU General Public License for more details.                                 #
#                                                                              #
# You should have received a copy of the GNU General Public License            #
# along with this program; if not, write to the Free Software                  #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    #
#                                                                              #
#******************************************************************************/

## This example shows how to invoke mjpg-streamer from the command line

export LD_LIBRARY_PATH="$(pwd)"
#./mjpg_streamer -i "input_uvc.so --help"

./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"
#./mjpg_streamer -i "./input_uvc.so -d /dev/video0" -i "./input_uvc.so -d /dev/video1" -o "./output_http.so -w ./www"
#valgrind ./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"

#./mjpg_streamer -i "./input_uvc.so" -o "./output_udp.so -p 2001"

## pwd echos the current path you are working at,
## the backticks open a subshell to execute the command pwd first
## the exported variable name configures ldopen() to search a certain
## folder for *.so modules
#export LD_LIBRARY_PATH=`pwd`

## this is the minimum command line to start mjpg-streamer with webpages
## for the input-plugin default parameters are used
#./mjpg_streamer -o "output_http.so -w `pwd`/www"

## to query help for the core:
# ./mjpg_streamer --help

## to query help for the input-plugin "input_uvc.so":
# ./mjpg_streamer --input "input_uvc.so --help"

## to query help for the output-plugin "output_file.so":
# ./mjpg_streamer --output "output_file.so --help"

## to query help for the output-plugin "output_http.so":
# ./mjpg_streamer --output "output_http.so --help"

## to specify a certain device, framerage and resolution for the input plugin:
# ./mjpg_streamer -i "input_uvc.so -d /dev/video2 -r 320x240 -f 10"

## to start both, the http-output-plugin and write to files every 15 second:
# mkdir pics
# ./mjpg_streamer -o "output_http.so -w `pwd`/www" -o "output_file.so -f pics -d 15000"

## to protect the webserver with a username and password (!! can easily get sniffed and decoded, it is just base64 encoded !!)
# ./mjpg-streamer -o "output_http.so -w ./www -c UsErNaMe:SeCrEt"

## If you want to track down errors, use this simple testpicture plugin as input source.
## to use the testpicture input plugin instead of a webcam or folder:
#./mjpg_streamer -i "input_testpicture.so -r 320x240 -d 500" -o "output_http.so -w www"

## The input_file.so plugin watches a folder for new files, it does not matter where
## the JPEG files orginate from. For instance it is possible to grab the desktop and
## store the files to a folder:
# mkdir -p /tmp/input
# while true; do xwd -root | convert - -scale 640 /tmp/input/bla.jpg; sleep 0.5; done &
## Then the files can be read from the folder "/tmp/input" and served via HTTP
# ./mjpg_streamer -i "input_file.so -f /tmp/input -r" -o "output_http.so -w www"

## To upload files to a FTP server (edit the script first)
# ./mjpg_streamer -i input_testpicture.so -o "output_file.so --command plugins/output_file/examples/ftp_upload.sh"

## To create a control only interface useful for controlling the pan/tilt throug
## a webpage while another program streams video/audio, like skype.
#./mjpg_streamer -i "./input_control.so" -o "./output_http.so -w ./www"


屏幕分辨率降低到320X240 cpu会下降到 13.9%
Tasks:  85 total,   1 running,  84 sleeping,   0 stopped,   0 zombie
%Cpu(s):  8.6 us,  0.4 sy,  0.0 ni, 91.1 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:    977276 total,   236328 used,   740948 free,    19244 buffers
KiB Swap:        0 total,        0 used,        0 free,    99004 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND           
9498 linaro    20   0 22232 1920 1432 S  13.9 0.2   0:02.15 mjpg_streamer     
9501 root      20   0  7448 2652 1912 S   6.0  0.3   0:01.19 sshd              
9503 linaro    20   0  2496 1068  756 R   0.3  0.1   0:00.07 top               
    1 root      20   0  2632 1600  980 S   0.0  0.2   0:06.30 init              
    2 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kthreadd         
    3 root      20   0     0    0    0 S   0.0  0.0   0:04.07 ksoftirqd/0      
    5 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kworker/u:0      
    6 root      rt   0     0    0    0 S   0.0  0.0   0:00.06 migration/0      
    7 root      rt   0     0    0    0 S   0.0  0.0   0:00.07 migration/1      
    8 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kworker/1:0      
    9 root      20   0     0    0    0 S   0.0  0.0   0:04.08 ksoftirqd/1      
   10 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 cpuset            
   11 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 khelper           
   12 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kdevtmpfs         
   13 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 netns            
   15 root      20   0     0    0    0 S   0.0  0.0   0:01.67 kworker/1:1      
   16 root      20   0     0    0    0 S   0.0  0.0   0:00.12 sync_supers   


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|粤ICP备13051116号|cubie.cc---深刻的嵌入式技术讨论社区

GMT+8, 2024-5-17 16:16 , Processed in 0.021914 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2012 Comsenz Inc. | Style by Coxxs

返回顶部