# Variable frame rate: a frame number is not a time

Two selected frames can come from the wrong time. Unequal PTS, an incorrect 25 frames/s assumption and image identity checks.

L00P.AI · 1.0 · 2026-11-22

https://www.l00p.ai/en/resources/series/zmienny-klatkaz-numer-klatki-nie-jest-czasem/

## 01 / Two frames can be the wrong result

An edit list specifies a range from 160 to 240 milliseconds. The export contains two frames. That count is insufficient for acceptance: with unequal time intervals, two different frames can pass the same list-length check.

Our own trial of 22 November 2026 demonstrates this difference using nine simple images. Selection by presentation timestamps returns frames 2 and 3; converting the range using an assumed 25 frames/s returns frames 4 and 5. Frame numbering starts at zero. Both results contain two frames, but the second comes from a different source time.

## 02 / Number, timestamp and unit

A frame number expresses order. PTS is a presentation timestamp; it must be read together with its time base. In our saved trial the time base is 1/1000 second, so PTS 160 corresponds to 160 ms. Do not transfer that unit to an arbitrary file without checking it.

In the [select filter documentation](https://ffmpeg.org/ffmpeg-filters.html#select_002c-aselect), FFmpeg distinguishes the input frame counter n, timestamp pts, time base TB and time t. The [settb and setpts filters](https://ffmpeg.org/ffmpeg-filters.html#settb_002c-asettb) concern the time base and timestamps. We read the documentation again on publication day; the measurement used the installed FFmpeg dated 12 November 2025, reporting revision 6cdd2cbe32. We did not independently reproduce its build.

The [earlier edit list](/en/resources/series/transkrypcja-nie-jest-lista-ciec/) explicitly uses a constant 25 frames/s. The [article about milliseconds and frame boundaries](/en/resources/series/znacznik-milisekundowy-a-granica-klatki/) concerns a constant rational frame rate. Here we examine a separate problem: unequal intervals between successive PTS values.

## 03 / One source, two rules

We created nine original silent grayscale images, each 32 × 24 pixels. Every pixel in frame n has the value 10 + 24 × n. The FFV1 recording in a Matroska container has PTS values of 0, 40, 160, 200, 400, 440, 600, 640 and 800 ms. We read every decoded source timestamp and every image byte.

The eight intervals between neighboring PTS values are 40, 120, 40, 200, 40, 160, 40 and 160 ms. These are timestamp differences, not readings of frame-duration metadata. The final point at 800 ms closes the preceding interval measurement; we do not establish the final frame's display duration.

![PTS ms: 0,40,160,200,400,440,600,640,800. Range [160,240): frames2,3. Assumed25fps: frames4,5 at400,440ms.](https://www.l00p.ai/wydawnictwo/zmienny-klatkaz-numer-klatki-nie-jest-czasem/pts-en-v1.svg)

```text
n  PTS/ms
0    0
1   40
2  160  <- [160,240)
3  200  <- [160,240)
4  400  <- assumed25fps
5  440  <- assumed25fps
6  600
7  640
8  800
```

The rule specified before execution selects presentation points inside a half-open interval: the start is included and the end excluded. Range [160,240) returns frames 2 and 3 at PTS 160 and 200 ms. The incorrect assumption of equal 40 ms intervals leads to numbers [4,6), meaning frames 4 and 5 at actual PTS 400 and 440 ms.

## 04 / Controls expose the assumption

We also prepared a separate recording of the same nine images with uniform PTS values of 0, 40, 80, 120, 160, 200, 240, 280 and 320 ms. Only in this control does range [160,240) actually select numbers 4 and 5 at 160 and 200 ms. This shows which assumption the conversion from number to time depends on.

In the unequal source, range [40,160) selects only frame 1, excluding the frame at the endpoint of 160 ms. Range [201,400) is empty; the all-inclusive case retains all nine images. Byte and timestamp comparisons had zero tolerance in this synthetic trial. All 21 conditions passed in one execution; these are not 21 independent experiments.

The saved main selection filter is settb=1/1000,select='gte(pts,160)*lt(pts,240)',showinfo. Timestamps were checked before rawvideo output. The raw pixel file stores no timing: we did not test a container holding the selected result or its playback. The [fps_mode passthrough option](https://ffmpeg.org/ffmpeg.html#Advanced-Video-options) concerns passing timestamps through, but the documentation also notes possible container effects. The option alone does not establish acceptance of a finished video.

## 05 / What to record for acceptance

Record source identity, its time base, actual PTS values, numbering and the boundary inclusion rule. Establish whether you are selecting presentation points or want to retain every image displayed during any part of the range. These are different requirements; our trial checks the former.

Check frame identity and time as well as frame count. For a production export, read timestamps and order again from the finished container and inspect the boundaries. If you add audio, subtitles or a source-to-output map, they need separate acceptance. Agreement between two counters does not establish agreement between those layers.

## 06 / Limits and correction

This is one trial of nine synthetic images, without voice, music or third-party material. We retained the original, preexecution protocol, commands, outputs and hashes. Before publication we rechecked saved artifacts without repeating the measurement. The diagram shows measured points; the prose and ASCII provide the same values.

We did not test cameras, audiovisual synchronization, a UTC clock, subtitles or player compatibility. Selecting PTS points does not trim frame display intervals or establish output duration. Codex, an AI agent, prepared PL/EN text, the diagram and author checks; there was no independent second-model review. Changes to source, time base, boundaries, filters or format require renewed acceptance. Let us start a discussion of your own material with its timestamps and selection rule.
