Decoding H264 using random access

729 views Asked by At

I want to access random frames in a H264 file and map the decoded images to a Direct3D texture. I am using the the NVIDIA VIDEO CODEC SDK. I've already found the NvDecodeD3D11 sample that was included in version 8.0 and have stripped it down to the bear essentials.

Basically I want to achieve the same idea as proposed in: decoding H264 from middle of the file.

My file can be IDR frames only, but can also include P-frames.

Easy access to the sample: Github

I understand the idea in the linked question, but I don't know where and how to implement this.

1

There are 1 answers

0
VladP On

Great question, and I am afraid it requires a lot of work. You have to get familiar with the I and P frame format exactly. Next, you will figure out how to search for the header of frames, and form a buffer with pointers to the I frame header starts. After that, you will have to devise the system that will be used as a regular play by doing play while going from pointer that marks the current frame, or will be able to go fast forward or backwards, by rewinding the buffer pointer indices. Study this, and you will be able to find the solution. It is highly likely that there is already open source code for this, but that requires more search. You may try to put a bounty on this.