当前位置:网站首页>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,
...
};
边栏推荐
- Modulenotfounderror: no module named 'PIL' solution
- ACTF 2022圆满落幕,0ops战队二连冠!!
- Oracle advanced (IV) table connection explanation
- An error occurs when installing MySQL: could not create or access the registry key needed for the
- Implementation of AVL tree
- ROS custom message publishing subscription example
- 同宇新材冲刺深交所:年营收9.47亿 张驰与苏世国为实控人
- How word displays modification traces
- How to improve website weight
- Airiot IOT platform enables the container industry to build [welding station information monitoring system]
猜你喜欢
Analysis of frequent chain breaks in applications using Druid connection pools
If you have any problems, you can contact me. A rookie ~
AIRIOT物联网平台赋能集装箱行业构建【焊接工位信息监控系统】
三年Android开发,2022疫情期间八家大厂的Android面试经历和真题整理
An error occurs when installing MySQL: could not create or access the registry key needed for the
How word displays modification traces
LeetCode-1279. Traffic light intersection
Solution of commercial supply chain management platform for packaging industry: layout smart supply system and digitally integrate the supply chain of packaging industry
Pytorch common loss function
Describe the process of key exchange
随机推荐
Master Xuan joined hands with sunflower to remotely control enabling cloud rendering and GPU computing services
English topic assignment (25)
Synchronous development of business and application: strategic suggestions for application modernization
三面蚂蚁金服成功拿到offer,Android开发社招面试经验
Solution of intelligent management platform for suppliers in hardware and electromechanical industry: optimize supply chain management and drive enterprise performance growth
[translation] a GPU approach to particle physics
About NPM install error 1
使用map函数、split函数一行键入多个元素
R language ggplot2 visualization: use the ggstripchart function of ggpubr package to visualize the grouped dot strip plot, and set the add parameter to add box plots for different levels of dot strip
如何提高网站权重
Black Horse - - Redis Chapter
美庐生物IPO被终止:年营收3.85亿 陈林为实控人
Wx applet learning notes day01
php+redis实现超时取消订单功能
Xingnuochi technology's IPO was terminated: it was planned to raise 350million yuan, with an annual revenue of 367million yuan
Implementation of AVL tree
R语言dplyr包进行数据分组聚合统计变换(Aggregating transforms)、计算dataframe数据的分组均值(mean)
Test technology stack arrangement -- self cultivation of test development engineers
Certains marchés de l'emploi de Shanghai refusent d'embaucher des personnes qui se rétablissent positives à Xinguan
JDBC详解