Community
cancel
Showing results for 
Search instead for 
Did you mean: 
shinjite
Beginner
46 Views

UMC frame seeking h264 or mpeg

Hello - I currently have this method of seeking but it seems to be wrong because when the data is set in the code below and that data is on a pb frame it will sit in loop until getframe returns zero(next i frame). Is there a way to run the decoder backwards to seek to previous iframe? Also how can I tell which frame that is in reference of time? I've noticed when the decoder starts up no matter where pts will start a 0.0.

Here is code of my seeking so far
//Re-initialize media data
m_InCmprMediaData.SetBufferPointer(m_pFileBuff, m_unFileBuffSize); m_InCmprMediaData.SetDataSize(m_unFileBuffSize);

//Seek frame to
m_pSplitter->SetTimePosition(0.0);
m_pSplitter->SetTimePosition(m_dSeekToSec);
nSize = m_pDataReader->GetPosition();
m_InCmprMediaData.MoveDataPointer(static_cast(nSize));


I have no idea what to do to make this better, this thing jumps in huge increments time. So what that means is if i click 10:59 in the video it will jump at like 11:05 or 11:10. I think its that pb frame situation that i explained up there.

Anyone from intel have insight (because we were directed to this forum even though having a ipp license)... or has anyone else have umc could give me some help.

If your going to direct me to the search bar - direct me to a the link of the forum post instead(because I already searched keywords on this about a month ago and got nothing).
0 Kudos
3 Replies
Sergey_O_Intel1
Employee
46 Views

Hi!

When you call m_pSplitter->SetTimePosition(time) the splitter moves tothe nearest I frame previous to the time you specified. This is done because decoder can start decoding from I frame only. If you want to get a frame with the timestamp exactly you specified, you should just skip frames after decoder before rendering.

-Sergey

shinjite
Beginner
46 Views

So,
In otherwords what I'm doing (using the decoder itself to decode frames - I should use the splitter instead?). Because as you can see I'm adjusting the compressed media data by the data pos in the splitter. Then to skip frames after decoder... I just keep decoding until PTS value of the frame is the time pos I asked for?
Is it possible to see a small snippet like pastebin.com to me? So I have a bigger idea(it can be psuedo to if it makes it easier).

Hi!

When you call m_pSplitter->SetTimePosition(time) the splitter moves tothe nearest I frame previous to the time you specified. This is done because decoder can start decoding from I frame only. If you want to get a frame with the timestamp exactly you specified, you should just skip frames after decoder before rendering.

-Sergey

Sergey_O_Intel1
Employee
46 Views

Really I don't quite understand what you're doing.

You should use Splitter to get an encoded frame from the stream (it has already DataReader inside), then you should pass this frame to Decoder (because it works by frames) and then you should pass decoded frame to the Renderer. For reposition you should first use Solitter methods as I said above. You may study umc samples to understan how it works.