当前位置:网站首页>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,
...
};
边栏推荐
- Pytorch common loss function
- Online notes
- LeetCode-1279. 红绿灯路口
- First day of rhcsa study
- Method of accessing mobile phone storage location permission under non root condition
- Don't miss this underestimated movie because of controversy!
- 五金机电行业供应商智慧管理平台解决方案:优化供应链管理,带动企业业绩增长
- 提前解锁 2 大直播主题!今天手把手教你如何完成软件包集成?|第 29-30 期
- R语言ggplot2可视化:使用ggpubr包的ggviolin函数可视化小提琴图
- A method of removing text blur based on pixel repair
猜你喜欢
![A wearable arm device for night and sleeveless blood pressure measurement [translation]](/img/fd/947a38742ab1c4009ec6aa7405a573.png)
A wearable arm device for night and sleeveless blood pressure measurement [translation]

wx小程序学习笔记day01

中缀表达式转后缀表达式详细思路及代码实现
![Estimate blood pressure according to PPG using spectral spectrum time depth neural network [turn]](/img/f2/194ae452609d3e474b7b580d61bf4f.png)
Estimate blood pressure according to PPG using spectral spectrum time depth neural network [turn]

AUTOCAD——中心线绘制、CAD默认线宽是多少?可以修改吗?

基于蝴蝶种类识别

能源行业的数字化“新”运维

Digital "new" operation and maintenance of energy industry

Black Horse - - Redis Chapter

MRO industrial products enterprise procurement system: how to refine procurement collaborative management? Industrial products enterprises that want to upgrade must see!
随机推荐
The nearest library of Qinglong panel
About NPM install error 1
抽象类与抽象方法
pychrm社区版调用matplotlib.pyplot.imshow()函数图像不弹出的解决方法
Solve DoS attack production cases
R语言使用dt函数生成t分布密度函数数据、使用plot函数可视化t分布密度函数数据(t Distribution)
Tensorflow and torch code verify whether CUDA is successfully installed
Fast power template for inverse element, the role of inverse element and example [the 20th summer competition of Shanghai University Programming League] permutation counting
安装Mysql报错:Could not create or access the registry key needed for the...
test about BinaryTree
Interface test tool - postman
青龙面板最近的库
QLabel 跑马灯文字显示
RT-Thread 组件 FinSH 使用时遇到的问题
Analysis of frequent chain breaks in applications using Druid connection pools
R语言ggplot2可视化:使用ggpubr包的ggstripchart函数可视化分组点状条带图(dot strip plot)、设置add参数为不同水平点状条带图添加箱图
Black Horse - - Redis Chapter
AIRIOT物联网平台赋能集装箱行业构建【焊接工位信息监控系统】
能源行业的数字化“新”运维
php+redis实现超时取消订单功能