Scan your whole stack
Latest version: vgit:618e6368fc862818d2d83e08b4423bc02b941fe4
rerun-mp4 was last scanned on 23 Nov 2026 at commit 618e6368. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 618e6368 | 1 rule fired |
Findings for commit 618e6368. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The skill asks to be allowed to run a wide range of shell commands. Developer tools often need this.
LOWThe score describes 618e6368; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Mp4Reader turns one .mp4 file into a lazy chunk stream on one entity:
compressed video samples, no decode to pixels, nothing re-encoded unless it has
to be. Everything is configured on the constructor; stream() takes no
arguments. Stream mechanics after .stream() (filter, map, merge, collect,
write) are in rerun-chunk-processing.
from rerun.experimental import Mp4Reader, Mp4TranscodeOptions
reader = Mp4Reader(video_path, entity_path="/camera/front") # mode="stream" by default
stream = reader.stream() # lazy: nothing is decoded yet
Every parameter after path is keyword-only. One reader handles one file — for
several cameras, build one reader per file and LazyChunkStream.merge(...) them
(see below).
mode |
emits | when |
|---|---|---|
"stream" (default) |
a codec chunk, per-GOP sample chunks, a keyframe marker | almost always — every frame is time-indexed and queryable |
"asset" |
the whole file as one blob, plus a frame index | the codec cannot be a VideoStream, or the source starts mid-GOP |
Reach for stream mode; the next section covers exactly what it emits. Asset mode
copies the entire file into the recording as one blob, so nothing downstream can
look at a single frame without the whole asset. It is the fallback for codecs a
VideoStream cannot carry (mp4v, image-sequence mp4), and it is what rerun video.mp4 and the built-in file importer use.
For tests/assets/video/Big_Buck_Bunny_1080_1s_h264_nobframes.mp4 (30 frames,
one GOP) with entity_path="/camera/front", the whole output is three chunks:
[0] entity=/camera/front static=True rows=1 timelines=[] cols=['VideoStream:codec']
[1] entity=/camera/front static=False rows=30 timelines=['video'] cols=['VideoStream:sample']
[2] entity=/camera/front static=False rows=1 timelines=['video'] cols=['VideoStream:is_keyframe']
VideoStream:codec.
It carries no timeline — code that walks the stream must
handle that (if chunk.is_static: continue).is_keyframe marker chunk, holding a sparse True row at
each keyframe's time and nothing else. Keeping it out of the sample chunks is
what lets a keyframe-only query skip the sample payload, and what
collect(optimize=…) accepts as canonical. It is list-per-row, so a row reads
back as [True], not True.video, duration[ns], values are the mp4 PTS from the start of
the video.entity_path=None (the default) derives
it from the file's absolute path, so foo/video.mp4 run from /data
becomes /data/foo/video.mp4. Pass entity_path explicitly in any real
pipeline.A short clip is often a single GOP, so "three chunks total" is the normal shape —
not a sign that something was dropped. chunk_by_gop=False emits one Rerun
chunk per sample instead (the marker chunk is unaffected). That is a debugging
shape — one chunk per frame is a poor storage layout, and it also makes a
following optimize pass 6× more expensive (measured below) — so leave the
default alone unless you are inspecting individual samples.
Distinguish the three by their columns, not by position or is_static: the codec
chunk is the static one, sample chunks carry VideoStream:sample, and the marker
chunk carries only VideoStream:is_keyframe.
Supported stream-mode codecs are exactly the five VideoCodec values: H264,
H265, AV1, VP8, VP9.
reader.info() returns an Mp4Info built from the container metadata alone.
No video data is read, so it costs a fraction of a stream read.
Use it for anything that only needs the frame layout: keyframe positions, frame count, frame timing, whether FFmpeg will be needed.
info = Mp4Reader(video_path).info()
info.codec, info.width, info.height, info.num_frames, info.duration_ns
info.has_b_frames # True: stream mode will transcode through FFmpeg
info.gop_size_min, info.gop_size_max
info.keyframe_timestamps_ns # sorted int64 PTS of the keyframes
info.keyframe_frame_nrs # the same keyframes as frame numbers
info.samples # pa.RecordBatch, one row per frame
mode, transcode and the timeline settings do not change it.
When the stream is transcoded (B-frames, gop_size, output_codec), the emitted keyframes may differ from info.keyframe_timestamps_ns.
Without a transcode, pts equals the values on the stream's video timeline.stream().filter(components=["VideoStream:is_keyframe"]) still reads every sample, because the marker chunk is emitted last.VideoStream cannot yet model DTS != PTS, so an H.264/H.265 source with
container-level B-frame reordering cannot be emitted directly. The reader
handles that itself: it re-encodes through FFmpeg with -bf 0, streams the
result back as a fragmented mp4, and turns each fragment into one GOP chunk, so
only one GOP is resident at a time. This is automatic and invisible in the API —
the output has the same shape as a clean source. It does need an ffmpeg
executable. Asset mode is unaffected by B-frames.
Mp4TranscodeOptions (stream mode only) additionally requests a transcode:
| field | effect |
|---|---|
output_codec |
re-encode to another VideoCodec; the emitted VideoStream:codec follows |
gop_size |
force a keyframe every N frames — the knob for seek cost in the viewer |
try_gpu |
best-effort hardware encode, NVENC / VideoToolbox only |
ffmpeg_override |
use this ffmpeg instead of the one on PATH |
Requesting the output_codec the source already uses is a no-op: it stays on
the direct, no-FFmpeg path. With chunk_by_gop=True, gop_size=N makes every
GOP chunk but the last hold exactly N samples — a 30-frame clip at gop_size=10
gives 10, 10, 10. try_gpu realistically covers H264/H265 plus AV1 on newer
NVIDIA; VP8/VP9 always fall back to software, and it does nothing unless a
transcode is already happening.
Mp4Reader(
video_path,
entity_path="/camera/front",
# ~1s GOPs on a 60fps source, so seeking in the viewer stays snappy.
transcode=Mp4TranscodeOptions(gop_size=64),
).stream()
The emitted times are always PTS — elapsed nanoseconds from the start of that video. In a multi-sensor recording, that is almost never the timeline you want to align on.
timeline_name="real_time" renames the timeline.timeline_type="timestamp" only retypes the same PTS values as
nanoseconds since the Unix epoch. The reader does not shift them, so on its
own it renders the video near 1970. It is meaningful only paired with a retag
step.stream.map(...). Samples arrive in presentation order
(B-frames are already stripped), so a running cursor maps sample i to
capture_times_ns[i] — but the cursor must skip the keyframe marker chunk,
which holds no samples. Map that one through the PTS the samples were already
assigned:SAMPLE_COL = "VideoStream:sample"
def _reindex_to_capture_times(stream, capture_times_ns, timeline_name):
cursor = 0
pts_to_time = {}
def _retag(chunk):
nonlocal cursor
if chunk.is_static: # the codec chunk carries no timeline
return chunk
batch = chunk.to_record_batch()
col_index = batch.schema.get_field_index(timeline_name)
old_field = batch.schema.field(col_index)
old_pts = np.asarray(batch.column(col_index).cast(pa.int64()))
if SAMPLE_COL in batch.schema.names:
# Clamp in case the decoder yields a slightly different frame count.
indices = np.clip(np.arange(cursor, cursor + chunk.num_rows), 0, len(capture_times_ns) - 1)
cursor += chunk.num_rows
new_times_ns = capture_times_ns[indices]
pts_to_time.update(zip(old_pts.tolist(), new_times_ns.tolist()))
else:
# The sparse keyframe marker, emitted after every sample chunk.
new_times_ns = np.array([pts_to_time[pts] for pts in old_pts.tolist()], dtype=np.int64)
times = pa.array(new_times_ns.astype("datetime64[ns]"))
# `metadata=` is load-bearing — see gotcha 3.
new_field = pa.field(old_field.name, times.type, nullable=old_field.nullable, metadata=old_field.metadata)
return Chunk.from_record_batch(batch.set_column(col_index, new_field, times))[0]
return stream.map(_retag)
The cursor makes this order-dependent, so keep the retag on the single reader's stream, before any merge. This is the DROID loader's pattern — see the references.
Any map/flat_map that assumes "every non-static chunk is samples, in order"
has this same bug: it advances over the marker chunk and stamps it with whatever
time comes next, silently moving the keyframe markers off their samples.
One reader per file, distinct entity paths, then merge:
streams = [
Mp4Reader(path, entity_path=f"/camera/{name}", timeline_name="real_time", timeline_type="timestamp").stream()
for name, path in cameras.items()
]
(
LazyChunkStream
.merge(*streams)
.collect(optimize=OptimizationProfile.OBJECT_STORE)
.write_rrd(out_path, application_id=app_id, recording_id=segment_id)
)
OBJECT_STORE GOP-rebatches the video and preserves the reader's keyframe
marker as-is; no fix_keyframe=True is needed. If you do see
skipping GoP rebatching … is_keyframe data is incorrect, something upstream
rewrote the marker (see gotcha 4) — fix_keyframe=True re-derives it from the
encoded samples as an escape hatch.
The reader and collect(optimize=…) agree on where GOPs start but not on
how many GOPs share a chunk, and that is by design:
max_bytes / max_rows. It never splits a GOP across chunks, so
every boundary it keeps is one the reader already produced.So optimize's partition is a pure coarsening of the reader's: same samples in
the same order, every optimized chunk a run of whole reader GOPs, keyframe marker
untouched. Where each GOP already sits near the profile's budget the two come out
identical (a 30-frame clip at gop_size=10 is 3 chunks either way). Where GOPs
are small they diverge sharply — a 12-GOP clip becomes 1 chunk under
OBJECT_STORE and 4 under LIVE.
The practical consequence: do not pre-merge or re-chunk the reader's output
to "help" optimize. Hand it the per-GOP stream and let the profile decide. And if
you skip optimize entirely (writing straight through send_chunks, as the DROID
loader does), you are storing the finest partition — correct, but more chunks
than object storage wants.
Running optimize over the reader's output is not redundant work worth avoiding. On an 89 MB / 1800-frame / 60-GOP H.264 file:
collect() |
collect(optimize=OBJECT_STORE) |
delta | |
|---|---|---|---|
chunk_by_gop=True (default) |
11.1 ms | 16.3 ms | +5.2 ms (1.5×) |
chunk_by_gop=False |
14.2 ms | 48.6 ms | +34.4 ms (3.4×) |
Neither half of the pass is expensive on GOP-aligned input:
build_sample_index runs
detect_gop_start on every sample, but that reads a few bytes of each sample's
header — it never decodes. The whole optimize delta above (5.2 ms) is smaller
than a Python loop calling the same detector over the same 1800 samples
(6.0 ms), which is mostly FFI overhead.chunk_from_gop calls
taken(0..n), and re_arrow_util::take_array returns the array uncopied
when the indices are consecutive from zero over the whole array. One chunk per
GOP means that is always the case, so the multi-MB sample buffers are never
duplicated — hence 89 MB "rebuilt" in 5 ms.That fast path is exactly what chunk_by_gop=False gives up: each GOP then spans
30 source chunks, so chunk_from_gop has to concat_and_sort them and the sample
bytes really are copied. LIVE also costs more than OBJECT_STORE (+13.2 ms vs
+5.2 ms on the same file), because its much smaller chunk budget makes it attempt
compaction it cannot complete — a GOP is never split.
Retag each camera before the merge — the retag above walks chunks with a cursor, so it must see one video's chunks in order.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.