CubieTruck:抓取usb摄像头到rtmp
apt-get update
apt-get install libavcodec-extra
apt-get install libav-tools
apt-get install v4l-utils
查看usb摄像头:
v4l2-ctl –list-devices
输出如下则证明摄像头正常:
root@cubietruck:~# v4l2-ctl -list-devices Video input set to 0 (Camera 1: ok) brightness (int) : min=-64 max=64 step=1 default=0 value=0 contrast (int) : min=0 max=95 step=1 default=34 value=34 saturation (int) : min=0 max=128 step=1 default=42 value=42 hue (int) : min=-40 max=40 step=1 default=0 value=0 white_balance_temperature_auto (bool) : default=1 value=1 gamma (int) : min=72 max=500 step=1 default=106 value=106 power_line_frequency (menu) : min=0 max=2 default=1 value=1 sharpness (int) : min=0 max=10 step=1 default=7 value=7 backlight_compensation (int) : min=0 max=1 step=1 default=0 value=0 exposure_auto (menu) : min=0 max=3 default=3 value=3 exposure_auto_priority (bool) : default=0 value=1 brightness (int) : min=-64 max=64 step=1 default=0 value=0 contrast (int) : min=0 max=95 step=1 default=34 value=34 saturation (int) : min=0 max=128 step=1 default=42 value=42 hue (int) : min=-40 max=40 step=1 default=0 value=0 white_balance_temperature_auto (bool) : default=1 value=1 gamma (int) : min=72 max=500 step=1 default=106 value=106 power_line_frequency (menu) : min=0 max=2 default=1 value=1 sharpness (int) : min=0 max=10 step=1 default=7 value=7 backlight_compensation (int) : min=0 max=1 step=1 default=0 value=0
开始推送流媒体:
avconv -f video4linux2 -r 25 -s 640X480 -i /dev/video0 -f flv rtmp://{ip}/live/