简体   繁体   English

DirectShow-IMediaDet仅提取第一帧

[英]DirectShow-IMediaDet only extracts the first frame

I experienced a weird effect concerning DirectShow and splitters. 我对DirectShow和分离器产生了奇怪的效果。 I was not able to track it, so maybe somebody can help? 我无法跟踪它,所以也许有人可以帮忙吗?

In my application I extract a few frames from movies. 在我的应用程序中,我从电影中提取了几帧。 I do this by DirectShow's IMediaDet interface. 我通过DirectShow的IMediaDet接口执行此操作。 (BTW: It's XP SP3, DirectShow 9.0). (顺便说一句:它是XP SP3,DirectShow 9.0)。

Everything works fine, as long as there is no media splitter involved (this is the case for mp4, mkv, flv, ...). 只要不涉及媒体分割器,一切都可以正常工作(mp4,mkv,flv等都是这种情况)。 Concerning codecs I use the K-Lite distribution. 关于编解码器,我使用K-Lite发行版。 Since some time there are two splitters: LAV and Haali. 一段时间以来,有两个分离器:LAV和Haali。 The Gabest splitter has been removed since some time. 自从一段时间以来,Gabest拆分器已被删除。 But only with the latter activated everything worked fine! 但是只有激活了后者,一切都可以正常工作!

OK - the effect: OK-效果:

It's about IMediaDet.GetBitmapBits: Some (most) medias that uses splitters always extract the very first frame. 关于IMediaDet.GetBitmapBits:使用分割器的某些(大多数)媒体总是提取第一帧。 And with some other medias with splitters this effect is only when I used get_StreamLength before. 对于其他带有分离器的媒体,此效果仅在我之前使用过get_StreamLength时有效。 (Although GetBitmapBits should switch back to BitmapGrab mode, as the docu says.). (尽管文档说明,GetBitmapBits应该切换回BitmapGrab模式。) As said - everything works fine as far as no splitter is involved (mpg, wmv, ...). 如前所述-只要不涉及拆分器,一切都可以正常运行(mpg,wmv等)。

Does someone experienced a similar effect? 有人经历过类似的效果吗?

Where may be the bug: In DShow, in the splitters, in my code? 错误可能在哪里:在DShow中,在拆分器中,在我的代码中?

Any help appreciated ... :-) 任何帮助表示赞赏... :-)

Your assumption is not quite correct. 您的假设不太正确。 IMediaDet::GetBitmapBits builds a filter graph internally, and attempts to navigate playback to position of interest. IMediaDet::GetBitmapBits在内部建立过滤器图,并尝试将播放导航到感兴趣的位置。 Then starts streaming to get a valid image onto its Sample Grabber filter "BitBucket". 然后开始流式传输,以将有效图像传输到其Sample Grabber过滤器“ BitBucket”。

It does not matter if splitter is a separate filter or it is combined with source. 分离器是单独的过滤器还是与源组合都没有关系。 Important part is the ability of the graph to seek, a faulty filter might be an obstacle there, even though the snapshot is taken. 重要的部分是图形的搜索能力,即使拍摄快照,错误的过滤器也可能成为障碍。 This is the symptom you are describing. 这是您正在描述的症状。

For instance the internal graph might be like this: 例如内部图可能是这样的:

在此处输入图片说明

There is a dedicated multiplexer there, and snapshot is taken from correct position. 那里有一个专用的多路复用器,快照是从正确的位置拍摄的。

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

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