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

v4l2 video capture example

this is my first post here and I hope I can find some help I'm working on embedded linux on samsung ok6410 board and ov9650 cmos camera I have to capture a video and save it on a SD-card I want to use a circular buffer that captures video and, when…
Rehab11
  • 483
  • 2
  • 7
  • 16
5
votes
2 answers

Running two v4l2loopback devices with their individual properties

Working with v4l2loopback devices I can run these two virtual devices: a) running the preview image from a Canon DSLR via USB through v4l2loopback into OBS: modprobe v4l2loopback gphoto2 --stdout --capture-movie | gst-launch-1.0 fdsrc fd=0 !…
Max N
  • 1,134
  • 11
  • 23
5
votes
1 answer

video capturing with V4l2 has dropped/lost frames

I have a scientific application which captures a video4Linux video stream. It's crucial that we capture each frame and no one gets lost. Unfortunately frames are missing here and there and I don't know why. To detect dropped frames I compare the…
Sebastian
  • 173
  • 10
5
votes
1 answer

How can I change webcam properties that OpenCV doesn't support but v4l2 API does?

I'm using OpenCV 3.1 and Python 2.7 to capture video frames from my webcam, Logitech C270. I'm also using video4linux2(v4l2) to set the properties of my camera but this led to a few problems. My OS is Ubuntu 15.04. The specific property I'm trying…
5
votes
2 answers

Writing to /dev/fb0 using OpenCV

So am a bit confused about doing an memcopy to a mapped frame buffer device (ex. /dev/fb0) hwne using OpenCV. For example, looking at one of the OpenCV capture functions for both C and C++: C: IplImage* cvQueryFrame(CvCapture* capture) C++: bool…
ClimbingLord
  • 51
  • 1
  • 2
5
votes
3 answers

streaming video to and from multiple sources

I wanted to get some ideas one how some of you would approach this problem. I've got a robot, that is running linux and uses a webcam (with a v4l2 driver) as one of its sensors. I've written a control panel with gtkmm. Both the server and client are…
Chris H
  • 6,433
  • 5
  • 33
  • 51
5
votes
2 answers

Gstreamer message to signal new frame from video source (webcam)

I am trying to save a stream from webcam as series of image using gstreamer. I have written this code so far... #!/usr/bin/python import sys, os import pygtk, gtk, gobject import pygst pygst.require("0.10") import gst def __init__(self): …
ekmungi
  • 488
  • 2
  • 5
  • 12
4
votes
1 answer

How to reduce Gstreamer Latency?

I wrote a pipeline that grabs a 720 X 576 image from a 1920 X 576 sensor with the v4l2src element on a Nvidia jetson xavier nx. The pipeline grabs the frame and then does 2 things: pushes the frame to the appsink element encode it and stream with…
Nir Rafman
  • 41
  • 3
4
votes
0 answers

Capturing a picture in c++ using v4l2, explaining the process

I have been struggling with making a c++ code for capturing a picture from web-camera. I successfully did it, but I would like some clarification about the process i took. So my code can be described in 6 steps, i will write them here along with my…
mcf1lmnfs
  • 41
  • 1
  • 4
4
votes
0 answers

Raspi v2 camera is not working with v4l2src

Environment :- Raspi v2 camera, Jetson nano board, Ubuntu 18.04 I started with nvarguscamerasrc and it's working :- gst-launch-1.0 nvarguscamerasrc sensor_mode=0 ! 'video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1, format=NV12'!…
4
votes
2 answers

Google chrome cannot detect v4l2loopback device

I'm trying to transmit my screen using ffmpeg and v4l2loopback, more when running the commands: sudo modprobe v4l2loopback devices=1 video_nr=2 card_label="Camera Loopback" and ffmpeg -f x11grab -framerate 30 -video_size 1366x768 -i :0.0 -f…
Gabriel
  • 101
  • 8
4
votes
2 answers

v4l2loopback device detected by Chrome, not seen by Zoom or Firefox

I am trying to create a loopback device from my webcam to be accessible from both Zoom and a browser. I created three v4l2loopback devices: sudo modprobe v4l2loopback devices=3 video_nr=10,11,12 card_label="Loopback_1","Loopback_2","Virtual_cam"…
uri sh.
  • 41
  • 1
  • 4
4
votes
0 answers

FFMpeg v4l2m2m green output

I'm using hardware encoding via FFMPEG and h264_v4l2m2m codec. If I'm using FFmpeg h264_v4l2m2m, the encoded video looks like this ffmpeg -i small.mp4 -vcodec h264_v4l2m2m grb_2-v4l2.avi [h264_v4l2m2m @ 0x13d24d0] driver 'bcm2835-codec' on card…
4
votes
0 answers

Webcam doesn't read through OpenCV but does with guvcview

I have a webcam of sorts that is quite old. I've been attempting to get it to work. I started out with guvcview which works, however it only gives me the first frame captured then stops. That's fine for now. I'm trying to recreate this behaviour…
donkey
  • 1,343
  • 13
  • 32
4
votes
0 answers

Using Android Pie's *native* UVC webcam driver?

Over the year's many people have made Android apps/libraries such as UVCCamera to view a UVC webcam video stream. However, the release notes for Android Pie seem to indicate that it now includes a native UVC driver: External camera support: Android…
1 2
3
29 30