Search code examples
video-streamingh.264video-processingmpeg-4

H.264 Temporal Reference


Is there a way to imitate the temporal reference for h.264 NAL packets. RFC3984 says:

One of the main properties of H.264 is the complete decoupling of the transmission time, the decoding time, and the sampling or presentation time of slices and pictures. The decoding process specified in H.264 is unaware of time, and the H.264 syntax does not carry information such as the number of skipped frames (as is common in the form of the Temporal Reference in earlier video compression standards). Also, there are NAL units that affect many pictures and that are, therefore, inherently timeless. For this reason, the handling of the RTP timestamp requires some special considerations for NAL units for which the sampling or presentation time is not defined or, at transmission time, unknown.

But I'm wondering if there is a way to compute the temporal reference for each packet, as for H.222


Solution

  • The only information the H.264 bitstream (NAL units) contains is the display order of each picture. If you knew the encoding framerate you could sorta guess the frame time by using the picture order count (POC) in the slice header, but the real presentation time is left up to the higher level transport mechanism, whether it is the file or streaming format, e.g. RTP timestamps.