Measure video keyframe intervals

Updated: November 23, 2026

Measure keyframe spacing in the actual export before choosing packaging settings. An encoder interval in frames only maps to a fixed number of seconds at a constant frame rate. Timestamps show what made it into the delivered file.

Read the video packet flags

Run the command below on one rendition’s video. It reports presentation timestamps and packet flags for the first video stream. Keep packets whose flags contain K and sort their available presentation timestamps numerically. If the file is long, start with a short copy that includes scene changes.

ffprobe -v error -select_streams v:0 -show_packets -show_entries packet=pts_time,flags -of csv=p=0 keyed.mp4

Measure each consecutive gap

For timestamps 0.000, 2.000, 4.000, and 7.500 seconds, the gaps are 2, 2, and 3.5 seconds. Record both the longest gap and the typical one. If the longest exceeds your target, check the encoder’s maximum interval and export again. A limit of 60 frames targets two seconds in a constant 30 fps video.

For a ladder with several resolutions, record each filename, the first and last timestamp inspected, and the longest gap found. Similar maximum gaps can hide cuts at different moments. If the packaging profile expects aligned variants, compare the actual timestamps near each intended boundary.

Check the packaged result

Repeat the measurement on the export your packager uses. For HLS, separately check that segments start on the access points required by your profile and that renditions share the intended cut points. A K flag helps inspect spacing. It cannot certify the segment boundaries by itself.

Frequently asked questions

It can introduce a keyframe before the configured maximum. Measure consecutive timestamps to see the real spacing.

You might also like

Host your videos for free and earn from every view

Create your account in under a minute, upload your first video and start earning from day one.