问题标签 [v4l2]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1464 浏览

linux - 如何使用 v4l2 读取视频文件

我想使用 v4l2 读取视频文件,比如 AVI 文件。并逐帧阅读。

据我所知,我需要使用 read() 函数。但是如何对我来说不是很清楚。也几乎没有任何可用的例子。所以也许一个关于如何做到这一点的简单例子会有所帮助。

0 投票
1 回答
6109 浏览

opencv - Ubuntu Opencv Camera settings V4L2 error 不支持曝光控制

我在 Ubuntu 12.04LTS 中编写了一个简单的 Opencv 程序,它可以调整网络摄像头(Logitech C525)的设置,例如亮度和曝光等。

它在 Windows 7 中运行良好,但在 Linux 中它给了我这个错误

$ ./adjust-camera
init done
opengl support available
HIGHGUI ERROR: V4L2: Unable to get property Exposure(9963793) - Invalid argument
HIGHGUI ERROR: V4L: Exposure control in V4L is not supported
HIGHGUI ERROR: V4L: Property Exposure(15) not设备支持
HIGHGUI ERROR: V4L: Property Exposure(15) not supported by device
HIGHGUI ERROR: V4L: Property Exposure(15) not supported by device

附带说明一下,如果我启动 Ubuntu 并插入网络摄像头,我可以使用 Cheese 之类的程序打开它。但是如果我用相机运行我的 Opencv 程序,在我关闭 Opencv 后,相机将不再能够在 Cheese 上显示。我必须重新启动 Ubuntu 才能让它与其他任何东西一起工作。

这是代码adjust-camera.cpp

这是我用来编译的脚本

这是相机使用 Cheese 或在 Windows 中使用我的 Opencv 程序显示的内容 这是相机使用 Cheese 或在 Windows 中使用我的 Opencv 程序显示的内容

这是 OpenCV 在 Ubuntu 上显示的内容 这是 OpenCV 在 Ubuntu 上显示的内容

有想法该怎么解决这个吗?

0 投票
1 回答
2759 浏览

v4l2 - v4l2-ctl 不会从默认网络摄像头更改

我正在从命令行使用 v4l2-ctl 来更改 USB 摄像头的曝光值,但我无法从内置网络摄像头更改设备当我使用时v4l2-ctl d /dev/video1- 它没有给出错误,但它什么也没做

0 投票
1 回答
1239 浏览

linux - Video4Linux2 API 中的设置间隔 ioctl 在哪里?

我目前正在使用 V4L2 API 从简单的网络摄像头捕获视频。一切似乎都工作正常,除了我找不到在 API 中设置帧间隔。

我使用 VIDIOC_ENUM_FRAMEINTERVALS ioctl() 来获取特定像素格式和图像大小的所有支持的帧间隔。所以驱动程序返回了许多支持的间隔。

但是我使用哪个 ioctl() 来实际设置特定的时间间隔?

有一个 VIDIOC_SUBDEV_S_FRAME_INTERVAL ioctl() 但它被标记为实验性的,文档说它应该只用于子设备垫,我没有使用。

那么,如何使用 V4L2 API 设置特定的帧间隔?

-安德烈斯

0 投票
0 回答
952 浏览

linux - MATLAB: Working with RaspberryPi's cameraboard and simulink for real-time acquisition

In the past versions of MATLAB you could use USB-camera block to acquire by raspberryPi but there was some lag, so acquisition was not real-time. With new Matlab version you can use matlab classes to control raspberry cameraboard:

http://www.mathworks.it/it/help/raspi/examples/working-with-raspberry-pi-camera-board.html

but you must set the duration of acquisition and it takes snapshot, etc...

I have followed this guide to use V4L2 camera block (usb-camera block) with cameraboard insted USB-camera:

http://www.raspberrypi.org/forums/viewtopic.php?f=43&t=67424

by remote execution of Linux command in matlab (like here):

but acquisition is not real-time (there is again lag that I told above) like USB-cameras.

Using the Linux cameraboard command, instead, with:

where 20000 is duration of acquisition in msec, it performs a real-time acquisition, so I was thinking to use that in a MATLAB Function block but I guess that class is not supported for code generation because it does not appear in this list and furthermore I must specify duration.

