ADOBE PREMIERE PRO: Tutorials Forum Articles Creative Cloud Debate

"Set Key Frame Distance" Option/GOP question.

COW Forums : Adobe Premiere Pro

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Oscar Gotti"Set Key Frame Distance" Option/GOP question.
by on Nov 18, 2015 at 10:32:06 am
Last Edited By Oscar Gotti on Nov 18, 2015 at 3:59:45 pm

Hello,

On the Youtube compression page it recommends the following:

"2 consecutive B frames
Closed GOP. GOP of half the frame rate"

https://support.google.com/youtube/answer/1722171?hl=en

My question is, there are no such settings in the H.264 (mp4) option. Are they talking about the 'Set Key Frame Distance' option? What Key Frame distance should I be setting to adhere to their recommendations?

One more question, What Keyframe distance will give my videos the best possible quality? (for my masters)

Thanks,
Oscar


Return to posts index

Rich KaelinRe: "Set Key Frame Distance" Option/GOP question.
by on Nov 18, 2015 at 3:51:58 pm

yes, I believe they are talking about the key frame distance option. I am not familiar with h.254... Do you mean h.264 or h.265? Also, and this is not snark, do you have a basic understanding of how GOP codecs work (vs I-frame)? What your key frames (I-frames) do?

Rich Kaelin
Kaelin Motion Production Services
http://kaelinmotion.com
New York


Return to posts index

Oscar GottiRe: "Set Key Frame Distance" Option/GOP question.
by on Nov 18, 2015 at 4:05:53 pm

Right, so what Youtube recommends is that I set my 'Key Frame Distance' to 12/13 if my frame rate is at 25fps? Does this mean it is a 'closed GOP'?

I did mean H264 my mistake.

I have read up on GOP but it is very confusing to me, I know of I-Frames, P-Frames and B-Frames but I haven't come across a website that explains it clearly enough.

Thanks


Return to posts index


Rich KaelinRe: "Set Key Frame Distance" Option/GOP question.
by on Nov 18, 2015 at 5:43:28 pm

Basically (very basically) I-frames are your key frames. Think of them as "Independent" frames (I believe it actually stands for Intra-coded frames), they are self-referential, meaning they contain all of the info they need to display properly . GOP - Group Of Pictures - use these I-frames as a base or foundation for predicting the data in all of the other frames in a Group (of pictures). Some codecs, like ProRes, are all I-frames...every frame has all the data it needs, even though it is compressed data. You can sometimes see the I-frames of a GOP as a "pulsing" when you apply filters to a clip and try to play back without rendering.

There are generally 2 other types of frames in GOP codecs. P-frames, Predicted frames, that rely on the I-frames to calculate the data they display. And there are B-frames, Bi-directional predicted frames, that look to the frame(s) before and after them to calculate the data they will display. This makes B-frames very efficient. Also note that B-frames are not part of the h.264 standard profile. as they increase efficiency and picture quality, make sure profile is set to High.

The system as a whole makes the GOP codecs very efficient at displaying moving images with minimal data. In fact, if you have data constraints, one way to overcome them is to spread out your I-frames and deal with the loss of clarity, which will vary in degrees by how much your footage changes. I had a client that wanted a 1 hour presentation at 720-30p to be under 200MB. I set key frames to 1 every 10 seconds (300 frames) and limited the size of the file to 199MB. The result was not beautiful, but acceptable.

Also be aware that every "clip" using a GOP codec starts with an I-frame, as it needs a place to begin predictions from. Make sure you use the codec's auto detect feature to place an I-frame at he beginning of every scene change to improve quality. This means that if there is a sudden cut, the compressor will add an I-frame at the cut point. Otherwise video immediately following a cut may appear in very poor quality.

I hope this helps a little.

Rich Kaelin
Kaelin Motion Production Services
http://kaelinmotion.com
New York


Return to posts index

Oscar GottiRe: "Set Key Frame Distance" Option/GOP question.
by on Nov 18, 2015 at 5:50:14 pm

Thanks Rich,

"Make sure you use the codec's auto detect feature to place an I-frame at he beginning of every scene change to improve quality."

How do you do this on Premiere?

Also, What is a closed GOP? And what Key Frame distance would I need to achieve this?

So for best quality, I should set my Keyframe distance to every frame?


