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
0 answers

Raw H264 frames in mp4 container using libavcodec

I'm trying to create an mp4 video using a camera that provides h264 raw compressed data (annex b format), without decoding or encoding operations.I use v4l2 to get frames from the camera and for each frame I fill an AVPacket and write it to the file…
Cristiano
  • 73
  • 1
  • 8
3
votes
1 answer

no such element "v4l2src" using gstreamer-1.0, but exists in gstreamer-0.10 [UBUNTU 16.04.2 LTS]

I'm having trouble with v4l2src in gstreamer-1.0, but it appears to be there in gstreamer-0.10. I've searched around online but none of the suggestions seems to make any difference. I've included a bunch of results below. Is there anything else I…
memo
  • 3,554
  • 4
  • 31
  • 36
3
votes
0 answers

Load and Play Video from V4L2 in Android like Live TV

I have a requirement that i have to load and Play the Video from V4L2 in Android. I am an Android application developer and i know how to stream and play a video from URL. But, here the case is completely different. I have to create an application…
Girish Setti
  • 167
  • 1
  • 1
  • 6
3
votes
0 answers

Write to dummy video stream using OpenCV

I'm using OpenCV and v4l2loopback library to emulate video devices: modprobe v4l2loopback devices=2 Then I check what devices I have: root@blah:~$ v4l2-ctl --list-devices Dummy video device (0x0000) (platform:v4l2loopback-000): …
Pavel Podlipensky
  • 8,201
  • 5
  • 42
  • 53
3
votes
0 answers

v4l2 overlay on Qt

We are working on a ov5640 sensor camera, we brought up the camera on our ARM platform(based on i.Mx6) and we tested the camera using v4l2 overlay application. Now we need to use that v4l2 application in the Qt5. Is any application explaining us…
sarjoon
  • 41
  • 6
3
votes
3 answers

Android NDK open() device permission denied

In a native call, I'm trying to open("/dev/video4", O_RDWR) but I get errno EACCES 13 "permission denied". If I run the same code* in an executable, on the same Android host, as the same UID of the installed app I'm running above, it works fine. (*…
jkoreska
  • 7,210
  • 2
  • 18
  • 21
3
votes
0 answers

How we can open /dev/video0 or any v4l2 node with ffmpeg for capture raw frames and encode it in jpeg format?

I am new in video domain . I am working now on ffmpeg , I use ffmpeg command line but there is very big issue and challenge for use ffmpeg in my own c code .So I read some tutorials like dranger.com etc . But I am not able to capture v4l2 or my…
satinder
  • 77
  • 10
3
votes
3 answers

setting/getting camera jpeg compression quality in v4l2 with JPEG pixel format via C/C++

Can you please show how to get and set the JPEG compression quality (with JPEG pixel format) in V4L2 via C++? I can detect the various pixel formats supported by the camera and the corresponding resolutions and frame-rates. I can also select them…
mcioni
  • 41
  • 1
  • 5
3
votes
1 answer

Record & live preview V4L2 /dev/video0 to H264 file with GStreamer

How to record only video from V4L2 input device and encode it to a file using H.264 while seeing a live preview of the input at the same time? Using GStreamer GStreamer 0.10.36 Command gst-launch-1.0 Using v4l-utils 1.6.3-3 Command v4l2-ctl
Gima
  • 1,892
  • 19
  • 23
3
votes
0 answers

YUYV conversion in python opencv to publish in v4l2 loopback

I am trying to convert an opencv image, generated from a webcam , to a virtual usb webcam using the v4l2 loopback following the example https://gist.github.com/TimSC/6532334 The problem is that the function to convert the image to YUYV is really…
olmerg
  • 425
  • 4
  • 6
3
votes
0 answers

Cannot open /dev/video0 (No such device)

I am trying to install a webcam on a Synology NAS (arm, linux kernel 3.2.40). I have compiled and installed the kernel modules, they seem to work. This is the kernel output when inserting the modules and plugging the camera (Logitech C270): [ …
user3044083
  • 59
  • 1
  • 1
  • 3
3
votes
2 answers

Is it possible to get good FPS using Raspberry Pi camera v4l2 in c++?

I'm trying to stream video on a Raspberry Pi using the official V4L2 driver with the Raspberry Pi camera, from C++ on raspbian (2015-02 release), and I'm having low FPS issues. Currently I'm just creating a window and copying the buffer to the…
maxbc
  • 949
  • 1
  • 8
  • 18
3
votes
0 answers

cv::videocapture can't open available USB cameras

I'm trying to connect to several USB cameras that are connected to different USB buses (hopefully cancelling the bandwidth bottleneck caused by the USB). Before accessing to the cameras, I'm probing them with V4L2 API directly to see if they're…
G. Ko
  • 403
  • 6
  • 15
3
votes
0 answers

mmap'ed memory access very slow

I use v4l2 to get video frame from camera using streaming io and need to do some calculation on the frame. However, accessing the frame memory is 10 times slower than allocating a malloc'ed memory. I guess the mmap'ed frame memory is not cacheable…
duwu891229
  • 31
  • 4
3
votes
1 answer

Gst-launch: Saving every image of a video stream while watching it

I'm currently trying to save a video stream into files using gst-launch while simultaneously watching the video itself (using v4l2src). As of now I got this by doing a work around with saving the images to files using ! multifilesink while having a…
miorli
  • 53
  • 1
  • 5