v4l2

Two webcams on one usb 2.0 hub - works in windows but not linux

牧云@^-^@ 提交于 2019-12-06 15:27:31
The openCV code below grabs simultaneous images from two cameras. It works fine in windows, with the cameras both attached to one usb 2.0 hub. When I try the same code in linux, it only has enough bandwidth for one camera at a time. I've also tried viewing the two streams at once with guvcview, same issue. What I need is some way to force the webcams to work together, possibly by setting the amount of bandwidth the driver requests. capture = cv.CaptureFromCAM(0) capture2 = cv.CaptureFromCAM(1) while True: frame = cv.QueryFrame(capture) frame2 = cv.QueryFrame(capture2) cv.ShowImage("w1", frame)

OpenCV output on V4l2

。_饼干妹妹 提交于 2019-12-05 21:04:32
I wanted to know if I can use "opencv" to write on a v4l2 device. I would take a picture, apply small changes with the features of opencv, and then send it on a v4l2 device. I searched on the web, but there are a lot of examples on how to read from a V4L2 device, but I found nothing about writing on v4l2. can someone help me? The question is 8 month old, but if you still need an answer (I suppose your OS is Linux): Install v4l2 loopback module 1.1. Load and configure it linux: i.e. modprobe.conf: options v4l2loopback video_nr=22,23 Use such C++/OpenCV code: gist 2.1. Setup device using ioctl()

Gstreamer Error: pipeline could not be constructed: no element “v4l2src”

不打扰是莪最后的温柔 提交于 2019-12-04 10:57:25
Am using Ubuntu(14.04) and I am getting this error while trying to use gstreamer. gst-launch-1.0 v4l2src ! video/x-raw,width=640,height=480 ! x264enc ! h264parse ! rtph264pay ! udpsink host=127.0.0.1 port=5000 I have checked the gst-inspect-1.0 v4l2src It say element not found "No such element or plugin 'v4l2src'" What should I do ? From where can I get this element or plugin. I have tried resinstalling entire gstreamer. But am unable to do so. the v4l2src plugin belongs to the gstreamer-plugins-good package; so sudo apt-get install gstreamer1.0-plugins-good should help you out Gstreamer

Where does v4l2_buffer->timestamp value starts counting?

一世执手 提交于 2019-12-03 17:25:23
I am trying to use v4l2_buffer's timestamp value (type timeval) to synchronize images captured from a UVC webcam to external events. However the timestamp is not the same as the system time, or the up time, etc: printf("image captured at %ld, %ld\n", buffer->timestamp.tv_sec, buffer->timestamp.tv_usec); struct timeval tv; gettimeofday(&tv, 0); printf("current time %ld, %ld\n", tv.tv_sec, tv.tv_usec); Results in image captured at 367746, 476270 current time 1335083395, 11225 My uptime is 10 days. According to http://comments.gmane.org/gmane.linux.drivers.video-input-infrastructure/39892 some

v4l2 very simple example [closed]

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm looking for a simple example for camera access in Linux using V4L2. Where I can find it? As simple, as possible. Thanks, 回答1: Try the uvccapture code here -> http://staticwave.ca/source/uvccapture/ It is very small yet very concrete example which makes use of all the V4l2 concepts (open,set format, allocate memory, Request Buffer, Dqbuffer and Query-buffer - all intems of ioclts). uvcgrab () function is the one to look for which makes use of Dqbuffer and Query-buffer. ioctl (vd->fd, VIDIOC_DQBUF, &vd->buf); ioctl (vd->fd, VIDIOC_QBUF,

v4l2-ctl 控制命令

匿名 (未验证) 提交于 2019-12-03 00:30:01
# v4l2-ctl Usage: Common options: Uncommon options: Modulate as mono Modulate as mono with RDS (radio only) Modulate as stereo Modulate as bilingual Modulate as mono with Second Audio Program 例如: 1、v4l2-ctl --all //显示Camera所有信息 文章来源: v4l2-ctl 控制命令

