1

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?

1

A "Frame" called a "Access Unit" (or AU) in h.264 contains 1 more more NALU. The trun encodes each AUs size, this includes all NALUs for that AU. NALUs do not have timestamps, AUs do.

2
  • It is not of question whether to put multiple NAL units into trun box or single one, my question is of trun samples field: should single sample contain single NAL or complete frame. – Alexander Tumin Apr 23 '18 at 6:40
  • One sample is one frame, which is one or more nalu. – szatmary Apr 23 '18 at 6:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.