skalf
skalf

Reputation: 1

Fastest way to extract frame from video

Anybody tested what's the fastest way to extract frame from video?

-Aforge

-Emgu CV (OpenCV)

-AviFile

-ffmpeg

And which format and codec of video to use?

Let's say that I need to capture random frames of FullHD video file (1920 x 1080) in less than 10 ms... Is it possible?

I've tried to do it with Aforge and Avifile library. It is OK if you extract frame 1,2,3,4,5,...

But if you want random frames like this 1,2,200,40000,... it takes sometimes 500 ms. (Before pointer finds a location in stream).

Any suggestions would be appreciated.

Upvotes: 0

Views: 2394

Answers (1)

Roman Ryltsov
Roman Ryltsov

Reputation: 69724

The key factor in accessing random frames is the codec in use, its temporal compression, ability to seek to I-Frame and is it OK for you to seek to nearest I-Frame instead of precisely to time stamp of your interest. Because of temporal compression you might need to [typically internally and transparently to you, but this obviously adds to up processing overhead] seek to nearest key frame and them advance frame by frame from there to requested position.

AForge, EmguCV, OpenCV are only wrappers on top of APIs that work with files directly, so they cannot be fastest (they are underlying access method + additional overhead). FFmpeg, and Windows APIs (AVIFile, DirectShow, Media Foundation) might be better or worse for a given format/codec depending on quality of implementation.

Upvotes: 1

Related Questions