0

I want to read a video file using v4l2, say an AVI file. And read it frame by frame.

As far as I can tell I need to use the read() function. But how isn't very clear to me. There are also hardly any examples available. So maybe a simple example on how to do this would help.

user3379159
  • 111
  • 2
  • 12

1 Answers1

1

This is not what the Video4Linux2 (V4L2) API is for. It is not designed for reading multimedia files from disk, decoding them and playing them. Rather, it is designed to interface to assorted multimedia input devices (like webcams, microphones, TV tuners, and video capture devices), capture A/V data, and play it.

Take it from the V4L2 API introduction:

Video For Linux Two is [...] a kernel interface for analog radio and video capture and output drivers.

For reading an AVI file and decoding/playing it (programmatically) on Linux, look into FFmpeg or GStreamer.

Multimedia Mike
  • 12,660
  • 5
  • 46
  • 62