10/5/12

Why should we so appreciate All-I video in cameras?

WE SHOULDN'T.

(This article will discuss top level topic because digging to details will be pointless.)

Many manufacturers come with new encoder feature for their camera line. They call it All-I, iFrame & etc.
To explain it, I’ll start with the available encoder frame types:

I (Intra) = Intra frame that draws the image from scratch and compress it. Equivalent to JPEG image.
P (Predictive) = Inter frame that subtracts itself from previous “I” frame and the compression is applied on the residual. “Forward prediction”
B (Bi-directional) = Inter frame that can subtract itself both from previous “I” or “P” frames (forward prediction) and from the following “I” or “P” frames (backward prediction). The compression is applied on the residual.
("B" and "P" frames can also change their behavior in macro-block level to "skip" and "intra", if the encoder decides that it will save more bits)

There are 3 main arrangements for GOPs (group of pictures - the distance between 2 “I” frames): I-only, IP, IBP.



I-Only (All-I)
In this case every frame is unique and encoded separately without any temporal prediction. Actually it is like Motion JPEG (MJPEG). The most primitive encoder.


IP

Between 2 "I" frames will be a variable number of "P" frames. In cameras the distance between the "I"s is usually 15 frames (for 30 fps footage). Smart software encoders usually rely on scene changes to push "I" frames.

IBP

Between "I" and "P" frames or 2 "P" frames will appear a constant number of "B" frames. Cameras usually use 2 "B" frames. Software encoders will usually push from 1 to 5 "B" frames. The increase in "B" frames increases the complexity of both the encoder and the decoder exponentially.



After understanding the above, I won't be explaining why IP and IBP has extreme superiority over I-only - I will show you an example.

The video below was captured absolutely uncompressed. I've compressed it using X264 with "Camera like settings" (with most of the limitations that hardware has). Video's motion: continuous horizontal pan. The frame I've decided to grab is frame no.94 because it is a "B" type frame in IbbP GOP, i.e. the most compressed + the bit rate control got steady.

(CLICK TO ENLARGE)


Original images (Click to download):
Full Side-by-Side videos (Click to download):


So why are the manufacturers so proud of 20 years regression in compression technology?
  1. Good for editing purposes - well this is true. I-only is very light for today's workstations and enables you a real time playback of multi layered 1080p60 content. This is exactly why DNxHD and ProRes exist! Does it worth 4 times bigger files for the same quality? Personally, my workflow is to encode all the files to DNxHD 36mbps (terrible quality), edit them and then, when exporting, link all the timeline to the native files.
  2. They claim that IP and IBP may cause temporal artifacts (such as ghosting and trails). It is because they have crappy H.264 encoders (H.264 isn't a constant encoder - it very depends on how it is calibrated and which tools are in use) and instead of improving their H.264 encoder - they choose the cheap and easy way.
For more experienced users I would suggest to encode master videos using X264 in IP, ~90Mbps with less deblocking, High profile with 4:2:2 (Instead of DNxHD/ProRes). The result is almost lossless! 



In summary,
Don't be afraid of H.264 IP/IBP and don't surrender to I-only. We should demand improvement in cameras' encoder. 

Mark.