v4l2-ctl命令

v4l2-ctl -d /dev/video10 --set-selection=target=crop,width=1280,height=720 --set-fmt-video=width=640,height=480,pixelformat=NV21 --stream-mmap=3 --stream-to=mp.out --stream-count=1 --stream-poll --stream-skip=3


v4l2-ctl -d /dev/video10 --set-fmt-video=width=640,height=480,pixelformat=NV21 --stream-mmap=3 --stream-to=mp.out --stream-count=1 --stream-poll --stream-skip=3

v4l2-ctl -d /dev/video10 --set-selection=target=crop,width=640,height=480 --set-fmt-video=width=640,height=480,pixelformat=YUYV --stream-mmap=3 --stream-to=mp.out --stream-count=1 --stream-poll --stream-skip=3

v4l2-ctl --verbose -d /dev/video10 --set-fmt-video=width=1280,height=720,pixelformat='NV12' --stream-mmap --stream-count=1 --set-selection=target=crop,top=0,left=0,width=1280,height=720 --stream-to=mp.yuv

v4l2-ctl --verbose -d /dev/video10 --set-fmt-video=width=640,height=480,pixelformat='NV12' --stream-mmap --stream-count=1 --set-selection=target=crop,top=0,left=0,width=640,height=480 --stream-to=mp1.yuv

v4l2-ctl --verbose -d /dev/video10 --set-fmt-video=width=1280,height=720,pixelformat='YUYV' --stream-mmap --stream-count=1 --set-selection=target=crop,top=0,left=0,width=1280,height=720 --stream-to=mp.yuv

//显示Camera所有信息
# v4l2-ctl -d /dev/video0 --all
# v4l-ctl  -D
 
//播放yuyv422格式数据
# ffplay -i mp.yuv -pix_fmt yuyv422 -s 1280x720

//获取支持的编码格式
# v4l2-ctl  --list-formats -d /dev/video10
ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'MJPG' (compressed)
    Name        : Motion-JPEG
 
    Index       : 1
    Type        : Video Capture
    Pixel Format: 'YUYV'
    Name        : YUYV 4:2:2
 
 
 
//获取支持的camera设备
# v4l2-ctl --list-devices -d /dev/video10
 
# v4l2-ctl -d /dev/video10 --list-ctrls

./v4l2-ctl --verbose -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat='NV12' --stream-mmap --stream-count=1 --set-selection=target=crop,top=0,left=0,width=1920,height=1080 --stream-skip=3 --stream-to=mp.yuv

./v4l2-ctl --list-devices 列出所有设备
./v4l2-ctl -d /dev/video0 --list-formats-ext   列出video0对应的支持的分辨率格式 
./v4l2-ctl --all -d /dev/video0        列出video0对应的所有信息,分辨率,控制参数等
v4l2-ctl -d /dev/video0 --list-ctrls  列出video0对应的控制参数

./v4l2-ctl --device /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=MJPG --stream-mmap --stream-to=./tmp2.jpg --stream-count=1
./v4l2-ctl --device /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=MJPG --stream-mmap --stream-to=./output_2560.mjpg --stream-count=30
pixelformat 可以为 MJPG YUYV NV12 NV21 H264

echo 0xffff >/sys/module/uvcvideo/parameters/trace

  • 2
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值