In my situation, iOS HW encoder sometimes generates one nalu and other times generates two nalus which make up the access-unit/picture. When two nalus were generated for one picture, I combine them two by replacing the first nalu's start code with the size of the total size of these two nalus and removing the start code the second nalu and appending it to the end of first nalu. Just like this, 0x00000002aaaa and 0x00000002bbbb become 0x00000004aaaabbbb. But the video shows blurred on the screen. So does someone can teach me how to combine nalus correctly? Great thanks.
Two nalus for one frame like this(almost same as data from this link( https://forums.developer.apple.com/thread/14212?sr=stream), so I just copy it):
Here I want combine #1 and #2.