当前位置:网站首页>usb host 驱动 - UVC 掉包
usb host 驱动 - UVC 掉包
2022-07-06 11:24:00 【对我好两点】
1. issue description
yavta 是一款测试APP,测试UVC 摄像头的数据采集回传。
yavta -f YUYV -s 1280x720 -t 1/60 -c100 /dev/video0 -F/data/yua
帧率60FPS 不能正常运行,blocked, all frame fail。
yavta -f YUYV -s 1280x720 -t 1/30 -c100 /dev/video0 -F/data/yua
帧率30FPS 能正常运行,但中间也会有一些丢包。
1.1 图像的一些参数
帧率:FPS(每秒钟要多少帧画面); 以及Gop(表示多少秒一个I帧),影响流畅度。
-t 1/60 // 帧率60,一秒钟传输60 帧
分辨率:单位英寸中所包含的像素点数; VGA:Video Graphics Array(视频图像分辨率),影响清晰度。
-s 1280x720 // 分辨率720P
视频大小:分辨率 x 2(每个像素占多少字节) x 8 x 帧率 x 时间(s) /1024/1024
YUV422 格式帧大小:分辨率 x 2 Byte
对于YUV422 格式的 1080P 视频而言,一帧图像是 1920x1080x2x8/1024/1024 = 31.64Mbit,1秒钟30帧图像的话,则有949.2Mb/s。
1.2 yavta 控制流程
[email protected]-rb5:/# strace yavta -f YUYV -s 1280x720 -t 1/60 -c100 /dev/video0
// 解析参数
execve("/usr/bin/yavta", ["yavta", "-f", "YUYV", "-s", "1280x720", "-t", "1/60", "-c100", "/dev/video0"], 0x7fc5203a80 /* 16 vars */) = 0
// 打开设备节点
openat(AT_FDCWD, "/dev/video0", O_RDWR) = 3
// 回显显示
write(1, "Device /dev/video0 opened.\n", 27Device /dev/video0 opened.) = 27
// 设备节点的ioctl
ioctl(3, VIDIOC_QUERYCAP, {
driver="uvcvideo", card="KS2A418: KS2A418", bus_info="usb-xhci-hcd.0.auto-1.3", version=4.19.125, ...) = 0
// 回显显示
write(1, "Device `KS2A418: KS2A418' on `us"..., 117Device `KS2A418: KS2A418' on `usb-xhci-hcd.0.auto-1.3' (driver 'uvcvideo') supports video, capture, without mplanes.) = 117
// ioctl 设置参数
ioctl(3, VIDIOC_G_PARM, {
type=V4L2_BUF_TYPE_VIDEO_CAPTURE, parm.capture={
capability=V4L2_CAP_TIMEPERFRAME, capturemode=0, timeperframe=1/60, extendedmode=0, readbuffers=0}}) = 0
write(1, "Current frame rate: 1/60\n", 25Current frame rate: 1/60) = 25
write(1, "Setting frame rate to: 1/60\n", 28Setting frame rate to: 1/60) = 28
...
这些ioctl 对应驱动的接口为:
// \drivers\media\usb\uvc\uvc_v4l2.c
const struct v4l2_ioctl_ops uvc_ioctl_ops = {
.vidioc_querycap = uvc_ioctl_querycap,
...
.vidioc_reqbufs = uvc_ioctl_reqbufs,
.vidioc_querybuf = uvc_ioctl_querybuf,
.vidioc_qbuf = uvc_ioctl_qbuf,
.vidioc_expbuf = uvc_ioctl_expbuf,
.vidioc_dqbuf = uvc_ioctl_dqbuf,
.vidioc_create_bufs = uvc_ioctl_create_bufs,
.vidioc_streamon = uvc_ioctl_streamon,
.vidioc_streamoff = uvc_ioctl_streamoff,
...
};
边栏推荐
- Tensorflow and torch code verify whether CUDA is successfully installed
- Understanding disentangling in β- VAE paper reading notes
- test about BinaryTree
- [matlab] Simulink the input and output variables of the same module cannot have the same name
- A method of removing text blur based on pixel repair
- C language daily practice - day 22: Zero foundation learning dynamic planning
- Qlabel marquee text display
- Characteristic colleges and universities, jointly build Netease Industrial College
- Actf 2022 came to a successful conclusion, and 0ops team won the second consecutive championship!!
- Graffiti intelligence is listed on the dual main board in Hong Kong: market value of 11.2 billion Hong Kong, with an annual revenue of 300 million US dollars
猜你喜欢
Based on butterfly species recognition
openmv4 学习笔记1----一键下载、图像处理背景知识、LAB亮度-对比度
关于静态类型、动态类型、id、instancetype
倒计时2天|腾讯云消息队列数据接入平台(Data Import Platform)直播预告
[depth first search] Ji suanke: Square
C language daily practice - day 22: Zero foundation learning dynamic planning
提前解锁 2 大直播主题!今天手把手教你如何完成软件包集成?|第 29-30 期
AUTOCAD——中心线绘制、CAD默认线宽是多少?可以修改吗?
Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
Wx applet learning notes day01
随机推荐
Fast power template for inverse element, the role of inverse element and example [the 20th summer competition of Shanghai University Programming League] permutation counting
ROS自定义消息发布订阅示例
Meilu biological IPO was terminated: the annual revenue was 385million, and Chen Lin was the actual controller
The list of people who passed the fifth phase of personal ability certification assessment was published
黑馬--Redis篇
Precautions for binding shortcut keys of QPushButton
上海部分招工市場對新冠陽性康複者拒絕招錄
Tensorflow and torch code verify whether CUDA is successfully installed
Binary search tree
全套教学资料,阿里快手拼多多等7家大厂Android面试真题
倒计时2天|腾讯云消息队列数据接入平台(Data Import Platform)直播预告
A method of removing text blur based on pixel repair
CCNP Part 11 BGP (III) (essence)
美庐生物IPO被终止:年营收3.85亿 陈林为实控人
ROS custom message publishing subscription example
PMP每日一练 | 考试不迷路-7.6
渲大师携手向日葵,远控赋能云渲染及GPU算力服务
Actf 2022 came to a successful conclusion, and 0ops team won the second consecutive championship!!
test about BinaryTree
Xingnuochi technology's IPO was terminated: it was planned to raise 350million yuan, with an annual revenue of 367million yuan