Is there someway to use that in a simulink block (working continuously) for real-time execution in this new matlab version?

0 投票
3 回答
13516 浏览

webrtc - Dummy video device - v4l2loopback - webRTC

I need to play multiple video for test a video server. I'm using lubuntu 14.04 and have installed V4l2loopback to make the device file ( /dev/videoN )

I am using mplayer to play video from this device as described mplayer cam

I have done the modify to the source code and successfully played the video and viewed with xawtv and with flashplayer (on firefox 28). I have tried to view with webRtc but it can't work.

Do you have some idea to do this? There is some particular pixelformat to define in examples/yuv4mpeg_to_v4l2.c ?

.....

I'm trying to find the problem using direct access to the resource with this script:

The video constraingts are take from mplayer output:

But the problem persists: "The following error occured: Starting video failed"..

The video is correctly played and visible both with xawtv and with flashplayer.

0 投票
1 回答
1297 浏览

linux - 控制 V4L2/VB2 缓冲区分配?

我正在尝试为我拥有的特殊相机设备编写符合 V4L2 的驱动程序,但该设备似乎对 V4L2 的缓冲系统并不特别友好。它不需要单独分配的缓冲区,而是需要一个能够保存一组缓冲区(通常为 4 个)的单个连续内存块,然后它提供一个状态寄存器告诉您哪个是最新的(在每帧经过 DMA 后更新给主人)。所以它基本上只需要一个大的 DMA 分配的内存块来工作,而不是 4 个最有可能分开的。

如何将它与 V4L 一起使用?我看到的所有内容VIDIOC_CREATE_BUFSVIDIOC_REQBUFS以及缓冲区的内部分配,我都无法获得任何基于 V4L 的东西(比如qv4l2在没有成功的情况下工作QBUF并且DQBUF使用它们的内部结构。

如何才能做到这一点?

0 投票
2 回答
5278 浏览

linux-kernel - v4l2 内核空间调试

是否有任何默认机制来启用调试 v4l2 驱动程序。基本上我想通过设置 /d 来检查动态调试之类的东西。make 文件中的编译时间标志也很好。

目前,我设置如下,但没有得到太多信息。

谁能帮我获取详细的 v4l2 日志?

0 投票
0 回答
1668 浏览

gstreamer - 来自 c920 + v4l2loopback 的 Gstreamer + h264 流不起作用

我已经在 cubieboard2 和网络摄像头罗技 c920 的项目中工作了一个月,经过大量搜索和试验错误后,我决定使用 gstreamer + v4l2loopback 将提供 c920 的硬件编码 h264 流发送到 vlc 并添加 textoverlay这个程序。

当我尝试将 gstreamer 与 v4l2loopback 一起使用时,问题就出现了。如果我使用罗技的原始流可以正常工作:

也可以这样

但是当我使用 h264 流时:

它不起作用,输出“流式传输任务已暂停,原因未链接(-1)”,奇怪的是程序输出的上限与我在管道上指定的上限不同:

/GstPipeline:pipeline0/GstUvcH264Src:src.GstGhostPad:vfsrc: caps = video/x-raw, format=(string)YUY2, width=(int)2304, height=(int)1536, pixel-aspect-ratio=(fraction )1/1, interlace-mode=(string)progressive, framerate=(fraction)2/1 /GstPipeline:pipeline0/GstUvcH264Src:src.GstGhostPad:vfsrc.GstProxyPad:proxypad0: caps = video/x-raw, format=( string)YUY2, width=(int)2304, height=(int)1536, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)2/1

我很确定问题与此有关,但我不知道如何继续尝试解决此问题,非常感谢任何帮助。

我在用着:

  • v4l2loopback (0.8.0)
  • Gstreamer 1.2.4
  • cubieboard2(手臂电脑)
  • 网络摄像头罗技 c920
0 投票
1 回答
2448 浏览

c++ - 如何获取视频采集设备信息?

我需要从 C++ 代码中查询连接的视频捕获设备(主要是网络摄像头)的设备信息。这些信息应至少包含帧速率、输出格式和控制值(颜色调整)。