libArgus acquireFrame very slow

Hi,

Nvidia Xavier Agx, JetPack 4.3, imx477, 30fps

Here is simple capture function:

    const auto m_startTime{ utils::nano() };
    Argus::Status status{};
    m_iCaptureSession->capture( m_request.get(), Argus::TIMEOUT_INFINITE, & status );
    if( status == Argus::STATUS_OK )
    {
        std::vector< EGLStream::Image * > images( 1 );
        size_t cameraId{};
        Argus::UniqueObj< EGLStream::Frame > frame{ m_iFrameConsumers.at( 0 )->acquireFrame( Argus::TIMEOUT_INFINITE ) };
        EGLStream::IFrame * iFrame{ Argus::interface_cast< EGLStream::IFrame >( frame ) };
        images.at( 0 ) = iFrame->getImage();

        const auto loopMs{ ( utils::nano() - m_startTime ) / 1e6 };
        std::cout << "Capture time: " << loopMs << std::endl;        
    }

Longest call is acquireFrame is about 150ms. Total 160ms.
It is normal? How to speedup it?

Please help.
Best regards, Viktor.

Submit more capture request like below.

    // Submit the batch of capture requests.
    for (unsigned int frame = 0; frame < options.frameCount(); ++frame)
    {
        Argus::Status status;
        uint32_t result = iCaptureSession->capture(request.get(), TIMEOUT_INFINITE, &status);
        if (result == 0)
        {
            ORIGINATE_ERROR("Failed to submit capture request (status %x)", status);
        }
    }


Please, explain your idea.
I can request 1000 frames, then after that i can process them?
If i need 1 hour of frames?

Usually the frame latency is about 3 ~4 frames
For the first time it may need more time since need initialize stage.

Can you provide example?
How many frames i can request?
When i can acquireFrame? In parallel thread?

Have a check cudaBayerDemosaic in MMAPI sample code.

Thank you. Will try.

Hi,

Have tried batch request scheme from Argus bayer example. It works.

  1. Launched thread with acquireFrame
  2. Have requested 100 frames

All 100 frames were dispatched with ~33ms.

If i need to acquire frames every 200ms, then how i can do it?

  1. Run infinite request loop and count timestamps and select these frames?
  2. Or it is possible acquire directly every 200ms?

Please help to understand.

I would suggest 1. to drop few frames for your purpose.

Thanks.

Should i use acquireFrame for every frame when i drop N frames?
Due it is long time call, may be there is skip frame function in libArgus?

Just release the frame to return the buffer instead do any process to skip the frame.

1 Like

Just release it is go out of scope, after accuireFrame call?

Exiting from scope does it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.