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
4
votes
3 answers

Does OpenCV support v4l2?

I'm writing a Python program using OpenCV, but I cannot capture images from v4l2 cameras. I tried with both a PS2 EyeToy and Droidcam (Android virtual webcam), which are both using v4l2, and none of them work: cv.CaptureFromCAM(0) only returns…
Lord Spectre
  • 761
  • 1
  • 6
  • 21
4
votes
2 answers

android: permission denied while opening /dev/video4 (webcam) from JNI

I have configured v4l2 on my android device. I plug the webcam and see that /dev/video4 node is created. But when I try to open it from my JNI layer it says "Permission denied" I have tried the following 1) Change the permission of /dev/video4 so…
4
votes
1 answer

v4l2 fcntl.ioctl VIDIOC_S_PARM for setting fps and resolution of camera capture

I am trying to set fps and resolution of webcam and capture from it via v4l2 Python. v4l2 Python documentation is limited to ; >>> import v4l2 >>> import fcntl >>> vd = open('/dev/video0', 'rw') >>> cp = v4l2.v4l2_capability() >>> fcntl.ioctl(vd,…
y33t
  • 649
  • 4
  • 14
  • 23
4
votes
4 answers

Canon DSLR Video loop back using v4l2loopback and EDSDK Liveview?

I want to use my DSLR camera as video input for let say Skype / Google talk under Linux and Android. Is it possible to create a video loop back using v4l2loopback and Canon EDSDK ? how can I pipe the liveview buffer from the camera to the video loop…
Amit
  • 43
  • 1
  • 4
4
votes
1 answer

Timestamp for v4l2 image capture

I have a Linux application that processes camera images. Currently I provide buffers to the v4l2 kernel subsystem that are filled with image data. However I need to know, as exact as possible, when this frame was captured (by the camera). With…
Frankie
  • 653
  • 1
  • 9
  • 20
3
votes
1 answer

Cannot turn off/on CameraCapture using Python/opencv: Device or resource busy

When I try to re-open opencv's CameraCapture using Python I get: libv4l2: error setting pixformat: Device or resource busy HIGHGUI ERROR: libv4l unable to ioctl S_FMT libv4l2: error setting pixformat: Device or resource busy libv4l1: error setting…
Mathias
  • 398
  • 2
  • 6
3
votes
1 answer

How can I save an GStreamer RTSP stream of unknown type to a file

I'm using this Gstreamer pipeline to send an RTSP stream of a camera. ./gst-rtsp-launch --port 8554 "( v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=640,height=480 ! rtpvrawpay name=pay0 pt=96 )" I want to using playbin, so I don't…
3
votes
1 answer

modprobe: ERROR: could not insert 'v4l2loopback': Unknown symbol in module, or unknown parameter (see dmesg)

I am trying to set up virtual v4l2 devices on an AWS EC2 instance. I did apt install for v4l2loopback-dkms and v4l2loopback-utils. I get the following error when i try to set up devices with sudo modprobe v4l2loopback device=8 modprobe: ERROR: could…
k0342
  • 31
  • 3
3
votes
2 answers

Streaming Webcam with RTSP

I'm trying a live streaming of video using a web cam attached to my laptop. I am working in Linux Ubuntu. Here are the Gstreamer pipeline for server side and client side: Streaming server: I'm trying to use gst-rtsp-server to serve the video from a…
krynux
  • 31
  • 1
  • 1
  • 2
3
votes
0 answers

VIDIOC_G_STD: failed: Inappropriate ioctl doer device

I attempted the command below: v4l2-ctl -d 0 --get-standard But I get the error VIDIOC_G_STD: failed: Inappropriate ioctl for device The below command however works completely fine. v4l2-ctl -d 0 --all Any help would be appreciated. In my program…
pd109
  • 335
  • 2
  • 3
  • 12
3
votes
2 answers

No such element or plugin 'v4l2h264enc'

I'm trying to use GStreamer from docker container, built using this Dockerfile. The installation worked ok and I'm able to run GStreamer. However, I'm not able to use the element v4l2h264enc with the error that does not exist. When I run gst-inspect…
Miguel
  • 2,738
  • 3
  • 35
  • 51
3
votes
0 answers

capture v4l : no capture device - but Video Capture Multiplanar?

I would like to capture images from a camera. I used the usual v4lgrab example (https://www.kernel.org/doc/html/v5.4/media/uapi/v4l/capture.c.html) but fail. I get a message that it is not a capture device. Taking a closer look it is "Video…
Arno
  • 257
  • 1
  • 10
3
votes
2 answers

How would I assign multiple MMAP's from single file descriptor?

So, for my final year project, I'm using Video4Linux2 to pull YUV420 images from a camera, parse them through to x264 (which uses these images natively), and then send the encoded stream via Live555 to an RTP/RTCP compliant video player on a client…
Alex Stevens
  • 153
  • 2
  • 9
3
votes
1 answer

Getting the v4l2 device number for a connected USB camera (webcam) from a C application (Linux)

I'm working on a embedded Linux system (yocto) and I'm trying to simply get a list of the camera USB video devices (webcams) numbers with the related connected USB port from a C program. I'm able to get the devices list with vendor ID and connected…
joe
  • 309
  • 4
  • 16
3
votes
0 answers

ffmpeg: Send mp4 to fake webcam, "Invalid argument"

Trying to create a new fake webcam device (/dev/video2) and play a video on it so I can use it as a virtual webcam. Steps I took: sudo apt-get install v4l2loopback-dkms sudo modprobe v4l2loopback sudo depmod -a ffmpeg -i vid1.mp4 -vcodec rawvideo…
Joe Bid
  • 465
  • 8
  • 24