rerun-mp4
ما الذي تفعله
تُري هذه المهارة الوكيل كيفية إضافة ملف فيديو MP4 إلى تسجيل Rerun دون تحويله إلى صور. وهي مخصصة للأشخاص الذين يريدون عرض فيديو الكاميرا بجانب بياناتهم الأخرى.
متى تستخدمها
- ✓عندما تريد إضافة فيديو كاميرا بصيغة MP4 إلى تسجيل Rerun.
- ✓عندما تحتاج إلى الاختيار بين وضع التيار (stream) ووضع الأصل (asset) لفيديو.
- ✓عندما يكون توقيت الفيديو غير متطابق مع بقية التسجيل وتحتاج إلى إصلاحه.
رابط المهارة
https://github.com/rerun-io/rerun/blob/main/skills/rerun-mp4/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“كيف أضيف فيديو الكاميرا بصيغة MP4 إلى تسجيل Rerun الخاص بي حتى يتطابق مع بيانات المستشعر؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تشرح المهارة كيف يبني الوكيل قارئًا لملف فيديو واحد وأي إعدادات يختار. يحتفظ وضع التيار بكل إطار قابل للبحث عبر الزمن، بينما يخزّن وضع الأصل الملف كله كقطعة واحدة.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
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.
الأسئلة الشائعة
ما الفرق بين وضع التيار ووضع الأصل؟
وضع التيار هو الافتراضي ويحتفظ بكل إطار قابلًا للبحث عبر الزمن. أما وضع الأصل فيخزن الملف كله ككتلة واحدة، ويُستخدم حين لا يمكن تحويل الفيديو إلى تيار.
هل يمكن إعادة ترميز الفيديو؟
نعم. تغطي المهارة التحويل عبر FFmpeg، بما في ذلك إعدادات مثل الإطارات B والترميز الناتج والمسافة بين الإطارات المفتاحية.
كيف أستخدم عدة كاميرات؟
أنشئ قارئًا لكل ملف فيديو، ثم ادمج التيارات الناتجة معًا.
التفاصيل
الوصف الأصلي من المؤلف
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
الشعبية
- نجوم GitHub
- 12k
- الترتيب
- #11556
- الترخيص
- Apache-2.0
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
investigate-puffin
12kيتيح لوكيلك فحص تسجيلات أداة Puffin للتحليل (ملفات .puffin)، وإيجاد أجزاء الشيفرة البطيئة، ومقارنة التتبعات قبل التعديل وبعده.
rerun-blueprint
12kيعلّم وكيلك تغيير طريقة عرض أداة Rerun عبر كتابة مخطط (blueprint) للتسجيل أو الجدول، يشمل التخطيط والعروض والأعمدة المخفية.
rerun-catalog-queries
12kيساعد وكيلك على الاستعلام من فهرس Rerun عبر Python بسرعة أكبر، مع نصائح لتقليل عدد الطلبات وحجم البيانات المرسلة وبطء قراءة المجموعات.
rerun-chunk-processing
12kيعلّم وكيلك بناء خطوط معالجة بيانات Rerun بقارئات وعدسات (lenses) تحوّل ملفات MCAP وParquet والفيديو وRRD إلى تسجيلات.
مهارات مشابهة
taste-application
280kيساعد وكيلك على إنشاء فيديوهات بأسلوب محدد. يمكنه نسخ إيقاع المونتاج من فيديو مرجعي، وإنشاء مشاهد جديدة، وضبط الألوان، ومونتاج كل شيء مع لقطات أخرى.
taste-distillation
280kيتيح لوكيلك تحليل الفيديوهات لإنشاء حزمة أسلوب. تتضمن الألوان وإيقاع القطع والعناصر البصرية التي يمكن إعادة استخدامها لإنشاء فيديوهات جديدة بالمظهر نفسه.
ui-demo
280kيجعل وكيلك يسجل فيديوهات عرض احترافية لواجهات المستخدم. مفيد لإنشاء الشروحات أو إظهار طريقة عمل تطبيق ويب.