简体   繁体   English

从视频中提取帧的最快方法

[英]Fastest way to extract frame from video

Anybody tested what's the fastest way to extract frame from video? 有人测试过从视频中提取帧的最快方法是什么?

- Aforge -Aforge

- Emgu CV (OpenCV) -Emgu CV(OpenCV)

- AviFile -AviFile

- ffmpeg -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? 假设我需要在不到10毫秒的时间内捕获FullHD视频文件(1920 x 1080)的随机帧...可能吗?

I've tried to do it with Aforge and Avifile library. 我尝试使用Aforge和Avifile库来实现。 It is OK if you extract frame 1,2,3,4,5,... 提取第1,2,3,4,5,...帧就可以了

But if you want random frames like this 1,2,200,40000,... it takes sometimes 500 ms. 但是,如果您想要这样的1,2,200,40000随机帧,...有时需要500毫秒。 (Before pointer finds a location in stream). (在指针找到流中的位置之前)。

Any suggestions would be appreciated. 任何建议,将不胜感激。

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. 访问随机帧的关键因素是所使用的编解码器,其时间压缩,寻找I帧的能力,是否可以寻找最接近的I帧而不是精确地关注您的时间戳。 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). AForge,EmguCV,OpenCV只是直接与文件一起使用的API之上的包装,因此它们不可能是最快的(它们是基础访问方法+额外的开销)。 FFmpeg, and Windows APIs (AVIFile, DirectShow, Media Foundation) might be better or worse for a given format/codec depending on quality of implementation. FFmpeg和Windows API(AVIFile,DirectShow,Media Foundation)对于给定的格式/编解码器可能会更好或更坏,具体取决于实现的质量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM