Ask Your Question

Revision history [back]

Failed to get second frame from a CSI camera module

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?

Failed to get second frame from a CSI camera module

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.loop.

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?

Failed to get second frame from a CSI camera module

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.

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?

Failed to get second frame from a CSI camera module

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.

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 If the loop of code is changed to:

  1. open the pipeline

  2. read frame

  3. show image and wait until user hit a key

  4. release the pipeline (cap.release();) and go back to 1.

Then frames can be captured one by one successfully.

How should I use the VideoCapture class?class to capture a series of frames without release the pipeline after retrieving every frame?

Failed to get second frame from a CSI camera module

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.

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

If the this loop of code is changed to:

  1. open the pipeline

  2. read frame

  3. show image and wait until user hit a key

  4. release the pipeline (cap.release();) and go back to 1.

Then frames can be captured one by one successfully.

How should I use the VideoCapture class to capture a series of frames without release the pipeline after retrieving every frame?