Questions tagged [v4l2]

v4l2 (video for Linux 2) is a video capture interface for a variety of video capture devices tested to be fully compatible with Linux. v4l2 is commonly used by programs and frameworks such as Ekiga, gstreamer, Mplayer, Skype, and VLC media player.

A good place to start understanding the V4L2 framework is the following series of articles on lwn.net.

Part 1: The Video4Linux2 API
Part 2: registration and open()
Part 3: Basic ioctl() handling
Part 4: Inputs and Outputs
Part 5a: Colors and formats
Part 5b: Format negotiation
Part 6a: Basic frame I/O
Part 6b: Streaming I/O
Part 7: Controls

444 questions
26
votes
3 answers

v4l2 very simple example

I'm looking for a simple example for camera access in Linux using V4L2. Where I can find it? As simple, as possible. Thanks,
Alex Ivasyuv
  • 8,585
  • 17
  • 72
  • 90
15
votes
7 answers

Capturing multiple webcams (uvcvideo) with OpenCV on Linux

I am trying to simultaneously stream the images from 3 Logitech Webcam Pro 900 devices using OpenCV 2.1 on Ubuntu 11.10. The uvcvideo driver gets loaded for these. Capturing two devices works fine, however with three I run into the out of space…
geez
  • 173
  • 1
  • 2
  • 8
14
votes
2 answers

How to use V4L or V4L2 (Video for Linux) in Android?

Does Android Linux Kernel support V4L or V4L2 (Video for Linux). If not, is it possible to add it?
Walidix
  • 1,247
  • 5
  • 17
  • 27
14
votes
1 answer

Memory leak with VideoCapture in Python OpenCV

I am using 3 webcams to occasionally take snapshots in OpenCV. They are connected to the same usb bus, which does not allow for all 3 connections at the same time due to usb bandwidth limitations (lowering the resolutions allows at most 2…
GroovyPanda
  • 3,694
  • 8
  • 31
  • 42
13
votes
3 answers

How can I capture audio AND video simultenaous with ffmpeg from a linux USB capture device

I'm capturing a video by means of an USB Terratec Grabster AV350 (which is based on the em2860 chip). I don't succeed to get the audio when it is played . If I play the captured video with vlc or with ffplay I got only 3 seconds sound and then a…
oban
  • 141
  • 1
  • 1
  • 4
13
votes
3 answers

v4l2 Python - streaming video - mapping buffers

I'm working on a video capture script for Python in Raspbian (Raspberry Pi 2) and I'm having trouble using the Python bindings for v4l2, since I have no success on memory-maping the buffers. What I need: Capture video from a HD-WebCam (will be…
David
  • 453
  • 1
  • 4
  • 14
13
votes
5 answers

OpenCV (via python) on Linux: Set frame width/height?

I'm using openCV via python on linux (ubuntu 12.04), and I have a logitech c920 from which I'd like to grab images. Cheese is able to grab frames up to really high resolutions, but whenever I try to use openCV, I only get 640x480 images. I have…
Mike Lawrence
  • 1,641
  • 5
  • 20
  • 40
12
votes
4 answers

OpenCV: can't set resolution of video capture

I am using OpenCV 2.4.5 on Ubuntu 12.04 64-bit. I would like to be able to set the resolution of the input from my Logitech C310 webcam. The camera supports up to 1280x960 at 30fps, and I am able to view the video at this resolution in guvcview. But…
erobertc
  • 644
  • 1
  • 9
  • 20
12
votes
5 answers

Capturing h.264 stream from camera with Gstreamer

I'm trying to capture H264 stream from locally installed Logitech C920 camera from /dev/video0 with Gstreamer 1.0 v4l2src element. v4l2-ctl --list-formats shows that camera is capable to give H264 video format: # v4l2-ctl --list-formats ioctl:…
s.webbandit
  • 16,332
  • 16
  • 58
  • 82
10
votes
2 answers

mmap physically contiguous memory

I might have some misconceptions here, so bear with me. I wrote a program that captures images from a camera. I am sharing the memory between the camera and my application with mmap as I found in the V4L2 documentation. This works great. Now my…
Lucas
  • 13,679
  • 13
  • 62
  • 94
10
votes
1 answer

"Invalid or incomplete multibyte or wide character" running v4l2-ctl

Using iTerm, I'm SSHing into my raspberry pi (raspbian) to control a home security system I've setup. I need to change the focus of my camera, so I'm running v4l2-ctl -c focus_absolute=0 on my terminal. I've been doing this for weeks, and it hasn't…
niebula
  • 351
  • 1
  • 6
  • 13
10
votes
7 answers

Gstreamer Error: pipeline could not be constructed: no element "v4l2src"

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…
Akash Deshpande
  • 2,583
  • 10
  • 41
  • 82
10
votes
4 answers

cv2.videocapture.read() does not return a numpy array

I have this code trying to capture a frame from my webcam on raspberry pi, and saving it as an image. I use opencv 2, but I get strange errors when I run the code.. import time import sys from subprocess import call import cv2 cam =…
GrixM
  • 215
  • 2
  • 4
  • 20
10
votes
1 answer

How to write/pipe to a virtual webcam created by V4L2loopback module?

I have written an application which reads from a webcam and processes the frames using OpenCV on linux. Now I want to pipe the output of my application to a virtual webcam that has been created by the V4L2loopback module so other applications are…
user477519
  • 341
  • 1
  • 3
  • 11
10
votes
1 answer

How thread-safe is V4L2?

I couldn't find any mention of the thread safety characteristics of V4L2, except for this e-mail from 2008. It talks about the big kernel lock, which I guess is gone now, right? Does anybody have any updated information on this? Can I ioctl (I'm…
gspr
  • 11,144
  • 3
  • 41
  • 74
1
2 3
29 30