首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在DirectShow.NET中单步执行frame?

如何在DirectShow.NET中单步执行frame?
EN

Stack Overflow用户
提问于 2012-02-15 04:59:39
回答 2查看 2.2K关注 0票数 1

我想应该用IMediaSeeking SetPositions来完成,但我不知道如何在内部定义参数。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-02-15 06:48:08

在DirectShow中没有专用的后退方法(因此存在用于前进的方法)。是的,您可以使用IMediaSeeking::SetPositions,但是请注意,实现它的不是DirectShow本身,而是实际的底层筛选器,因此对重新定位的支持取决于筛选器和实现,并且可能仅限于单步执行关键帧(拼接点)。DirectShow.NET是DirectShow之上的一个包装器,它也没有在DirectShow提供的单步执行之上添加任何东西。

票数 2
EN

Stack Overflow用户

发布于 2012-02-21 23:03:16

代码语言:javascript
复制
IBasicVideo                 *pBasicVideo=NULL;//Interface to the Ibasic Video
HRESULT                     hr;
REFTIME                     pavgfrt=0;//Get the reftime variable
REFERENCE_TIME      pnowrt=0;//Get the reference time variable
pBasicVideo->get_AvgTimePerFrame(&pavgfrt);
pBasicVideo->get_AvgTimePerFrame(&pavgfrt);//Get the avg time per frame in seconds

pSeek->GetCurrentPosition(&pnowrt);//Get the current time in the unit of 100 nanoseconds
REFERENCE_TIME temp=pnowrt;//store it in a temp variable
REFERENCE_TIME temp1=(REFERENCE_TIME)(pavgfrt*10000000);//convert avg time into the format of current time
pnowrt=temp+temp1;//Add to framestep forward and subtract to framestep backward
pSeek->SetPositions(&pnowrt,AM_SEEKING_AbsolutePositioning, NULL,AM_SEEKING_NoPositioning);//Set the seeking position to the new time
pnowrt=0;//Reset the time variable

这对我在C++中很有效。用C#包装这段代码对您来说可能并不困难。希望这能有所帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9284097

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档