Skip to content

ArtisteHsu/SampleV4L2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

SampleV4L2

Access V4L2 device by following steps:

  1. Open video device /dev/video0
  2. Query capability. Supprot video capture device only
  3. Query crop (resolution) capability of video capture device
  4. Query video format of video capture device
  5. Request video buffer
  6. Query and mmap buffer created by ioctl VIDIOC_REQBUFS
  7. Queue video buffer and get one frame
  8. Turn on video streaming
  9. Dequeue video buffer
  10. Process video buffer (Save JPEG file)
  11. Turn off video streaming
  12. Unmap buffer
  13. Close device

(Step 2~4 are V4L2 device capability query)

(Step 5~7 are allocating video buffer)

(Step 9 is where video image come)

How to build (Ubuntu 14.04 LTS)

 $ sudo apt-get install libjpeg-dev
 $ git clone https://github.com/ArtisteHsu/SampleV4L2.git
 $ cd SampleV4L2
 $ gcc samplev4l2.c -ljpeg -o samplev4l2

About

Sample application for access V4L2 video and save 1 frame in JPEG file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages