rerun-mp4
Skill này làm gì
Skill này cho agent thấy cách thêm một file video MP4 vào bản ghi Rerun mà không biến nó thành các ảnh rời. Dành cho người muốn video camera được hiển thị cạnh các dữ liệu khác.
Khi nào nên dùng
- ✓Khi bạn muốn thêm video camera MP4 vào bản ghi Rerun.
- ✓Khi bạn cần chọn giữa chế độ luồng và chế độ tài nguyên cho một video.
- ✓Khi thời gian của video không khớp với phần còn lại của bản ghi và bạn cần sửa.
Liên kết skill
https://github.com/rerun-io/rerun/blob/main/skills/rerun-mp4/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Làm sao để thêm video camera MP4 vào bản ghi Rerun để nó khớp với dữ liệu cảm biến?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill giải thích cách agent tạo bộ đọc cho một file video và chọn các thiết lập. Chế độ luồng giữ mọi khung hình có thể tìm theo thời gian, còn chế độ tài nguyên lưu cả file thành một khối.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Rerun mp4 ingestion
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.
The API
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).
Two modes
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.
What stream mode emits
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']
- One static chunk, one row, holding
VideoStream:codec. It carries no timeline — code that walks the stream must handle that (if chunk.is_static: continue). - One temporal chunk per GOP: a keyframe plus every sample that depends on it, up to (not including) the next keyframe. Samples only — the keyframe flags are not a column here.
- One trailing
is_keyframemarker chunk, holding a sparseTruerow 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 whatcollect(optimize=…)accepts as canonical. It is list-per-row, so a row reads back as[True], notTrue. - Timeline
video,duration[ns], values are the mp4 PTS from the start of the video. - Every chunk on the same entity.
entity_path=None(the default) derives it from the file's absolute path, sofoo/video.mp4run from/databecomes/data/foo/video.mp4. Passentity_pathexplicitly 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.
Transcoding through FFmpeg
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.
Câu hỏi thường gặp
Khác nhau giữa chế độ luồng và chế độ tài nguyên là gì?
Chế độ luồng là mặc định và giữ mỗi khung hình có thể tìm theo thời gian. Chế độ tài nguyên lưu cả file thành một khối và được dùng khi video không thể là luồng.
Video có thể mã hóa lại không?
Có. Skill bao quát việc chuyển mã qua FFmpeg, gồm các thiết lập như B-frame, codec đầu ra và khoảng cách khung khóa.
Làm sao dùng nhiều camera?
Tạo một bộ đọc cho mỗi file video, rồi gộp các luồng thu được lại với nhau.
Chi tiết
Mô tả gốc của tác giả
Ingest .mp4 video into Rerun chunk streams with rerun.experimental.Mp4Reader. Read when converting video into a VideoStream, choosing stream vs asset mode, transcoding (B-frames, output codec, GOP size) through FFmpeg, or aligning video PTS onto a recording's wall-clock timeline. Builds on rerun-chunk-processing (stream mechanics) and rerun-data-model (where the video belongs in the recording).
repo: rerun-io/rerun
Độ phổ biến
- Sao GitHub
- 12k
- Vị trí xếp hạng
- #11556
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
investigate-puffin
12kGiúp agent phân tích các bản ghi profiler Puffin (file .puffin), tìm đoạn code chậm và so sánh trace trước và sau một thay đổi.
rerun-blueprint
12kDạy agent thay đổi giao diện trình xem Rerun bằng cách viết blueprint cho một bản ghi hoặc bảng, gồm bố cục, view và các cột ẩn.
rerun-catalog-queries
12kGiúp agent truy vấn catalog Rerun từ Python nhanh hơn, với các mẹo về số lượt gọi qua lại, dung lượng dữ liệu và việc đọc dataset chậm.
rerun-chunk-processing
12kDạy agent xây dựng pipeline dữ liệu Rerun với reader và lens, chuyển các file MCAP, Parquet, video hoặc RRD thành bản ghi Rerun.
Skill tương tự
taste-application
280kGiúp agent tạo video theo phong cách cụ thể: sao chép nhịp dựng từ video mẫu, tạo cảnh mới, chỉnh màu và ghép với các đoạn có sẵn.
taste-distillation
280kGiúp agent phân tích video để tạo style pack gồm màu sắc, nhịp cắt và yếu tố hình ảnh, tái sử dụng để tạo video mới cùng phong cách.
ui-demo
280kGiúp agent ghi lại video demo giao diện chỉn chu. Hữu ích để tạo hướng dẫn hoặc cho thấy một ứng dụng web hoạt động ra sao.