"keyframe interval" settings

Nathan-Gurel wrote on 1/4/2021, 9:28 AM

We regularly create videos in Vegas Pro 18 and upload them to "Restream" for future live event scheduling. We have tried rendering our files with "MAGIC AVC/ACC MP4", "MAGIX HEVC/AAC MPR" and "Sony AVC/MVC". Here is the issue:

Every attempt to render has produced a file with a "keyframe interval" set to "1" instead of "2". This causes issues within Restream. We are getting either "CABAC / 4 Ref Frames" or "CABAC / 1 Ref Frames" depending on the profile used.

"keyframe interval"

  • In "Handbrake" it is called "keyint="
  • In "MediaInfo" it is called "Reference frames"
  • In "Restream" it is called "Keyframe interval"

The only way we have been able to create a video with the "keyframe interval" set to "2" is with Handbrake using the advanced using a frame rate at 30 fps, a bit rate at 6 mbps, and setting "keyint=60" (30 fps x 2 to get 60)

Vegas Pro must be able to produce videos with a "keyframe interval" set to "2" - I am sure we just haven't found out how to do it.

Could someone show me how, or tell me if it is even possible? I was once told that "it doesn't really matter, and 1 is better then 2; however, for what we need to do, it must be set to "2" - we just need to find out how to produce our videos with "keyframe interval" set to "2" using Vegas Pro.

Comments

JN- wrote on 1/4/2021, 6:22 PM

@Nathan-Gurel As I understand it, open to correction, the terms keyint and keyframe interval mean the same thing, i.e. the GOP length. The Ref frame term refers to the PB intervals, typically a smaller number, 1, 2, 3 or 4.

There is an add in render option in VP, Voukoder, that i’m sure will give you the flexibility of setting the B frames etc. VP's render templates don’t allow that finer level of control. Don't know if @wwaag's HOS does also.

Every attempt to render has produced a file with a "keyframe interval" set to "1" instead of "2"

This is probably a ref frame size, i.e. a single P frame. So for example a GOP of 30, and ref frame of 1 would be like ...

IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPI. If I counted right!

 

Although you appear to have tested Sony AVC, on a sample Sony Avc file I get the following result ...

GOP length ... [ 13 ] 
IBPBPBPBPBPBPI

This is what you are after I think, a REF frame of 2. ... BP.

 

This is the output from the "Mediainfo app for the same file ...

Format settings                          : CABAC / 2 Ref Frames

Format settings, Reference frames        : 2 frames
Format settings, GOP                     : M=2, N=13

 

"it doesn't really matter" is mostly true for sure, but do note that in render quality metric testing that I did this Sony VP render codec is at the bottom of the pile. Worth looking at the Voukoder renderer, uses the far superior x264, just a bit more work to set it all up.

 

OTOH In "Restream" it is called "Keyframe interval" This should be referring to the larger number i.e. say 30 or 60, GOP. If its really a keyint of 1 then it's an Intra frame ALL-I file. A keyint of 2 would be say IPPI, or IBPI. These would be relatively large files, it’s probably a mixup with the terminology?

 

 

Last changed by JN- on 1/4/2021, 7:41 PM, changed a total of 9 times.

---------------------------------------------

VFR2CFR, Variable frame rate to Constant frame rate link to zip here.

Copies Video Converts Audio to AAC, link to zip here.

Convert 2 Lossless, link to ZIP here.

Convert Odd 2 Even (frame size), link to ZIP here

Benchmarking Continued thread + link to zip here

Codec Render Quality tables zip

---------------------------------------------

PC ... Corsair case, own build ...

CPU .. i9 9900K, iGpu UHD 630

Memory .. 32GB DDR4

Graphics card .. MSI RTX 2080 ti

Graphics driver .. latest studio

PSU .. Corsair 850i

Mboard .. Asus Z390 Code

 

Laptop… XMG

i9-11900k, iGpu n/a

Memory 64GB DDR4

Graphics card … Laptop RTX 3080

Nathan-Gurel wrote on 1/9/2021, 12:53 PM

Is there a way to set the GOP to 60 for a 30 fps within Vegas ? And is GOP the same as Adobe's "Key Frame Distance" and Handbrake's "keyint"

Also, I have attempted to use Voukoder, but have had problems finding the right setting in there too.

All of my attempts lead to this:

Format profile                           : High@L4
Format settings                          : CABAC / 1 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 1 frame
Format settings, GOP                     : M=1, N=30

john_dennis wrote on 1/11/2021, 3:54 PM

@Nathan-Gurel

Here is a CCL that will place an index frame every 60 frames. Play with the parameters in HOS / RPlus to refine to suit your needs.

Link: https://drive.google.com/file/d/1DNUdMpcFr9BZxiVbGlqIyVWN7MPSvcbb/view?usp=sharing

The text version:

ffmpeg -y -i <inAVS>  -itsoffset 0.0444 -i <inTempWav> -map 0:v -map 1:a  -c:v libx264 -force_key_frames "expr:eq(mod(n,60),0)" -x264opts rc-lookahead=30:keyint=60:min-keyint=60 -pix_fmt yuv420p  -crf 20 -preset slow -profile high -level 4.1 -c:a:0 aac -b:a:0 320k  <outFile>.mp4

The CCL goes into C:\ProgramData\HappyOtterScripts\Magix Vegas Pro\RenderPlus\Custom CommandLines

Sorry for the delay.