H264 hardware decoding acceleration using ffmpeg, OpenCV

I am working on a video analytics application where I need to decode an RTSP stream to provide IplImage frames, which are then uploaded to my analytics pipeline. Now the OpenCV VideoCapture structure allows me to extract frames from the RTSP stream (I think ffmpeg is used for this), but the performance is not so great. It should work in real time.

I also went ahead and wrote my own ffmpeg decoder. But, like OpenCv, performance with RTSP streams is not very good. Many frames are discarded. However, decoding from a local file works fine. I'm still working on refining the code.

I need help with this. First, can I use hardware accelerated decoding here to improve performance? My application should be cross-platform, so I may need to use DirectX VA (windows) and VAAPI (linux). If so, is there a place where I can learn how to implement hardware acceleration in the code, especially for decoding ffmpeg h264?

+4
source share

Source: https://habr.com/ru/post/1440507/


All Articles