Having a stream of NAL units of types [5 [1]+]+, how to correctly reference them in samples field of trun box of frgmented mp4 so they would decode and present correctly, without stuttering?
The main issue here is that not every time single NAL unit maps to single I/P/B frame, ofen multiple NAL units are representing same frame, so it is not clear if each MP4 sample should be referencing each NAL unit or a group of NAL units related to the same I/P/B frame.
In case i should reference each NAL unit in separate MP4 sample, what about DTS/PTS/CTS? How should they be different if it is all the same frame?
In case i should reference group of NAL units related to the same frame in one MP4 sample, is same frame_num for consecutive NAL units of same NAL type defines them as related to the same frame?