Answers.Body: <p>This is an answer I found on the adobe forums after googling it:</p>
  
  <p>The keyframe distance is the maximum number of frames before the encoder inserts an i-frame, which is the highest-quality frame of an MPEG stream (ie, it has all the information for a single frame of video inside of it rather than relying on the frames around it to reconstruct). In between the i-frames are b-frames and p-frames, which are "difference" frames that reconstruct that frame of video by looking at the nearest i-frame and applying all the "difference" frames from that point forward (or backwards). The collection of an i-frame and all its connected p-frame and b-frames is called a GOP, or "Group of Pictures". So in essence the "keyframe distance" value determines the length of each GOP.</p>
  
  <p>Note that Premiere automatically inserts a new i-frame for scene changes, irrespective of the keyframe distance value. This is to assure video quality at the start of a new scene since there wont be enough in common from previous b-frame and p-frames.</p>
  
  <p>Generally speaking, the more i-frames you have, the higher the image quality of video, but also the larger the size of the video. So the value you choose for keyframe distance is a balance between the file size you want the video to fit in vs quality. If you're not concerned with file size or the file size generated is within reason then you can just leave it to its default value. Otherwise you can tweak it as part of the process to get the file size down to where you want it to be (in combination with the other encoder parameters such as bitrate).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-08T11:48:13.500Z
Answers.Text: It's not only quality / filesize that are affected, one other result of changing the GOP length is that shorter GOPs make it easier to seek to a specific frame, as well as shuttle forward and backward. This is the reason that most editing codecs are all-i-frame (if you're interested there's a recent post by someone asking about using all-I-Frame h.264 instead of say ProRes here: https://video.stackexchange.com/questions/29414/intra-frame-h-264-h-265-compared-to-dnxhr-or-prores-as-intermediate-codecs-for). Of course that does dramatically increase the size.
Answers.UserDisplayName: stib
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-08T12:02:59.527Z
Answers.Text: So Is it good to make the value 1 for a composition based on an audio spectrum? , @stib
Answers.UserDisplayName: Mohammed Mehdi TBER
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-08T13:51:50.830Z
Answers.Text: Depends on what you're doing with it. All-i-frame compression will be *significantly* larger.
Answers.UserDisplayName: stib
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-07T08:35:02.330Z
Answers.LastActivityDate: 2020-02-07T08:35:02.330Z
Answers.UserDisplayName: Florian Claaßen
Answers.Body: <p>This is the equivalent to Sony Vegas macroblocks.
  If you set it to 1, every frame will be built entirely, but if set to the the default 4 every frame will be divided by four.
  This is designed for the compression ratio - if you're using it -
  Depending on the profile, if using High for example, uses the h264 maximum compression rate that is 8.
  In other words, a video of 640x360 at 60 fps is 13824000 bits per second: in baseline profile must be constant br at 1 macroblock.
  This is the fastest rendering for any video editing program, because these are uncompressed values.
  If you wish to add compression in render, use High profile, and divide the bit rate by 8.
  If using variable bit rate, set the half of it to average and the divided by 8 total in the maximum bit rate and use 8 macroblocks.
  If using  premiere, set the entire 1728 br and key frame distance to 8 too.
  But in every case, when using in render compression, picture quality is not guaranteed.
  If in doubt, always use uncompressed values.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-26T07:21:56.850Z
Answers.Text: Macroblocks are spatial divisions within a frame and have *nothing* to do with KF distance. For codecs upto H.264, they are fixed at 16x16 pixels. Parallel encoding breaks the frame into *slices*, not macroblocks,
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-26T04:09:37.977Z
Answers.LastActivityDate: 2021-09-26T14:14:57.107Z
Answers.LastEditDate: 2021-09-26T14:14:57.107Z
Answers.UserDisplayName: Derick Silva
Body: <p>How does changing the <code>Key Frame Distance</code> control (as seen below) work in terms of quality and speed?</p>
  
  <p><a href="https://i.sstatic.net/iK2eC.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/iK2eC.png" alt="enter image description here"></a></p>
  