Return to posts index

Rich KaelinRe: "Set Key Frame Distance" Option/GOP question.
by on Nov 19, 2015 at 2:00:52 am

I don't have AME open in front of me...that is the interface premiere opens, I believe.

I THINK closed GOP just ends with an I-frame, which I suppose would help the B-frames. I don't know if you can choose to do this in Adobe Media Encoder or not. If not, it probably automatically does it for all cases. I don't think it is a big deal, especially if you have a key frames set to half your FPS rate. I would NOT WORRY about this for YouTube quality. If you are worried, put black at least the space of your key frames at the end of your video. So if you have key fram every 15, put at least 15 frames of black in tail of video. This way only black frames are in affected area.

As for the auto detect of scene changes, AME does have a lot of settings available, so look carefully, it may just be worded differently. I would bet that if it is not available as a flag (switch) then it is on by default. All my other encoders have this flag set to on by default for all presets.

If you set key frames to every frame you are making it an I-frame codec, better quality in theory, but huge file size...sort of defeats the purpose of compression. Also, if your target and Max data rates are constrained, and I think AME makes you choose a constraint, you will likely end up with video that looks worse. I would not do this. Honestly, I would choose a preset that fits your needs, like HDTV720p30 and go with it. For slightly better quality change it to 2-pass. Make sure it is high profile (I think it is). The defaults in AME have pretty high bitrates, so quality is usually not an issue. The Squeeze defaults make much smaller files that look just as good.

Also it will process on YouTube faster if you have fast start or streaming enabled. Again, something I would not worry too much about if you cannot find it. Best bet is to choose the default that best fits your needs, if needed set render quality to best, and change form 1-Pass to 2-pass are the only adjustments I would try if you are not sure what to do...and you are not up for a lot of test renders to compare quality. I would not qualify myself as a compression expert, but I do an awful lot of it. Unless you have a demanding situation, like when my client wanted a one hour file in HD to be under 200MB, the defaults of most programs work very well, especially as a place to start from.

Rich Kaelin
Kaelin Motion Production Services
http://kaelinmotion.com
New York


Return to posts index


Rich KaelinRe: "Set Key Frame Distance" Option/GOP question.
by on Nov 19, 2015 at 4:19:34 am

I don't have AME open in front of me...that is the interface premiere opens, I believe.

I THINK closed GOP just ends with an I-frame, which I suppose would help the B-frames. I don't know if you can choose to do this in Adobe Media Encoder or not. If not, it probably automatically does it for all cases. I don't think it is a big deal, especially if you have a key frames set to half your FPS rate. I would NOT WORRY about this for YouTube quality. If you are worried, put black at least the space of your key frames at the end of your video. So if you have key fram every 15, put at least 15 frames of black in tail of video. This way only black frames are in affected area.

As for the auto detect of scene changes, AME does have a lot of settings available, so look carefully, it may just be worded differently. I would bet that if it is not available as a flag (switch) then it is on by default. All my other encoders have this flag set to on by default for all presets.

If you set key frames to every frame you are making it an I-frame codec, better quality in theory, but huge file size...sort of defeats the purpose of compression. Also, if your target and Max data rates are constrained, and I think AME makes you choose a constraint, you will likely end up with video that looks worse. I would not do this. Honestly, I would choose a preset that fits your needs, like HDTV720p30 and go with it. For slightly better quality change it to 2-pass. Make sure it is high profile (I think it is). The defaults in AME have pretty high bitrates, so quality is usually not an issue. The Squeeze defaults make much smaller files that look just as good.

Also it will process on YouTube faster if you have fast start or streaming enabled. Again, something I would not worry too much about if you cannot find it. Best bet is to choose the default that best fits your needs, if needed set render quality to best, and change form 1-Pass to 2-pass are the only adjustments I would try if you are not sure what to do...and you are not up for a lot of test renders to compare quality.

PS- I just set 5 videos to export for YouTube in squeeze. It's keframe default YouTube setting is keyframe every 300 frames...very long GOP...but the results are very good and look great uploaded...files are small so they upload fast. It also has the new scene detect on by default. Like I said, I would not worry too much for YouTube. Of your file looks good, upload it and check it online. Remember, YouTube will often deliver a lower quality file anyway when it detects a slower connection...like a cell phone.

