- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我开始使用 Ubuntu 10.4 上的 V4L2 框架。
目前我正在使用网络摄像头进行一些测试。我正在关注 this文档开始,安装工作正常。我下载并编译了应用示例。问题是视频输出,我调用可执行文件使用:
# modprobe -r pwc
# modprobe -v pwc fps=15 compression=3 mbufs=4 fbufs=4 size=vga
# ./capturer_mmap -D /dev/video0 -w 640*480 -p 0 | ./viewer -w 640*480 -p 0
给定这个输出:
终端输出:
window size 640*480
Video bytespreline = 1280
Display:
Image byte order = LSBFirst
Bitmap unit = 32
Bitmap bit order = LSBFirst
Bitmap pad = 32
Window:
Depth = 24
Red mask = 0x00ff0000
Green mask = 0x0000ff00
Blue mask = 0x000000ff
Bits per R/G/B = 8
Image byte order = LSBFirst
Bitmap unit = 32
Bitmap bit order = LSBFirst
Bitmap pad = 32
Depth = 24
Red mask = 0x00ff0000
Green mask = 0x0000ff00
Blue mask = 0x000000ff
Bits per pixel = 32
Bytes per line = 2560
IsShared = True
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
after 431 requests (19 known processed) with 0 events remaining.
root@my-laptop:/home/foo/V4l2_samples-0.4.1# ./capturer_mmap -D /dev/video0 -w 640*480 -p 0 | ./viewer -w 640*480 -p 0
window size 640*480
Video bytespreline = 1280
Display:
Image byte order = LSBFirst
Bitmap unit = 32
Bitmap bit order = LSBFirst
Bitmap pad = 32
Window:
Depth = 24
Red mask = 0x00ff0000
Green mask = 0x0000ff00
Blue mask = 0x000000ff
Bits per R/G/B = 8
Image byte order = LSBFirst
Bitmap unit = 32
Bitmap bit order = LSBFirst
Bitmap pad = 32
Depth = 24
Red mask = 0x00ff0000
Green mask = 0x0000ff00
Blue mask = 0x000000ff
Bits per pixel = 32
Bytes per line = 2560
IsShared = True
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
after 101 requests (19 known processed) with 0 events remaining.
我不知道如何解决这个问题。我相信问题出在 C 代码中,因为我可以将网络摄像头与 Webcam Chesse 应用程序一起使用。非常感谢任何帮助。非常感谢!
最佳答案
看起来您正在以完全错误的格式显示图像。
在使用 v4l2 时,您一定要查看“libv4l”(打包在 debian 中,因此在 ubuntu 中也可用)。 v4l2 允许设备以大量视频格式中的任何一种输出其帧,其中一些是压缩的(例如使用 jpeg)。core v4l2 不提供任何方法将图像转换为您的应用程序支持的给定格式,因此理论上您的应用程序必须支持所有可能的格式。
为了避免代码重复(每个支持 v4l2 的应用程序都面临同样的问题!),创建了 libv4l:它允许对设备进行低级访问,但同时保证可以使用一些标准格式。例如如果设备仅支持 jpeg 输出并且您的应用程序请求 RGB32 帧,libv4l 将透明地为您转换。
您甚至可以将 libv4l 与一些 LD_PRELOAD 技巧一起使用,以使其适用于在没有 libv4l-support 的情况下编译的应用程序(只是为了检查我的建议是否有意义)
关于使用 V4L2 捕获网络摄像头流失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9450257/
我有一个看起来像这样的 df: visits ={'someID':[111,111,111,222,222,222,333,333], 'Month':[1,3,5,1,2,
我是一名优秀的程序员,十分优秀!