Video Compression

VideoNerd

Usually for progressive streams POC difference between successive frames in presentation order is 2 (x264 and JM encoder keep the POC difference equal to 2). For illustration, let’s consider GOP structure of  IPPP… , where the POC of the first frame is 0 (if the first frame is IDR then POC must be 0, otherwise POC of the first frame is not necessarily 0), the second frame’s POC is 2, the third frame – 4 and so forth. POC of each frame (except the very first one) equals to the POC of previous frame (in the presentation order) plus 2.  Let’s coin this POC difference  as POC Difference Delta.

However, some encoders (e.g. Craft) generate streams with POC Difference Delta equal to 1 (it’s still legal according to H.264/AVC). Moreover, some encoders (provided that the implicit weighted prediction is on) even do not keep POC Difference Deltas to be constant along the stream.  For instance, let’s consider the following stream –  IBPBPBP (in the presentation order). So, POC of the first frame is 0, the second frame’s POC is 2 and the third frame’s POC is 10.  The POC distance is deliberately not constant in order to flavor I-frame in weighted inter prediction.

Let’s suppose you own a H264 elementary stream with two types of  GOPs:  the first GOP type has POC Difference Delta =1 and the second GOP type has POC Difference Delta = 2 respectively. It’s expected  PowerDVD to play this stream non-smoothly: GOPs of the first type are played ok but the second type GOPs are played slowly. Why?

My guess:

PowerDVD derives PTS from POCs (there is no other way to determine PTS from a H264 elementary stream unless Timing Picture SEIs with explicit PTS info transmitted). Hence, the frame duration is interpreted as equal to POC difference = 1.  Hence, if a GOP with POC Difference Delta = 2 is followed by the GOP with POC Difference Delta =1 then PowerDVD  would interpret POC difference =2  as double frame duration. Therefore  PowerDVD would play the second GOP slowly.

Moreover, it was found that if one encapsulates a stream with different POC Difference Deltas into BluRay format (e.g. with tsMuxer) BluRay players play this video in jittered manner too.

Leave a Reply

Your email address will not be published. Required fields are marked *