Search code examples
c++opencvrtsp

OpenCV cvCapture compressed data


Can I get compressed data from cvCapture, which is stored into buffer after cvGrabFrame, before using cvRetrieveFrame? I need to keep them in the an archive of compressed frames.

I use cvCaptureFromFile for getting rtsp stream from Axis IP camera.


Solution

  • As far as I see it it's not possible. CvCapture is a black box structure. There is not really a possibility to access the data inside.

    There is the function cv::imencode to compress images. It is not optimal to compress the image again but it should work.

    By the way, you're using the old C API and there is a newer API for C++ that makes capturing more elegant: cv::VideoCapture.