I'm a bit lost concerning random access in an elementary H264 stream. As of now I have written a demuxer for mts container files that feeds the H264 video stream to the Intel Media SDK decoder. That works as expected and I can extract and render all of the stream's frames.
However, now I want to leave this linear path of plain playback and go for random access. But after reading through the specs and various websites and threads dealing with H264 I'm more confused than enlighted about the correct way to do random access.
First I got the impression that IDR slices of NAL unit type 5 provide random access points, thus it would be save to start feeding the decoder from such an IDR slice (given that the decoder is correctly initialized with PPS/SPS).
But the H264 sample stream I'm working with does only contain all of its frames behind a single IDR slice. Its quite a short sample stream with just about 25 seconds. But I cannot believe that within 25 seconds there are no other keyframes I could jump to without decoding the whole sequence.
So some other sources say that each I-frame in any non IDR slice (nalu type 1) can be used as a keyframe to start decoding from there.
Yet again other sources say that they do only look at the first_mb field in the slice header. I this says 0 for the first mb then this slice can be used as keyframe to start decoding.
Finally other sources say that they use each SEI recovery point in the elementary stream as random access points.
Of course I could go ahead and start trying what actually works. But I'm sure there is an official answer as to where it is perfectly legal to start decoding inside the stream for random access.
I know this is not really Media SDK related but hopefully someone can provide me an answer :)
Thanks in advance.