The Camera driver in Video4Linux2-general Linux technology-Linux programming and kernel information. For details, see the following. The younger brother is working on a camera application, but it is estimated that the driver code needs to be modified to solve some problems.
However, the structure of V4L2 is not very clear. Thanks for your advice!
My approach is:
1. Enable usb camera (/dev/video1) (O_RDWR) in block Mode)
2. Set picture format: 2048x1536, V4L2_PIX_FMT_YUYV (VIDIOC_S_FMT)
3. The mmap method is used. VIDIOC_QBUF contains two buckets.
4. Start video stream (VIDIOC_STREAMON)
5. Get a frame (VIDIOC_DQBUF)
6. Queue buffer back (VIDIOC_QBUF)
7. Stop video stream (VIDIOC_STREAMOFF)
Problems:
The data obtained in the above step 1 sometimes shows an exception (about 5th probability)
The exception picture shows a "misaligned" block"
Because YUYV data cannot determine its validity, I used the MJPEG format to capture images,
However, data from VIDIOC_DQBUF is sometimes incorrectly formatted (invalid MJPEG header ).
==========================================
Thank you for your comments!
I am now viewing the USB camera driver code, but there is no direction.
Thank you very much for your advice.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service