본문으로 건너뛰기
Skillpedia
영상 편집12k · #11556

rerun-mp4

하는 일

이 스킬은 MP4 영상 파일을 그림 묶음으로 바꾸지 않고 Rerun 기록에 추가하는 방법을 보여 줍니다. 카메라 영상을 다른 데이터 옆에 함께 보고 싶은 사람을 위한 스킬입니다.

사용하는 경우

  • ✓MP4 카메라 영상을 Rerun 기록에 추가하고 싶을 때.
  • ✓영상을 스트림 모드와 에셋 모드 중 무엇으로 쓸지 고를 때.
  • ✓영상 시간이 나머지 기록과 맞지 않아 고쳐야 할 때.

스킬 링크

https://github.com/rerun-io/rerun/blob/main/skills/rerun-mp4/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/rerun-io/rerun/blob/main/skills/rerun-mp4/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“MP4 카메라 영상을 Rerun 기록에 추가해서 센서 데이터와 맞춰지도록 하려면 어떻게 하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 에이전트가 영상 파일 하나를 읽는 리더를 만들고 적절한 설정을 고르는 방법을 설명합니다. 스트림 모드는 모든 프레임을 시간에 따라 검색할 수 있게 유지하고, 에셋 모드는 파일 전체를 한 덩어리로 저장합니다.

기술 내용 (원본 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_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.
  • 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, 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.

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.

자주 묻는 질문

스트림 모드와 에셋 모드의 차이는 무엇인가요?

스트림 모드가 기본값이며 각 프레임을 시간에 따라 검색할 수 있게 합니다. 에셋 모드는 파일 전체를 하나의 blob으로 저장하며, 영상을 스트림으로 만들 수 없을 때 씁니다.

영상을 다시 인코딩할 수 있나요?

네. 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
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