LitchiCheng/RV1106_Linux: Linux test for RV1106 dev board (github.com)
The following is the test code for calling the USB camera and saving continuous photos
#include <iostream>
#include "v4l2CapPicTool.h"
#include "timecost.h"
int main(int argc, char const *argv[])
{
v4l2CapPicTool vt("/dev/video0", 1080, 960, "jpg");
vt.init();
while (1){
usleep(100000);
{
timecost tmp("capture");
vt.capture();
}
{
timecost tmp("save");
vt.save("./test.jpg");
}
}
return 0;
}
Simultaneous testing, capture time
pico@luckfox:~$ sudo ./captureJpgApp
init success
capturetime spent:0.382155sec
savetime spent:0.003527sec
capturetime spent:0.073295sec
savetime spent:0.001937sec
capturetime spent:0.030448sec
savetime spent:0.003411sec
capturetime spent:0.025701sec
savetime spent:0.001992sec
capturetime spent:0.031095sec
savetime spent:0.003586sec
capturetime spent:0.025089sec
savetime spent:0.004171sec
capturetime spent:0.02678sec
savetime spent:0.001836sec
capturetime spent:0.031064sec
savetime spent:0.001938sec
As you can see, the capture time is about 0.03s, which is 30ms per frame, corresponding to 30fps.