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

What is the use of mmap , userptr and dmabuf in video streaming using v4l2 drivers in linux?

enum v4l2_memory { V4L2_MEMORY_MMAP = 1, V4L2_MEMORY_USERPTR = 2, V4L2_MEMORY_OVERLAY = 3, V4L2_MEMORY_DMABUF = 4, }; Which is one of the fastest and efficient methods for video streaming…
2
votes
0 answers

VIDIOC_QBUF: Invalid argument V4l2 MEMORY USERPTR python implementation

I am trying to work with user-pointer v4l2 driver. Currently I am working with the v4l2 MMAP and its working fine, but I want to change it to user pointer because of reading performance. Working example (with mmap): def init_mmap(self, width=8192,…
2
votes
1 answer

v4l2 manual exposure not working compared to Windows 10

This question is very similar to V4L2 absolute exposure setting has (almost) not effect I have a UVC compliant camera that I am running on a Raspberry Pi CM3+ module. It appears as video0. Using the tools/drivers v4l2-ctl, qv4l2 or guvcview the…
tomdertech
  • 497
  • 1
  • 9
  • 27
2
votes
1 answer

Prevent GStreamer from changing camera format

Running GStreamer pipeline that feeds from v4l2src element may change camera format implicitly. Here is an example (also note that /dev/video0 is everywhere implied). One of my cameras supports these formats $ v4l2-ctl --list-formats-ext ioctl:…
2
votes
1 answer

FFMPEG + V4L2 OPTIONS

I am looking for a way to integrate the parameters of v4l2-ctl on ffmpeg the problem what ffmpeg overwrite v4l2-ctl and I need specific parameter has v4l2-ctl :( my v4l2-ctl commands is : v4l2-ctl -v width=640,height=480,pixelformat=4 -p 30 -c…
Pierre
  • 21
  • 1
  • 3
2
votes
1 answer

v4l2loopback cannot load module on aws ubuntu 18.04

Currently trying to install v4l2loopback into a ubuntu 18.04 instance at aws and facing the current situation After running (the same happens from source install) sudo apt-get install linux-generic (tempts to load videodev) sudo apt-get install…
lpeixotoo
  • 68
  • 1
  • 6
2
votes
0 answers

ffmpeg erorr as "video4linux2 Dequeued v4l2 buffer contains corrupted data (0 bytes). " when captured image,in beaglebone black,

when i'm capturing a image using ffmpeg 4.2.1 in debian 9.5 of Beaglebone black its not showing this error as [video4linux2,v4l2 @ 0x2e0f1e0] Dequeued v4l2 buffer contains corrupted data (0 bytes). i used this command to capture image "ffmpeg…
2
votes
0 answers

Cannot set backend for VideoCapture in Opencv 3.2.0

I like to catch a video given by a usb webcam with opencv. For this I try to use the VideoCapture class, with the v4l2 backend. Following the example at https://docs.opencv.org/3.2.0/d8/dfe/classcv_1_1VideoCapture.html I call the constructor in a…
Th0rn
  • 21
  • 2
2
votes
0 answers

How to set the PTS field with the time the frame was actual captured (using FFmpeg)?

Using FFmpeg, I want to update the PTS field with the time the frame was actual captured. I'm doing it with the following FFmpeg command (the "copyts" flag does the job): ffmpeg -re -f v4l2 -copyts -i /dev/video0 -c:v libx264 -intra -f mpegts…
J.M.
  • 472
  • 1
  • 6
  • 15
2
votes
1 answer

Setting ctrl with V4L2 on ov5640

I would like to control various ov5640 camera parameters by using ioctl and VIDIOC_S_CTRL from V4L2 in the following manner: #include #include #include #include #include #include…
jabk
  • 1,388
  • 4
  • 25
  • 43
2
votes
0 answers

Get focus position after auto focus using v4l2

Its possible to get the focus position after a auto focus call with v4l2 (V4L2_CID_FOCUS_AUTO). I know its possible to get the status (focused or not) using V4L2_CID_AUTO_FOCUS_STATUS, but I need the exact position after the auto focus.
Paulo Prado
  • 21
  • 1
  • 3
2
votes
0 answers

v4l2 device needs replugging on app restart

I have a simple c++ program where something like the following code is running in a thread to get a constant webcam feed. The first time everything works as expected. But after closing the application and running it again. The select() function…
underdoeg
  • 1,862
  • 4
  • 14
  • 26
2
votes
0 answers

Gstreamer v4l2src: Failed to allocate required memory

I'm writing a v4l2 driver but I've some problems when is used by gstreamer pipeline. I've implemented theese ioctl…
Andrea
  • 21
  • 1
  • 7
2
votes
1 answer

Weird outcomes using V4L2, python, on raspberry pi 3

Weird coding outcome which isn't making much sense. I am trying to capture from a raspberry pi camera using the V4L2 driver as I need to use cv2 for image processing. I am using python to write the code. The weirdness revolves around capturing…
Hojo.Timberwolf
  • 985
  • 1
  • 11
  • 32
2
votes
0 answers

FFmpeg Make Errors with v4l2

I tried checking out ffmpeg to build it as follows: git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg cd ffmpeg ./configure --disable-asm --disable-v4l2-m2m --disable-indev=v4l2 --disable-outdev=v4l2 make But I get the following…
Kumar
  • 21
  • 1