Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

random access decoding

mikl_la
初学者
1,333 次查看

i'm in writing video-decoding-functionslike getNextFrame(), getPreviousFrame(), getFrameAtPosition(int framenumber). the question is how to get the previous frame or how to get a frame at a specific position!? how can i do this if indeed such a thing is possible. i'd thought i can do this with the setRate()-funktion of the advanced threaded demuxer, or with the setPosition()-funktion of dataReader... but it doesn't really work.

thanks and regards
michael

0 项奖励
3 回复数
mikl_la
初学者
1,333 次查看
i'm getting the timestamps of every i-frame with the GetTime()-function of MediaData-Class and write them into a vector:

while(umcRes != UMC_ERR_END_OF_STREAM){
while(UMC_ERR_NOT_ENOUGH_DATA == (umcRes = splitter->GetNextData(&mediaDataIn, track)))
vm_time_sleep(5);


if(I_PICTURE == mediaDataIn.GetFrameType()){
index[++i].time = mediaDataIn.GetTime();
}
}

after that i call the SetTimePosition()-function of Splitter-Class and the GetFrame()-function of Decoder-Class: e.g.

splitter->SetTimePosition(index.timestamp);

while(UMC_ERR_NOT_ENOUGH_DATA == (umcRes = splitter->GetNextData(&mediaDataIn, track)))
vm_time_sleep(5);

videoDecoder->GetFrame(umcRes == UMC_OK ? &mediaDataIn : NULL, &videoDataOut);


the problem is i don't get the correct frame.
is it correct to use the timestamps of MediaData-Class? or is there a problem with the SetTimePosition()-function?

thanks
michael

0 项奖励
shyaki
初学者
1,333 次查看
Quoting - mikl_la
i'm getting the timestamps of every i-frame with the GetTime()-function of MediaData-Class and write them into a vector:

while(umcRes != UMC_ERR_END_OF_STREAM){
while(UMC_ERR_NOT_ENOUGH_DATA == (umcRes = splitter->GetNextData(&mediaDataIn, track)))
vm_time_sleep(5);


if(I_PICTURE == mediaDataIn.GetFrameType()){
index[++i].time = mediaDataIn.GetTime();
}
}

after that i call the SetTimePosition()-function of Splitter-Class and the GetFrame()-function of Decoder-Class: e.g.

splitter->SetTimePosition(index.timestamp);

while(UMC_ERR_NOT_ENOUGH_DATA == (umcRes = splitter->GetNextData(&mediaDataIn, track)))
vm_time_sleep(5);

videoDecoder->GetFrame(umcRes == UMC_OK ? &mediaDataIn : NULL, &videoDataOut);


the problem is i don't get the correct frame.
is it correct to use the timestamps of MediaData-Class? or is there a problem with the SetTimePosition()-function?

thanks
michael


If your stream contains only IDR frames, it is doable to random access individual positions, otherwise, due to the IBP reference, you need to send data to the decoder from the nearest IDR frame until the position you want to decode.
0 项奖励
mikl_la
初学者
1,333 次查看
Quoting - shyaki

If your stream contains only IDR frames, it is doable to random access individual positions, otherwise, due to the IBP reference, you need to send data to the decoder from the nearest IDR frame until the position you want to decode.

i'm doing it like that...
but the problem is, that i don't get the correct i-frame. i am getting the one before the frame i want. seems, that setTimePosition() from splitter don't work right!? or maybe the timestamps are wrong!?
0 项奖励
回复