流媒体:V4L2视频获取

匿名 (未验证) 提交于 2019-12-03 00:30:01
从深圳回来已经20多天了,除了完善毕业设计程序和论文,其他时间都去玩游戏了。真的是最后的一段时间能够无忧无虑在校园里挥霍自己的青春了。今天完成的答辩,比想象的要简单,一直以来想把我现在的这个流媒体的东西用文字记录下来,但是都去玩了。但是今天开始还是把这些东西都记录下来。其实整个项目最开始接触的是socket编程,用socket写一个很简单的机遇POP3协议的邮件发送程序都觉得沾沾自喜。现在看来但是确实还是很幼稚的。。。   其实V4L2就是LINUX下的一套API,我刚刚开始接触的时候觉得好难,完全就TMD看不懂啊。。。反正就是各种不靠谱,其实现在看来这些东西不难,其实很简单。只是当时没有决心去做而已。其实大多数的初学者都有我这样的想法,看着这些不熟悉的东西都会很烦躁,沉不住气不想去看。但是事实是多看看多GOOGLE查查基本就能理解了。下面是API的代码解析: 1)打开一个视频设备: fd = open( " /dev/video0 " , O_RDWR /* |O_NONBLOCK */ , 0 );   要从摄像头中回去到图像首先当然要打开一个摄像头,在LINUX中对摄像头的操作是对相应的设备文件进行操作实现的。在LINUX的根文件系统中/dev目录有很多设备文件,其中摄像头对应的是viode0,使用open函数打开,O_RDWR表示读写,O_NONBLOCK表示非阻塞

Camera--V4L2驱动学习记录

匿名 (未验证) 提交于 2019-12-03 00:21:02
Camera--V4L2驱动学习记录 Video for Linux Two 1.V4l2_device struct v4l2_device { / * - > to . : NULL if is is case . g . . * / * dev ; / * to * / ; / * ; if is . * / ; / * , + * / [ V4L2_DEVICE_NAME_SIZE ] ; / * sub - devices . * / ( * notify ) ( * sd , int , * arg ) ; } ; int ( * dev , * v4l2_dev ) { if ( = = NULL ) - EINVAL ; ( & v4l2_dev - > subdevs ) ; ( & v4l2_dev - > lock ) ; - > = ; if ( = = NULL ) { / * If = = NULL , then in * / ( ! v4l2_dev - > name [ 0 ] ) ; ; } / * Set to + if is empty . * / if ( ! v4l2_dev - > name [ 0 ] ) ( v4l2_dev - > name , ( v4l2_dev - > name ) , "%s %s" , - > driver

How do I capture and Process each and every frame of an image using CImg library?

大憨熊 提交于 2019-11-30 19:25:17
问题 I'm working on a project based on real time image processing using CImg Library in Raspberrypi. I need to capture images at higher frame rates (say atleast 30 fps), when I use the inbuilt Raspicam commands such as sudo raspistill -o -img_%d.jpg -tl 5 -t 1000 -a 512 /* -tl : time lapse duration in msec -t : total time duration (1000 msec = 1 sec) -a : displays frame numbers */ with this command though it shows 34 frames per second,I could only capture maximum of 4 frames/images (and rest of

How do I enable the UVC_QUIRK_FIX_BANDWIDTH quirk in Linux UVC Driver?

戏子无情 提交于 2019-11-30 09:25:30
I am currently trying to run 2 webcams on a Wandboard board, which have to share a USB hub. Problem is , the current driver implementation (YUV only) saturates the USB hub and in the end I can only connect one camera. However the UVC driver implementation has a quirk for this kind of situation, and others. Problem is, I did not find any documentation on how to load these quirks. Could you please assist me with that? you can change the behaviour of many kernel-modules by passing some parameters. you can get a list of all available module parameters with the modinfo command: # modinfo uvcvideo