freeMXF.org
http://freemxf.org/forum/

How to read a certain video frame?
http://freemxf.org/forum/viewtopic.php?f=2&t=106
Page 1 of 1

Author:  LY [ Tue Oct 02, 2007 12:00 pm ]
Post subject:  How to read a certain video frame?

Hello,

Is there any easy way to read a certain video frame (not the frames in sequence) using MXFLib? How to do it?

Thanks in advance!

Author:  LY [ Thu Oct 04, 2007 9:33 am ]
Post subject: 

I wrote following code to find the 5. video frame (assume no IndexTable in the file, so I do not use it):
Code:
...
   theFile->Seek(0);
   KLVObjectPtr anElement;
   int FrameCount = 0;
   int mFrame = 5; // I want the 5. video frame
   while (FrameCount != mFrame)
   {
      anElement = theFile->ReadKLV();
      if (anElement->GetGCTrackNumber() == TrackNumber_v)
         FrameCount++;
      if ( theFile->Eof() )
      {
         cout<<"End of file!"<<endl;
         return -1;
      }
   }
   //Do what I want with this KLV
   //...

But it takes too long (minutes) to find it. It seems that it’s not a good way to do it. How can I do it better?

If I use Index Table which converts time offset to byte offset in the essence container (not from the beginning of the file), how can I locate the video frame in the file?

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/