开发者

Seeking key frames using IMediaSample DirectShow.Net

As far as I know, inorder to check if a frame is a key frame or not, I have to check the IMediaSample::IsSyncPoint() method, which returns 0 (S_OK) if the frame is a key frame, or false in the other case.

But the IsSyncPoint() method is simply returning 0 in every frame that is grabbed and passed to the ISampleGrabberCB::SampleCB() callback method.

The code that my callback include is simple :

  public int SampleCB ( double sampleTime, IMediaSample mediaSample )
  {
   Console.WriteLine ( "SampleCB Callback" );
   Console.WriteLine ( mediaSample.IsSyncPoint ( ) + " " );

   Marsh开发者_Python百科al.ReleaseComObject ( mediaSample );
   return 0;
  }

What am I missing here?


What is your media type? If the sample grabber is receiving uncompressed video frames, then every frame is a sync point.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