我想它應該與IMediaSeeking SetPositions
完成,但我不知道如何定義裏面的參數。如何在DirectShow.NET中回退框架?
1
A
回答
2
在DirectShow中沒有專門的方法退後一步(因爲這種方法存在用於逐步前進)。是的,你可以使用IMediaSeeking::SetPositions
,但是請注意,它不是DirectShow本身實現它的人,而是實際的底層過濾器,因此支持重新定位取決於過濾器和實現,並且可能受限於例如逐步關鍵幀拼接點)。 DirectShow.NET在DirectShow上是一個包裝器,它也不會在DirectShow提供的步驟上添加任何東西。
0
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#包裝這些代碼對你來說可能並不困難。希望這可以幫助。
相關問題
- 1. websocket + node.js +回退框架
- 2. 我如何在Swift Mailer框架中設置回退php
- 3. 如何退出codekulptor中的simplegui框架?
- 4. 如何在directshow.net中使用CreateFilter方法?
- 5. 如何退出父母/祖先框架點擊新框架
- 6. 玩!框架2.5如何在異步回調中返回delegate.call(ctx)
- 7. 退出問題在html框架和codeIgniter
- 8. C#:如何使用directshow.net來顯示這個對話框?
- 9. 如何在Tkinter的框架中居中框架?
- 10. 框架導航中的UWP框架 - 如何訪問父框架?
- 11. Django Rest框架。如何取回作品
- 12. 如何在實體框架中回滾事務
- 13. 如何在量角器框架中返回值和承諾
- 14. 如何在Django REST框架認證中使用Graphene GraphQL框架
- 15. 如何在Play框架中使用SORM框架?
- 16. 如何在簡單框架中添加框架編號
- 17. 如何在Graphics View框架中使用Qt Model/View框架
- 18. isValid在zend框架中返回FALSE
- 19. DirectShow.Net中提供IOverlay接口
- 20. 如何按退回鍵退出程序?
- 21. 如何在實體框架
- 22. 如何在Zend框架
- 23. 如何在Django框架中使用Cassandra
- 24. 如何在GridSpec中對齊框架?
- 25. 如何在Spring框架中使用ORM ...?
- 26. 如何在windows phone中使用框架?
- 27. 如何在Java中鎖定框架(GUI)
- 28. 如何在Play框架中重定向?
- 29. 如何在iPhone中使用LLGeofence框架?
- 30. 如何在eclipse中包含codeigniter框架
好的,我知道,但你可能有一些很好的例子來尋找前進和後退? – Saint 2012-02-15 07:26:37
你可以用'IVideoFrameStep :: Step'尋求前進,這個工作很好。至於後退,最簡單的方法就是在時間之前設定一定的毫秒數。也許可以將一個緩存過濾器放入管道中,這樣它就可以保持框架並協助向後準確地後退,但聽起來像是一件複雜的事情,只是爲了能夠做出這樣一種[理所當然]簡單的事情。 – 2012-02-15 08:55:00
在Windows SDK中沒有C#的示例,因此尋找示例的最佳位置是http://directshownet.sourceforge.net/ – 2012-02-16 06:38:25