2013年9月6日星期五

V4L2 camera capture frames the problem of low

Recently doing and camera -related applets , you need to ARM (linux system ) run on the board .
do have two USB camera , one is Logitech C210, the other one is bought on Taobao surveillance cameras .
with V4L2 write program to test these two cameras , both of which support YUYV format output, the former ( Logitech C210) test no problem , taken out of the frames 15FPS; while the latter ( surveillance cameras ) taken out of video only 2-3FPS (320 * 240 resolution ) , I looked in detail V4L2, there is a control command can set the number of frames , I frames set 30,15,10 , execute control commands when VIDIOC_S_PARM will be changed to 5 , it should be V4L2 used in the configuration and user settings will be the closest available values ​​, and here only supports five frames .

setfps-> type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
setfps-> parm.capture.timeperframe.numerator = 1;
setfps-> parm.capture.timeperframe.denominator = 30;
if (-1 == xioctl (fd_video, VIDIOC_S_PARM, setfps))
errno_exit ("VIDIOC_S_PARM");
printf ("numerator:% d, denominator:% d \ n",
setfps-> parm.capture.timeperframe.numerator,
setfps-> parm.capture.timeperframe.denominator);
/ / will output the numerator: 1, denominator: 5

I suspect that this may not be the problem of my program , but the camera is not good for V4L2 support ( do not know if there is this argument ) ? I do the following to try to lower the number of frames that the camera connected to the computer were in windows, Linux environment testing , windows environment there is no problem ; Under Linux, I got a Cheese Webcam Booth to test the camera, and windows environment , and the effect is very good, I did not Cheese that software source code , it is unclear whether it calls V4L2 or otherwise .

ask , how should I do next ?
------ Solution ---------------------------------------- ----
linux under v4l2 there are other interfaces besides you ?
I think you still find cheese webcam booth source code and see how it was done

------ Solution ------------------------------------ --------
v4l2 interface to the kernel or add trace information to see how cheese webcam booth calling
------ For reference only ------- --------------------------------


thanks reply ! I'll look around to see if there is source code.
------ For reference only -------------------------------------- -
allowed under different resolution frame is not the same .
I use a Logitech USB camera ( model I do not know ) .
Frame Rate 30
640 * 480 or less readout configurations are 30
800 * 600 is automatically changed to 20
higher resolution is changed to a lower frame rate .

640 * 480 YUYV acquisition frame rate is only 3 ~ 5fps
MJPEG 10 ~ 15fps

I would also like to know how to speed up acquisition frame rate it ?

------ For reference only ---------------------------------- -----


and usb transfer speed related ?
------ For reference only -------------------------------------- -
ah , I feel a relationship is likely to be more usb
------ For reference only ---------------------- -----------------
landlord , ask you a question , camera data collected , if you want real-time display, acquisition --- "Display these two stages are generally how to operate , I am not very clear understanding , in addition framebuffer to display , there are other ways you ?

没有评论:

发表评论