lp35
lp35

Reputation: 308

FFMpeg vs. OpenCV for format conversion/simple transformation

I had to create a system that can process images in realtime. I have implemented in C++ a pixel format conversion system that can also do some simple transformation (currently: rotation & mirroring).

Input/output format of the system are frame in a the following formats:

For instance, one operation can be:

The goal of the system is to offer best performance for rotation/mirroring and pixel format conversion. My current implementation rely on OpenCV, but I suffer from performance issues when processing data above 2k resolutions.

The current implementation uses cv::Mat and cv::transpose/cv::flip/cv::cvtColor, and I optimized the system to remove transitionnal buffers and copy as much as possible.

Not very happy to reinvent the wheel, I know that using swscale and some filters from FFMpeg, it is possible to achieve the same result. My question are:

  1. The FFMpeg system is rather generic, do you think I might suffer from footprint/performance caveat with this solution?

  2. Format conversion seems somewhat ooptimized in OpenCV, but I have no idea about FFMpeg implementation... (note: I'm on x86_64 intel platform with SSE)

  3. Do you know any library than can handle this kind of simple transformation for real time?

Thank you

Upvotes: 4

Views: 3018

Answers (1)

Alex Cohn
Alex Cohn

Reputation: 57173

OpenCV implementation is optimised for your configuration. Don't expect improvements from ffmpeg. Recently, OpenCV switched to libjpeg-turbo with SSE optimizations, this may improve JPEG conversions.

Upvotes: 1

Related Questions