$ lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver Bus 001 Device 003: ID 1e4e:0102 Cubeternet GL-UPC822 UVC WebCam Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
使用 Video4Linux 指令查看裝置支援的格式。
1 2 3 4 5
$ v4l2-ctl --list-formats ioctl: VIDIOC_ENUM_FMT Type: Video Capture
$ make $ sudo make install $ which mjpg_streamer /usr/local/bin/mjpg_streamer
啟動串流功能
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
$ mjpg_streamer -i "input_uvc.so -n -f 30 -r 320x240" -o "output_http.so -p 8888 -w /usr/local/share/mjpg-streamer/www" MJPG Streamer Version: git rev: 310b29f4a94c46652b20c4b7b6e5cf24e532af39 i: Using V4L2 device.: /dev/video0 i: Desired Resolution: 320 x 240 i: Frames Per Second.: 30 i: Format............: JPEG i: TV-Norm...........: DEFAULT i: Could not obtain the requested pixelformat: MJPG , driver gave us: YUYV ... will try to handle this by checking against supported formats. ... Falling back to YUV mode (consider using -yuv option). Note that this requires much more CPU power i: FPS coerced ......: from 30 to 4 o: www-folder-path......: /usr/local/share/mjpg-streamer/www/ o: HTTP TCP port........: 8888 o: HTTP Listen Address..: (null) o: username:password....: disabled o: commands.............: enabled