我想它應該與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. iOS6 - 社會框架 - SLComposeViewController如何回退到iOS5的TWTweetComposeViewController?
- 6. 如何退出父母/祖先框架點擊新框架
- 7. 玩!框架2.5如何在異步回調中返回delegate.call(ctx)
- 8. HTML5播放器框架 - 回退在IE8 Silverlight的工作不
- 9. Zk框架:如何從工具提示中退出HTML?
- 10. 如何在退出框架上獲取MessageDialog?
- 11. 在退出框架時卸載swf
- 12. 退出問題在html框架和codeIgniter
- 13. C#:如何使用directshow.net來顯示這個對話框?
- 14. 如何在Tkinter的框架中居中框架?
- 15. 框架導航中的UWP框架 - 如何訪問父框架?
- 16. Django Rest框架。如何取回作品
- 17. 如何在Pyramid/Pylon框架中返回javascript
- 18. 如何在實體框架中添加刪除回調?
- 19. 如何在django GET api(rest框架)中返回單個對象
- 20. 如何在實體框架中回滾事務
- 21. 如何在實體框架中返回列表?
- 22. 如何在fat-free框架中鏈接回index.php
- 23. 如何在Play中處理異步回調!框架?
- 24. 如何在量角器框架中返回值和承諾
- 25. 如何使用twitter框架在iOS 5.0中使用bitly框架?
- 26. 如何在Play框架中使用SORM框架?
- 27. 如何在Graphics View框架中使用Qt Model/View框架
- 28. 如何在Django REST框架認證中使用Graphene GraphQL框架
- 29. 如何在簡單框架中添加框架編號
- 30. 爲客戶端MV *框架提供no-js回退
好的,我知道,但你可能有一些很好的例子來尋找前進和後退? – 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