Also, does your clip have a lot of motion? Higher motion will look better with more keyframes. If it is an interview with no fast motion, fewer keyframes will look fine. My videos had hardly any motion, so I left the large keyframe setting with scene change detect, but I upped quality from 8 (50%) to 12 (75%) because I an setting it to render overnight, so I don't care about time...but I also don't need highest quality. These are just time code burns so a client can make notes.

Rich Kaelin
Kaelin Motion Production Services
http://kaelinmotion.com
New York


Return to posts index

Oscar GottiRe: "Set Key Frame Distance" Option/GOP question.
by on Nov 19, 2015 at 11:00:37 am

Thanks for all this info.

This is curious, as I did a test, exporting an H264 .mov at 40,000 with:

Export 1 - 1 Keyframe distance
Export 2 - 12 Keyframe distance
Export 3 - 75 Keyframe distance
Export 4 - Option Unchecked

I found that Export 2 was the biggest and best quality, which seems to corroborate what you are saying. The only anomaly was that Export 1 was no the best quality, and it was not the biggest file as you suggested. Would you know why this is? Maybe the lack of B and P frames is a problem for this particular codec? Or like you said maybe it's because of the data rate constraints.

Either way, as a rule of thumb I think I will use the keyframe distance of half the frame rate from now on.

Thanks


Return to posts index

Rich KaelinRe: "Set Key Frame Distance" Option/GOP question.
by on Nov 19, 2015 at 12:39:05 pm

Export one should not have been the best quality, but really should have been the biggest file. If you look, there is probably a target, minimum and maximum bitrate. Constraining to this may have made the file come out smaller, even if set the same in export 2. If you turn these way up it would likely I prove quality. Again, a nominal difference from 2.

Rich Kaelin
Kaelin Motion Production Services
http://kaelinmotion.com
New York


Return to posts index


Oscar GottiRe: "Set Key Frame Distance" Option/GOP question.
by on Dec 10, 2015 at 11:57:39 pm
Last Edited By Oscar Gotti on Dec 10, 2015 at 11:58:12 pm

Thanks for this, great help.

So what key frame distance do you usually use just out of interest?

Thanks,
Oscar


Return to posts index

Ivan MylesRe: "Set Key Frame Distance" Option/GOP question.
by on Dec 11, 2015 at 1:02:10 am

The quality of Export 1 was constrained by bitrate without the advantages of P- and B-frame compression. This is similar to creating a sequence of mid-quality jpg images. If bitrate is effectively unconstrained the quality will be slightly better than with a key frame distance of 12 frames, but file size will be larger.

Through characterization tests with the MacroMedia and Apple H.264 codecs I concluded that maximum quality is approximately equivalent for keyframe distances of 1-7 frames, and only slightly degraded at 10-12 frames. However, bitrate is significantly higher with all-intraframe encoding (KF=1), and drops noticeably as key frame distance increases to 12 frames. Beyond GOP lengths of 25 frames the reduction in file size is relatively small. At extremely long GOP lengths bitrate might actually increase slightly.



For high quality encoding and/or high motion footage I set key frame distance to 10-15 frames. Longer distances up to about 60-75 frames are fine for mid-quality or low motion footage (e.g. talking heads, simple animation, presentation slides).


Return to posts index

Oscar GottiRe: "Set Key Frame Distance" Option/GOP question.
by on Jan 31, 2016 at 12:29:32 am

Thanks for the info Ivan,

I have just exported a video in the following specs given to me by the client:

1280 x 720 @ 60fps. As for codec: H264, high profile, 5.1, CABAC, key frame 2 at 6mbs with AAC audio at 128k

However, the exported video looks noticeably pixelated at times... Maybe this is how the client wants it..but I would like to know which of the above is the culprit for this poor quality, Is it the Key Frame distance of '2'?


Return to posts index


Oscar GottiRe: "Set Key Frame Distance" Option/GOP question.
by on Jan 31, 2016 at 1:03:07 am

maybe not pixelated...noisy is probably more accurate


Return to posts index

Tero AhlforsRe: "Set Key Frame Distance" Option/GOP question.
by on Jan 31, 2016 at 8:46:26 am

You'd need more bitrate for 60fps video.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2016 CreativeCOW.net All Rights Reserved
[TOP]