Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe Premiere Pro Key Frame Distance=2 frames yields file size 32% of All-Intra?

  • Key Frame Distance=2 frames yields file size 32% of All-Intra?

    Posted by Ivan Myles on May 4, 2013 at 5:31 am

    I am encoding a test file with different export settings to better understand the CS6 H.264 compressor. Varying only key frame distance and holding all other parameters constant produces a strange result. Video data rate decreases by 68% when key frame distance is changed from every frame (all-intra) to every other frame. How is this possible when half the file is still I-frames?

    Here is the data presented as key frame distance versus video data rate in bits per picture element:

    1f : 2.29 (100%)
    2f : 0.74 (32%)
    3f : 0.67 (29%)
    4f : 0.64 (28%)
    5f : 0.62 (27%)
    6f : 0.60 (26%)
    7f : 0.60 (26%)
    8f : 0.59 (26%)
    12f : 0.57 (25%)
    24f : 0.56 (24%)
    48f : 0.55 (24%)

    For reference, the test file is a 17 second 720p-24fps file encoded using H.264 High Profile, Level 5.1, VBR 2-Pass, and target bit rate maximized. The video data rate is 50.6 Mbps when Key Frame Distance=1, and 16.3 Mbps when Key Frame Distance=2. Each file was generated twice to confirm results.

    Ivan Myles replied 13 years ago 2 Members · 7 Replies
  • 7 Replies
  • Angelo Lorenzo

    May 4, 2013 at 7:37 am

    Well the key is VBR. If your file is low-motion then B and P frames are awarded less bitrate. If you try the test on a more kinetic piece of video, you’ll find varying results.

    B and P frames can contain varying degrees of information, it’s entropy encoded; it encodes what portions of the image has changed. All-I is a full discrete image every frame.

    ——————–
    Angelo Lorenzo

    Need to encode ProRes on your Windows PC?
    Introducing ProRes Helper, an awesome little app that makes it possible
    Fallen Empire Digital Production Services – Los Angeles
    RED transcoding, on-set DIT, and RED Epic rental services
    Fallen Empire – The Blog
    A blog dedicated to filmmaking, the RED workflow, and DIT tips and tricks
    Can your post production question fit in a tweet? Follow me on Twitter

  • Ivan Myles

    May 4, 2013 at 8:46 am

    [Angelo Lorenzo] “All-I is a full discrete image every frame.”

    That is why I don’t understand how reducing the number of I-frames by 50% reduces the file size by 68%. Consider one second of 24fps video:

    24I = 50Mb
    12I + 12B = 16Mb

    Even if the B-frames don’t require any space, wouldn’t the remaining 12 I-Frames require 25Mb on average? Bit rate was not a constraint (300Mbps target) so why would the I-frames be compressed like this?

  • Angelo Lorenzo

    May 4, 2013 at 7:45 pm

    The minutiae of h.264 is beyond me, but I wouldn’t be surprised if it’s attributed to some overall quality tuning changes once partial frames are turned on. Sadly, when you don’t have total control over all settings, most MPEG codecs apply all kinds of automatic tuning very liberally.

    You may be better off posting this question on another forum, or in the compression techniques forum on here on CC.

    ——————–
    Angelo Lorenzo

    Need to encode ProRes on your Windows PC?
    Introducing ProRes Helper, an awesome little app that makes it possible
    Fallen Empire Digital Production Services – Los Angeles
    RED transcoding, on-set DIT, and RED Epic rental services
    Fallen Empire – The Blog
    A blog dedicated to filmmaking, the RED workflow, and DIT tips and tricks
    Can your post production question fit in a tweet? Follow me on Twitter

  • Ivan Myles

    May 4, 2013 at 8:25 pm

    Thanks for the reply, Angelo. It appears the AME H.264 encoder requires significantly more bitrate for All-Intra. QuickTime only uses about 20 Mbps to encode the test file compared to 50 Mbps for AME H.264. Data rates at other key frame distances seem to align reasonably well.

  • Angelo Lorenzo

    May 4, 2013 at 8:32 pm

    AME uses MainConcepts’ h.264 encoder, as a point of reference, when selecting mp4 as the wrapper. It uses Quicktime when MOV is the wrapper. Just a bit of FYI so you know it’s not anything Adobe proprietary.

    What site did you find the chart on?

    ——————–
    Angelo Lorenzo

    Need to encode ProRes on your Windows PC?
    Introducing ProRes Helper, an awesome little app that makes it possible
    Fallen Empire Digital Production Services – Los Angeles
    RED transcoding, on-set DIT, and RED Epic rental services
    Fallen Empire – The Blog
    A blog dedicated to filmmaking, the RED workflow, and DIT tips and tricks
    Can your post production question fit in a tweet? Follow me on Twitter

  • Ivan Myles

    May 4, 2013 at 8:50 pm

    Yeah, Expression Encoder uses MainConcept, too. It sets keyframe distance down to 0.1 seconds, so All-Intra files can’t be created above 15fps.

    I generated the chart based on tests that have been running over night. Another batch of files is currently processing at different H.264 profiles and levels, but results so far are consistent with the chart.

  • Ivan Myles

    May 7, 2013 at 8:25 pm

    [Angelo Lorenzo] “I wouldn’t be surprised if it’s attributed to some overall quality tuning changes once partial frames are turned on.”

    I think you are right. After running the tests two more times it appears the codec is designed to render I-frames in greater detail when N=1. The following image shows sections of two consecutive frames magnified 400%. Accuracy decreases and blocking increases, even in the I-frames, when N>1.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy