freeMXF.org

Open discussion about freeMXF.org tools and MXF in general
It is currently Sat Apr 04, 2020 2:52 pm
Board index » MXF Categories » freeMXF.org Tools



Post new topic Reply to topic  [ 2 posts ] 
Author
Search for:
Message

Offline
Board User

Joined: Mon Sep 10, 2007 1:46 pm
Posts: 12

Post Posted: Tue Oct 02, 2007 12:00 pm 
Top  
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!

 Profile  

Offline
Board User

Joined: Mon Sep 10, 2007 1:46 pm
Posts: 12

Post Posted: Thu Oct 04, 2007 9:33 am 
Top  
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?

 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

Jump to:  


Who is online

Users browsing this forum: No registered users and 3 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group :: Style based on FI Subice by phpBBservice.nl :: All times are UTC