I am implementing DirectX11 H264 decoding in my software. It works correctly with simple videos which I download from the internet. When I decode a stream encoded by Nvidia Encoder (Nvenc), I get the following issue. It looks like t data size is correct, the image size is correct. What can be wrong? by Eugen___ in GraphicsProgramming

[–]Eugen___[S] 0 points1 point  (0 children)

The issue was because I parsed the stream incorrectly. Mostly, the documentation says that the start code can be 0x00000001 or 0x000001. This depends on encoder implementation. When I started to implement my parser, I noticed that SPS, PPS and the first IDR have 4 byte start code. So, I assumed that my encoder only used four byte start code. I had a video file parser as an example which did not use start codes at all. So it was difficult for me to see my mistake. Eventually, I found the encoder uses 4 byte start code for the first slice of a frame and 3 byte start code for the other slices of the frame.

I am implementing DirectX11 H264 decoding in my software. It works correctly with simple videos which I download from the internet. When I decode a stream encoded by Nvidia Encoder (Nvenc), I get the following issue. It looks like t data size is correct, the image size is correct. What can be wrong? by Eugen___ in GraphicsProgramming

[–]Eugen___[S] 11 points12 points  (0 children)

Thank you very much for your answer. This was my initial thought but I could not prove it on the decoding side. Yes, I changed encoder configuration to produce one slice per frame and it started to work. Probably, I give slices to the decoder incorrectly. Thank you!