News:

--

Main Menu

Keep the same distance between frames

Started by TheInvoker, August 20, 2022, 09:52:25 PM

Previous topic - Next topic

TheInvoker

how do i keep the same distance between frames/keyframes?

eumagga0x2a

I'm not sure what you mean with "same distance between frames". Turning a variable frame rate video into constant frame rate one? This is achievable by re-encoding video with "resample fps" video filter added to the filter chain.

Regarding "same distance between keyframes", most encoders allow setting keyframe interval (the minimum and maximum number of frames between two keyframes). Some low-quality encoders like the NVENC-based H.264 encoder on old NVIDIA hardware support only a fixed, user-configurable interval, which is a very poor strategy. I hope you don't ask for the latter mode.

TheInvoker

no i mean the distance between keyframes
in the past you told me i can modify it changing gop numbers (min max), but if i don't want to change it?

eumagga0x2a

#3
Quote from: TheInvoker on August 22, 2022, 10:11:26 PMin the past you told me i can modify it changing gop numbers (min max), but if i don't want to change it?

The result will reflect the default configuration of the respective video encoder then (which is encoder-specific).

Or do you ask for means to force particular frames being encoded as keyframes (e.g. based on the strategy of the encoder which had created the source video)? This is not implemented.

TheInvoker

it's not hard to understand what i ask
KEEP THE SAME DISTANCE BETWEEN FRAMES AND KEYFRAMES

if a file has the first keyframe a 0,481ms, the second keyframe at 1,003ms etc etc....the output file should have the same timestamps for those keyframes. i don't want to change anything

Blues

Keyframe is an element of video compression. When the video is decoded [to be processed] these keyframes are gone. The stream coming from decoder has no keyframes, it is just uncompressed video. Now you encode this stream again, how the heck encoder could know where the keyframes were before decoding? Preserving keyframe positions is not natural part of decoding and re-encoding process. To implement this the program must specifically go back to the source, register the position of keyframe and use this information to force a keyframe insertion by encoder. I do not see how this complicated procedure could benefit users.
Indeed, the beauty of open source is you can always get busy and make the changes you desire by yourself.