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

Reading Android camera device from native code, without root

I am working on an Android application that acquires camera frames using Video for Linux 2 APIs from /dev/videoN, where N is an integer starting from 0, such as /dev/video1, /dev/video2, etc. I am doing this in C/C++ for performance reasons; I…
atai
  • 43
  • 5
3
votes
0 answers

Gstreamer + h264 stream from c920 + v4l2loopback not working

I've been a month working in a project with cubieboard2 and the webcam logitech c920, after a lot of search and trial error I decided to use gstreamer + v4l2loopback for sending the hardware encoded h264 stream that provides the c920 to vlc and add…
xandre84
  • 31
  • 2
3
votes
2 answers

v4l2 kernel space debugging

Is there any default mechanism to enable debugging the v4l2 drivers. Basically I want to check something like dynamic debugging by setting in /d. Compile time flags in make file also fine. Currently, I had set as below, however not getting much…
Balamurugan A
  • 1,886
  • 2
  • 17
  • 19
3
votes
1 answer

Control V4L2/VB2 Buffer Allocation?

I am trying to write a V4L2 compliant driver for a special camera device i have, but the device doesn't seem particularly friendly with V4L2's buffer system. Instead of the separately allocated buffers, it wants a single contiguous block of memory…
Yeraze
  • 3,269
  • 4
  • 28
  • 42
3
votes
2 answers

Converting from YUY2 to RGB24 from V4L2 API

I am trying to use the V4L2 API to capture images and put the images into an opencv Mat. The problem is my webcam only captures in YUYV (YUY2) So I need to convert to RGB24 first. Here is the complete V4L2 code that I am using. I was able to get…
user1505520
  • 405
  • 1
  • 7
  • 15
3
votes
1 answer

OpenCV is able to change to composite input?

I would like to know if OpenCV is able to set the camera (dev/video1) to composite or S-video input. The camera I was using only runs in composite input, but v4l2 opens dev/video1 in S-Video input by default. V4l2 is able to change from S-video to…
user2155042
  • 33
  • 1
  • 7
3
votes
1 answer

V4l2 : difference between : Enque, Deque and Queue(ing) of the buffer?

I am a noob in v4l2 and tryign to find out the difference between the various ioctl calls made during the camera image capture. I am following this pdf from the linuxtv.org site I wanted to know the difference between the following : Query, Enque,…
Raulp
  • 7,758
  • 20
  • 93
  • 155
2
votes
1 answer

capturing webcam stream with V4L2 failed

I am getting started with the V4L2 framework on Ubuntu 10.4. currently I am using an webcam to do some tests. I am following this documentation to start, the installation was worked fine. I downloaded and compiled the application example. The…
The Mask
  • 17,007
  • 37
  • 111
  • 185
2
votes
2 answers

Can v4l2 be used to read audio and video from the same device?

I have a capture card that captures SDI video with embedded audio. I have source code for a Linux driver, which I am trying to enhance to add video4linux2 support. My changes are based on the vivi example. The problem I've come up against is that…
ryan
  • 884
  • 1
  • 9
  • 14
2
votes
0 answers

v4l2-ctl - set video length in seconds

How I can set video length? In my example v4l2-ctl --verbose -d 0 --set-fmt-video=width=1280,height=720,pixelformat=MJPG --stream-mmap --set-parm 25 --stream-to=video.yuvj422p --stream-count=100 I can set max framerate --set-parm 25 I can set…
2
votes
1 answer

Copying frames from camera (/dev/video0) to framebuffer (/dev/fb0) gives unexpected result

I have been trying to show frame from raspberry camera to screen with near best performance, and after research I found that the best way could be to use V4L2 library to directly communicate to drivers. In the next section I present my code. It…
2
votes
3 answers

Python/FFMPEG command line issues

I have a problem with running an FFMPEG command from within a Python script. When I run the following command from the terminal, I can stream video and audio from my attached webcam (Logitech C310) and output to file "out.avi" without any…
norway-firemen
  • 395
  • 4
  • 21
2
votes
1 answer

How to access camera and micphone in android?

I want to write a android progrom,now i access the codec via the openmax by use jni in android's ui,I found there is no video audio source or framebuffer in openmax components.My cell phone is qualcomm's msm7227 platform. in the qualcomm's website…
qlHE
  • 21
  • 1
2
votes
1 answer

Why can't I duplicate an MJPEG stream from a webcam to a V4L2 Loopback Device on Linux?

I'm trying to duplicate a USB webcam device V4L2 stream (/dev/video0) to a V4L2 Loopback Device (/dev/video99) at the highest resolution and framerate possible with the hardware available on a Raspberry Pi 4 running the latest Raspbian (also the…
2
votes
0 answers

Need to decode a RTSP stream to V4l2loopback with gstreamer

I am trying to decode an RTSP stream to a V4L2 device on a raspberry pi zero. first i create a loopback device this way.. sudo modprobe v4l2loopback video_nr=25 Then i try to decode the RTSP stream to a virtual V4L2 device. I would prefer if i…
nutron
  • 39
  • 3