Hi!
On my system: Dragonboard 410c + Linaro Linux 19.01 + 96Boards MIPI Adapter with Dual OV5645 ( https://www.ebay.com/itm/96Boards-MIPI-Adapter-with-Dual-OV5645/253645902432?hash=item3b0e795260:g:L38AAOSwCmNZyJq5)
I tried to use
cv::VideoCapture cap(pipeline, cv::CAP_GSTREAMER);
to capture frames from one OV5645 image sensor using the following pipeline:
v4l2src device=/dev/video0 num-buffers=1 ! video/x-raw,format=UYVY,width=1920,height=1080 ! videoconvert ! appsink
In a loop of the code, it first gets a frame from OV5645,
cap.read(img)
shows it in a window, waits until the user hit a key, then starts the next iteration of the loop again.
The loop can get and show the first frame successfully, but it always fails to get the second frame (the cap.read() function will fail). Here is the code: https://gist.github.com/oliverjungen/06c7abe959486b9fbbb24d5838975c40
Is there anything wrong in how I use the VideoCapture class?