1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""Generate the moving-triangle source frames for the video serve fixtures.
Why a triangle. The current fixtures are ffmpeg `testsrc2` colour bars, and the
serve tests assert on whatever a vision model happens to call them. That is
unstable: the same clip drew "a test pattern or a color calibration screen" in CI
and "a digital or pixel art animation" on a GPU box. A single unmistakable object
gives a stable token to assert.
Why one source, three encodings. Emitting raw RGB here and letting the encoder
vary means VP9, H.264 and H.265 carry *identical* frames. Every codec path can
then assert the same word, and a difference in model output points at decode
rather than at phrasing. It also allows a direct cross-codec frame comparison,
which is a far stronger check than any word list.
Why motion. A moving triangle also exercises temporal sampling: a regression that
collapses frame selection to a single frame changes what the model can say about
movement, where a static image would hide it.
Regenerate all three fixtures (needs an ffmpeg with libx264/libx265/libvpx-vp9;
the Dynamo runtime images deliberately ship no such encoder):
python3 make_triangle_fixture.py > frames.rgb
for spec in "libvpx-vp9 -strict -2:triangle_240p_10.mp4" \\
"libx264:triangle_240p_10_h264.mp4" \\
"libx265 -tag:v hvc1:triangle_240p_10_h265.mp4"; do
codec="${spec%%:*}"; out="${spec##*:}"
ffmpeg -y -f rawvideo -pix_fmt rgb24 -s 320x240 -r 10 -i frames.rgb \\
-c:v $codec -g 1 -pix_fmt yuv420p "$out"
done
Encoding all three from the same raw frames is the point: it keeps the decoded
content identical across codecs. Measured round-trip against the source is
1.59 / 1.68 / 1.63 mean absolute per-pixel difference.
"""
, , = 320, 240, 10
= # near-black blue; high contrast, not "colourful"
= # saturated yellow
"""One frame: a filled triangle translated horizontally across the clip."""
=
=
# Sweep left to right so motion is unambiguous across the sampled frames.
= - 160
= 20 +
=
=
=
# Fill by half-plane tests: inside iff on the same side of all three edges.
, =
return * - *
, , = , ,
= |
=
return
=
return 0