Community
cancel
Showing results for 
Search instead for 
Did you mean: 
bmkeller
Beginner
56 Views

Time seeking in H.264

What is the proper way to seek to a frame at a particular time within an MP4 file? The media playback sample provided with the libraries simply plays from beginning to end.

I have attempted to use Splitter.SetTimePosition(newTime), but always get NOT_ENOUGH_DATA errors afterwards.

0 Kudos
2 Replies
Chao_Y_Intel
Employee
56 Views

Hi,

Possibly you can post a test code and stream for investigation?

One thing that need to pay attention is that users need stop() and run() the splitter(), when use the SetTimePosition

..

SetTimePosition()

splitter->SetTimePosition(...);

splitter->Run();

Thanks,

Chao

bmkeller
Beginner
56 Views

That was the problem. I wasn't stopping prior to shifting time. Running as you indicated works fine.

Is there any way to seek to one particularly frame? The library seems structured to support the use case where a user will start at the beginning then gradually and sequentially move to the end of an MP4. This works perfectly for the case of a video playback. However, for my application, I will tend to move through the file rapidly and not necessarily in sequential order. I can make repeated calls as you indicate above, but it is inefficient for the library to compute 'n' seconds of buffer when I really only care about a single frame.

Reply