问题
The input raw bitstream has type 9 NALs (AU delimiter).
There are multiple NALs of type 5 or 1 between NAL type 9. for ex: {NAL-9, NAL-5, NAL-5, NAL-9, NAL-1, NAL-1, NAL-9, NAL-1, NAL-1 ....}. I believe the encoder used slice mode (raw stream is from windows h.264 encoder which has slice mode enabled via low latency flag).
How do i feed such stream to iOS?
My guess: put all NALs between two NAL-9 into one buffer, removed NAL-9, and send those buffers to HW decoder.
In my example, buffers going to decoder will look like : {NAL-5, NAL-5}, {NAL-1, NAL-1}, {NAL-1, NAL-1}. The output result shows that decode happens but with lot of green artifacts which makes me think that there is something missing in the above approach.
来源:https://stackoverflow.com/questions/50886905/how-to-decode-h-264-slice-mode-stream-with-type-9-nals-on-ios