GOP

Group of Pictures (GOP) — a structured group of successive frames in an MPEG-encoded video stream. Frames are grouped for the interframe compression purposes.

To deliver video over the internet using a limited bandwidth, it is often necessary to compress the video. Besides compressing frames themselves, there is a more progressive technology called interframe compression. It works by sending full frames (referred to as keyframes), and then only sending the difference between the keyframe and the subsequent frames. The receiver (decoder) uses the keyframe plus these differences to re-create the desired frame with reasonable accuracy.

For interframe compression purposes, frames in a track are grouped into GOPs. GOP (group of pictures) is a structured group of successive frames in a video stream or file.

Each GOP consists of an I-frame (keyframe) followed by P-frames and B-frames:

I-frame (keyframe) is the first frame in a GOP. It is a full image encoded independently from other frames (meaning no links to them). Each GOP has a keyframe at the start. P-frames contain the difference between the previous P-frame and a current frame. It is encoded with a link to an I-frame. B-frames contain links to I-frames and P-frames before and after themselves. It helps to rewind quicker, for example.

A typical GOP contains a repeating pattern of B- and P-frames following the keyframe. An example of a typical pattern might be the following:

I B B P B B P B B P B B

GOP

GOP size (the number of frames between two neighbor keyframes) – the number of frames in one GOP. This number can be variable or constant for a stream. When Flussonic transcodes a stream, it creates GOPs of a constant size, so all GOPs have the same size. Most programs for processing video are configured to work with GOPs of equal size. Therefore, in most situations equal GOPs are used, for example, the TV standard is 28 frames in a GOP.

It is important to understand that a GOP without a keyframe has no sense. Thus, it is impossible to play video just in the middle of the GOP.

Grouping into GOPs is applicable to video frames only. Corresponding audio and text subtitle frames are added to GOPs synchronously.

What would be the optimal GOP length?

Why a GOP should not be too long? Because a longer GOP can result in a bigger zap time – duration of time from which the viewer changes the channel using a remote control to the point that the picture of the new channel is displayed. If a viewer clicks the remote control before the previous GOP has finished, they see unactual picture. This problem may be critical for video games or video calls.

To solve this problem, Flussonic uses the prepush feature: it saves each GOP in the buffer before sending it to a client. When a client connects to the server, the server sends the first GOP from the buffer and then transmits a stream with a timeshift — the delivery lags for a time interval equal to the size of one GOP converted to seconds. When the connection with the server breaks or slows down, the client plays a GOP from the buffer. In this way, video is played more evenly, however, a latency may grow.

Why a GOP should not be too short?

Because longer GOPs provide better compression.

Different applications use different GOP lengths, but typically these lengths are in the 0.5 – 2 second range.

Open GOP

In some cases, it is possible to compress video even better by using so called open GOPs. Open GOP contains P-frames that refer to the frames before the keyframe. This allows to lower bitrate by 5-7 %. However, open GOP may result in problems when it comes to using segments.

Flussonic Media Server trial

By sending you request you agree to our terms and conditions

Our experts will contact you shortly, offer tech advice and consultation, and send you a trial license..

Fill out the form to receive a free Flussonic Media Server trial key.

If you do not receive an email from us within one hour, please check your spam folder and add Flussonic to your trusted contacts list.

Email: support@flussonic.com Phone: +1 (778) 716-2080 (United States)