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
0
votes
1 answer

OpenCv VideoCapture Error in Linux - Setting property #0 is not supported

I want to open webcam in c++ using Opencv in Linux OS. int main() { VideoCapture video(0); // .. } But there is small problem: VIDEOIO ERROR: V4L2: setting property #0 is not supported I am only sure that webcam works. Because cheese…
0
votes
0 answers

More than one V4L-DVB driver on the same host machine

I have a question related to V4L-DVB drivers. Following the Building/Compiling the Latest V4L-DVB Source Code link, there are 3 ways to compile. I am curious about the last approach (More "Manually Intensive" Approach). It allows me to choose the…
Dawood
  • 11
  • 3
0
votes
1 answer

VIDIOC_REQBUFS Error 12 when opening multiple v4l2 sources

I'm using an 8-channel PCI-based framegrabber on Nvidia TX1 dev kit. I'm using this driver along with it. I can play up to 3/4 v4l2 camera feeds comfortably using mplayer, streamer or VLC but I always get a memory allocation error when I start…
alasin
  • 172
  • 3
  • 15
0
votes
2 answers

How to set extended controls in V4L2 correctly?

I want to record a video from a V4L2 device (from the Raspberry Pi camera) in C. The recording itself works and I can save the video to a file. However I need to change the bitrate of the video. From the strace output of the v4l2-ctl --set-ctrl…
user6507531
0
votes
1 answer

Cannot Enable Autoexposure via V4L2

I am using an ELP-USBFHD01M-L21 camera. It claims to have autoexposure support and when I plug it into my Mac it appears to be so. I downloaded a sample application on OS X that someone wrote that uses the USB Video Class commands to enable/disable…
Kenny
  • 675
  • 10
  • 24
0
votes
1 answer

See3cam Ubuntu-14.04 EclipseC++ library error

I tried to use Eclipse C++ to access See3cam CU40 camera which is in format of Y16 instead of RGB. I have installed required OpenCV library provided by the manufacturer but I encountered problems with libv4l2. Example: #include…
0
votes
1 answer

How to stop v4l2-ctl streaming?

Suppose I run v4l2-ctl --stream-mmap=3 --stream-to=/dev/null, how to stop recording without pressing Ctrl+C for interrupt, from another shell console for example?
Delgan
  • 18,571
  • 11
  • 90
  • 141
0
votes
1 answer

Choose yuy2 or MJPEG in V4L

I am implementing a Camera Preview application. I am using V4L and until now I basically use this code> https://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html In this example, or any other example I found for that matter, I could not find a…
BT9
  • 87
  • 1
  • 11
0
votes
1 answer

Video for Linux two poll returning POLLERR with errno EINVAL

I'v written a simple C shared object library which calls v4l2(Video for Linux two) API e.g. v4l2_open(). Then I'm trying to poll() on the returned device handle but it always return POLLERR in the revents. I tried different parameters with timeout…
user5505150
0
votes
0 answers

Drop in Fps while Reading From Camera

I have Two cameras, one is microsoft and another one is logitech. For both cameras i have used the below pipeline. gst-launch-1.0 -v v4l2src device=/dev/video1 ! videoconvert ! video/x-raw,format=I420,width=640,height=480 ! fpsdisplaysink For…
0
votes
1 answer

V4L2 preview with callback instead of polling-loop

I just started looking into V4L2 and all the samples I can find use loops to poll images from the camera. Is there a way to register a callback instead of looping? I can't figure out when to poll images and it does not seem like a good idea to just…
BT9
  • 87
  • 1
  • 11
0
votes
1 answer

How to use codec on linux for webcam recording with v4l2

I'm looking to write a C/C++ program to record a webcam video stream in a compressed video file. I'm using Ubuntu 14.04 LTS. Ideally, I want to use the available operating system codec to record the webcam images to my video file. What is the…
ssinfod
  • 975
  • 2
  • 15
  • 31
0
votes
0 answers

Frame Rate Control of Video from WebCam using V4l2src

I am using v4l2src for reading data from camera, gave that data to appsink and perform some processing on each frame. I am receiving data which is of 640X480 with 30fps. By using appsrc i am pushing that data into a pipeline. But the problem is,…
0
votes
1 answer

(V4L2 related) What do these 2 lines do?

s->buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; s->buf.memory = V4L2_MEMORY_MMAP; I must confess that I'm rather unfamiliar with V4L2 APIs. I fathom in the above two lines, the first one is to establish a buffer type, the second line is to pass the…
Tron Volta
  • 103
  • 5
0
votes
0 answers

ioctl return "inappropriate ioctl for device" with VIDIOC_S_CROP, attempting open camera in qt creator

Environment: laptop, Ubuntu, qt creator I wanna open the camera of the laptop and display the video in label in qt creator. When I run the program, nothing in the label. the part of code occur the error if(-1 == ioctl(fd, VIDIOC_S_CROP, &crop)) …