当前位置:网站首页>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,
...
};
边栏推荐
- 五金机电行业供应商智慧管理平台解决方案:优化供应链管理,带动企业业绩增长
- MATLAB中deg2rad和rad2deg函数的使用
- LeetCode-1279. Traffic light intersection
- QLabel 跑马灯文字显示
- helm部署etcd集群
- Actf 2022 came to a successful conclusion, and 0ops team won the second consecutive championship!!
- Solution of commercial supply chain management platform for packaging industry: layout smart supply system and digitally integrate the supply chain of packaging industry
- R language uses DT function to generate t-distribution density function data and plot function to visualize t-distribution density function data
- tensorflow和torch代码验证cuda是否安装成功
- ModuleNotFoundError: No module named ‘PIL‘解决方法
猜你喜欢
提前解锁 2 大直播主题!今天手把手教你如何完成软件包集成?|第 29-30 期
同宇新材冲刺深交所:年营收9.47亿 张驰与苏世国为实控人
MRO工业品企业采购系统:如何精细化采购协同管理?想要升级的工业品企业必看!
The list of people who passed the fifth phase of personal ability certification assessment was published
Actf 2022 came to a successful conclusion, and 0ops team won the second consecutive championship!!
Characteristic colleges and universities, jointly build Netease Industrial College
Method of accessing mobile phone storage location permission under non root condition
Problems encountered in using RT thread component fish
Unlock 2 live broadcast themes in advance! Today, I will teach you how to complete software package integration Issues 29-30
Synchronous development of business and application: strategic suggestions for application modernization
随机推荐
test about BinaryTree
RT-Thread 组件 FinSH 使用时遇到的问题
ROS custom message publishing subscription example
The dplyr package of R language performs data grouping aggregation statistical transformations and calculates the grouping mean of dataframe data
helm部署etcd集群
Three years of Android development, Android interview experience and real questions sorting of eight major manufacturers during the 2022 epidemic
MRO industrial products enterprise procurement system: how to refine procurement collaborative management? Industrial products enterprises that want to upgrade must see!
R语言ggplot2可视化时间序列柱形图:通过双色渐变配色颜色主题可视化时间序列柱形图
Unlock 2 live broadcast themes in advance! Today, I will teach you how to complete software package integration Issues 29-30
Mathematical knowledge -- code implementation of Gaussian elimination (elementary line transformation to solve equations)
R language ggplot2 visualization: use ggviolin function of ggpubr package to visualize violin diagram
Based on butterfly species recognition
A wearable arm device for night and sleeveless blood pressure measurement [translation]
PMP每日一练 | 考试不迷路-7.6
If you have any problems, you can contact me. A rookie ~
Characteristic colleges and universities, jointly build Netease Industrial College
Openmv4 learning notes 1 --- one click download, background knowledge of image processing, lab brightness contrast
short i =1; i=i+1与short i=1; i+=1的区别
全套教学资料,阿里快手拼多多等7家大厂Android面试真题
【论文笔记】TransUNet: Transformers Make StrongEncoders for Medical Image Segmentation