Tags: <adobe-media-encoder>
Title: What is "Key Frame Distance" in Adobe Media Encoder?
UserDisplayName: Mohammed Mehdi TBER
ThreadText: # What is "Key Frame Distance" in Adobe Media Encoder?
  
  (Asked by: username_0 on 2020-02-06)
  
  How does changing the `Key Frame Distance` control (as seen below) work in terms of quality and speed?
  
  [![enter image description here](https://i.sstatic.net/iK2eC.png)](https://i.sstatic.net/iK2eC.png)
  
  **Tags:** adobe-media-encoder
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-02-07. Score: 1 | Accepted answer
  
  This is an answer I found on the adobe forums after googling it:
  
  The keyframe distance is the maximum number of frames before the encoder inserts an i-frame, which is the highest-quality frame of an MPEG stream (ie, it has all the information for a single frame of video inside of it rather than relying on the frames around it to reconstruct). In between the i-frames are b-frames and p-frames, which are "difference" frames that reconstruct that frame of video by looking at the nearest i-frame and applying all the "difference" frames from that point forward (or backwards). The collection of an i-frame and all its connected p-frame and b-frames is called a GOP, or "Group of Pictures". So in essence the "keyframe distance" value determines the length of each GOP.
  
  Note that Premiere automatically inserts a new i-frame for scene changes, irrespective of the keyframe distance value. This is to assure video quality at the start of a new scene since there wont be enough in common from previous b-frame and p-frames.
  
  Generally speaking, the more i-frames you have, the higher the image quality of video, but also the larger the size of the video. So the value you choose for keyframe distance is a balance between the file size you want the video to fit in vs quality. If you're not concerned with file size or the file size generated is within reason then you can just leave it to its default value. Otherwise you can tweak it as part of the process to get the file size down to where you want it to be (in combination with the other encoder parameters such as bitrate).
  
  > **Comments:**
  > **username_2**: It's not only quality / filesize that are affected, one other result of changing the GOP length is that shorter GOPs make it easier to seek to a specific frame, as well as shuttle forward and backward. This is the reason that most editing codecs are all-i-frame (if you're interested there's a recent post by someone asking about using all-I-Frame h.264 instead of say ProRes here: https://video.stackexchange.com/questions/29414/intra-frame-h-264-h-265-compared-to-dnxhr-or-prores-as-intermediate-codecs-for). Of course that does dramatically increase the size.  
  > **username_0**: So Is it good to make the value 1 for a composition based on an audio spectrum? , @username_2  
  > **username_2**: Depends on what you're doing with it. All-i-frame compression will be *significantly* larger.  
  
  ---
  
  ### Answer by username_3 on 2021-09-26. Score: -2
  
  This is the equivalent to Sony Vegas macroblocks.
  If you set it to 1, every frame will be built entirely, but if set to the the default 4 every frame will be divided by four.
  This is designed for the compression ratio - if you're using it -
  Depending on the profile, if using High for example, uses the h264 maximum compression rate that is 8.
  In other words, a video of 640x360 at 60 fps is 13824000 bits per second: in baseline profile must be constant br at 1 macroblock.
  This is the fastest rendering for any video editing program, because these are uncompressed values.
  If you wish to add compression in render, use High profile, and divide the bit rate by 8.
  If using variable bit rate, set the half of it to average and the divided by 8 total in the maximum bit rate and use 8 macroblocks.
  If using premiere, set the entire 1728 br and key frame distance to 8 too.
  But in every case, when using in render compression, picture quality is not guaranteed.
  If in doubt, always use uncompressed values.
  
  > **Comments:**
  > **username_4**: Macroblocks are spatial divisions within a frame and have *nothing* to do with KF distance. For codecs upto H.264, they are fixed at 16x16 pixels. Parallel encoding breaks the frame into *slices*, not macroblocks,  
  
  ---
  
  