Style Checker
noumena-labs/Sipp
Enforces this monorepo's coding style rules by inspecting git diffs, reading .agents/skills/style-checker/references/styleguidance.md, fixing style violations, and reporting the result.
API reference for the shiguredo_mp4 Rust library: muxing and demuxing MP4 and fragmented MP4, encoding and decoding boxes, and its Sans I/O design.
SKILL.md written in Japanese; this summary is our English description.
$ npx skills add shiguredo/mp4-rs --skill shiguredo-mp4 -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install shiguredo/mp4-rs shiguredo-mp4 --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/shiguredo/mp4-rs.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/shiguredo-mp4 .claude/skills/shiguredo-mp4 && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "shiguredo-mp4" agent skill from https://github.com/shiguredo/mp4-rs/tree/develop/skills/shiguredo-mp4 into .claude/skills/shiguredo-mp4/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "shiguredo-mp4", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/shiguredo/mp4-rs/tree/develop/skills/shiguredo-mp4Type this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add shiguredo/mp4-rs --skill shiguredo-mp4 -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install shiguredo/mp4-rs shiguredo-mp4 --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/shiguredo/mp4-rs.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/shiguredo-mp4 .agents/skills/shiguredo-mp4 && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "shiguredo-mp4" agent skill from https://github.com/shiguredo/mp4-rs/tree/develop/skills/shiguredo-mp4 into .agents/skills/shiguredo-mp4/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "shiguredo-mp4", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add shiguredo/mp4-rs --skill shiguredo-mp4 -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install shiguredo/mp4-rs shiguredo-mp4 --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/shiguredo/mp4-rs.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/shiguredo-mp4 .cursor/skills/shiguredo-mp4 && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "shiguredo-mp4" agent skill from https://github.com/shiguredo/mp4-rs/tree/develop/skills/shiguredo-mp4 into .cursor/skills/shiguredo-mp4/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "shiguredo-mp4", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/shiguredo/mp4-rs.git --path skills/shiguredo-mp4--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add shiguredo/mp4-rs --skill shiguredo-mp4 -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install shiguredo/mp4-rs shiguredo-mp4 --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/shiguredo/mp4-rs.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/shiguredo-mp4 .gemini/skills/shiguredo-mp4 && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "shiguredo-mp4" agent skill from https://github.com/shiguredo/mp4-rs/tree/develop/skills/shiguredo-mp4 into .gemini/skills/shiguredo-mp4/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "shiguredo-mp4", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install shiguredo/mp4-rs shiguredo-mp4Installs for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add shiguredo/mp4-rs --skill shiguredo-mp4 -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/shiguredo/mp4-rs.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/shiguredo-mp4 .github/skills/shiguredo-mp4 && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "shiguredo-mp4" agent skill from https://github.com/shiguredo/mp4-rs/tree/develop/skills/shiguredo-mp4 into .github/skills/shiguredo-mp4/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "shiguredo-mp4", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add shiguredo/mp4-rs --skill shiguredo-mp4 -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install shiguredo/mp4-rs shiguredo-mp4 --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/shiguredo/mp4-rs.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/shiguredo-mp4 .opencode/skills/shiguredo-mp4 && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "shiguredo-mp4" agent skill from https://github.com/shiguredo/mp4-rs/tree/develop/skills/shiguredo-mp4 into .opencode/skills/shiguredo-mp4/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "shiguredo-mp4", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
shiguredo-mp4API reference for the shiguredo_mp4 Rust library: muxing and demuxing MP4 and fragmented MP4, encoding and decoding boxes, and its Sans I/O design.
This skill answers questions about shiguredo_mp4, a Rust crate from Shiguredo for reading and writing MP4 (ISO Base Media File Format). The library is Sans I/O, so reading and writing files is left to the caller, it has no external dependencies beyond core and alloc, and it supports no_std. A C API and a WebAssembly API are provided as well, and it follows the ISO/IEC 14496 family of standards.
The reference covers the high-level Mp4FileMuxer, Mp4FileDemuxer, Fmp4SegmentMuxer and Fmp4SegmentDemuxer types, the box-level Encode and Decode traits that every box implements, core types such as BaseBox, BoxHeader, BoxSize, BoxType, Mp4File and SampleFlags, and the Error, DemuxError and MuxError types. Codec-specific sample entries are listed too. The SKILL.md itself is written in Japanese.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 1282b70. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are rust).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
shiguredo_mp4 Rust MP4 Library Reference loads about 4.4k tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 1,181 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from shiguredo/mp4-rs at commit 1282b70, republished under its Apache-2.0 licence (© shiguredo). 1,181 words, ~4,355 tokens.
.claude/skills/shiguredo-mp4/SKILL.md (or your agent's skills folder).Sans I/O 設計に基づく MP4 (ISO Base Media File Format) の mux/demux ライブラリ。
core / alloc のみ)no_std 対応: std 非依存 (alloc クレートは必要)Mp4FileMuxer / Mp4FileDemuxer / Fmp4SegmentMuxer / Fmp4SegmentDemuxer による mux/demuxEncode / Decode を実装し、直接エンコード/デコード可能crates/c-api / crates/wasm で提供shiguredo_mp4MP4 ファイルは ftyp + 各種ボックス(moov / mdat / moof 等)で構成される。
すべてのボックスは BaseBox トレイトを実装し、Encode / Decode トレイトでバイト列と相互変換できる。
| 型 | 説明 |
|---|---|
BaseBox | 全ボックスの共通トレイト (box_type() / children()) |
BoxHeader | ボックスヘッダー (box_type + box_size)。decode_header_and_payload() でヘッダーとペイロードに分解 |
BoxSize | ボックスのサイズ表現。U32(u32) / U64(u64)。VARIABLE_SIZE (U32(0)) は「ファイル末尾まで」を意味する |
BoxType | ボックス種別。Normal([u8; 4]) / Uuid([u8; 16]) |
FullBox / FullBoxHeader | version + flags を持つボックス用トレイト/ヘッダー |
Mp4File<B> | ファイル全体 (ftyp_box + boxes: Vec<B>) の表現。RootBox がデフォルト |
Either<A, B> | stco/co64 のように 2 種のボックスのどちらかを持つ場合に使う |
Uint<T, BITS, OFFSET> | 任意ビット幅の整数 (Uint<u8, 2, 6> 等) |
FixedPointNumber<I, F> | 固定小数点数 (16.16 等) |
Utf8String | null 終端 UTF-8 文字列 (new() は null を含む文字列を拒否) |
LanguageCode | 3 文字言語コード (from_ascii("eng") 等。0x60..=0x7F の範囲のみ) |
Mp4FileTime | MP4 時間 (1904/1/1 起点)。from_unix_time() で変換 |
TrackKind | Audio / Video / Subtitle |
SampleFlags | fMP4 のサンプルフラグ (trun 等で使用)。from_fields() / sample_is_non_sync_sample() 等 |
use shiguredo_mp4::{Decode, Encode};
// エンコード: buf に書き込み、書き込んだバイト数を返す
let n = box.encode(&mut buf)?;
// バイト列に変換
let bytes = box.encode_to_vec()?;
// デコード: (値, 消費バイト数) を返す
let (decoded, size) = BoxType::decode(buf)?;
// オフセットを自動で進めるデコード
let value = u32::decode_at(buf, &mut offset)?;Error: エンコード/デコード時のエラー。kind: ErrorKind (InvalidInput / InvalidData / InsufficientBuffer / Unsupported) と reason / location / box_type を持つ。Display は発生箇所 (at src/xxx.rs:NNN) 付きで表示されるDemuxError: デマルチプレックス時のエラー。DecodeError / SampleTableError / InvalidState / InputRequired(RequiredInput) (Sans I/O の入力要求)MuxError: マルチプレックス時のエラー。EncodeError / EmptyTracks / EmptySamples / PositionMismatch / MissingSampleEntry / AlreadyFinalized / TimescaleMismatch / MixedSampleEntries / NoSyncSamples / OverflowMp4FileDemuxer - MP4 ファイルのデマルチプレックス通常の MP4 ファイルからトラック情報とサンプルを時系列順に取得する。
| メソッド | 説明 |
|---|---|
new() | インスタンス生成 |
required_input() | 次に必要な入力範囲 Option<RequiredInput> を返す (初期化済みなら None) |
handle_input(Input) | ファイルデータを供給する。required_input() が要求した範囲を包含するデータを一度に渡すこと。部分的なデータ消費は行わない |
tracks() | &[TrackInfo] を返す。I/O が必要な場合は InputRequired を返す |
next_sample() | 全トラックから最も早いタイムスタンプのサンプルを返す。無ければ None |
prev_sample() | 現在位置より前で最も遅いタイムスタンプのサンプルを返す |
seek(Duration) | 指定時刻にシーク。次回 next_sample() は指定時刻を含むサンプルから開始 |
Input は { position: u64, data: &[u8] }、RequiredInput は { position: u64, size: Option<usize> }。
required_input() で要求された範囲を供給し、DemuxError::InputRequired が返るまで繰り返す。
ストリーミング用途は想定していない(大きな mdat は要求されないが、moov は全体を渡す必要がある)。
use shiguredo_mp4::demux::{Input, Mp4FileDemuxer};
let mut demuxer = Mp4FileDemuxer::new();
while let Some(required) = demuxer.required_input() {
// required.position と required.size に基づいてデータを読み込む
let data: &[u8] = read_data(required.position, required.size);
demuxer.handle_input(Input { position: required.position, data });
}
let tracks = demuxer.tracks()?;
while let Ok(Some(sample)) = demuxer.next_sample() {
// sample.track, sample.timestamp, sample.data_offset, sample.data_size
}Fmp4SegmentDemuxer - fMP4 セグメントのデマルチプレックス初期化セグメント (ftyp + moov) とメディアセグメント (moof + mdat) を個別に処理する。
| メソッド | 説明 |
|---|---|
new() | インスタンス生成 |
handle_init_segment(&[u8]) | 初期化セグメントを処理する (2 回目以降は InvalidState) |
tracks() | 初期化済みトラック情報 &[TrackInfo] を返す |
handle_media_segment(&[u8]) | メディアセグメントを処理し Vec<Sample> を返す。moof より前、moof と mdat の間、mdat の後ろのトップレベルボックス (styp / sidx / ssix / prft / free 等) は読み飛ばす。1 回の呼び出しで 1 つの moof + mdat ペアのみ (moof の後ろで mdat より先に別の moof が出る場合や、mdat の後ろの moof はエラー)。エラー時は内部状態が変わらない (同じインスタンスを使い続けられる) |
Sample.data_offset は handle_media_segment() に渡したバッファ先頭からの相対位置。
use shiguredo_mp4::demux::Fmp4SegmentDemuxer;
let mut demuxer = Fmp4SegmentDemuxer::new();
demuxer.handle_init_segment(&init_segment)?;
let tracks = demuxer.tracks()?;
let samples = demuxer.handle_media_segment(&media_segment)?;Fmp4FileDemuxer - fMP4 ファイルのインクリメンタルデマルチプレックス1 つのファイル内に並んだ複数セグメントを順番に処理する。Mp4FileDemuxer と同様に
required_input() / handle_input() の Sans I/O ループで使う。
Mp4FileDemuxer と同様に、要求された範囲より多いデータ (ファイル全体など) を渡してもよい。
ただし Mp4FileDemuxer と異なり、ファイル全体を渡す場合も required_input() が Some を返す間は
handle_input() を繰り返し呼ぶ必要がある。
入力が要求された範囲の終端より手前で終わっている場合は、入力の終端をファイルの終端とみなす。
| メソッド | 説明 |
|---|---|
new() | インスタンス生成 |
required_input() | 次に必要な入力範囲を返す |
handle_input(Input) | ファイルデータを供給する |
tracks() | トラック情報を返す |
next_sample() | 次のサンプルを返す (全トラック時系列順) |
制限: tfhd の base_data_offset にファイル先頭からの絶対オフセットを記録した形式には非対応。
Mp4FileKindDetector - MP4 / fMP4 の種別判定moov 内の mvex ボックスの有無で MP4 か fragmented MP4 かを incremental に判定する。
use shiguredo_mp4::demux::{Mp4FileKind, Mp4FileKindDetector};
let mut detector = Mp4FileKindDetector::new();
while let Some(required) = detector.required_input() {
// データを読み込んで供給
detector.handle_input(Input { position: required.position, data });
if let Some(kind) = detector.file_kind()? {
match kind {
Mp4FileKind::Mp4 => { /* 通常 MP4 */ }
Mp4FileKind::FragmentedMp4 => { /* fMP4 */ }
}
break;
}
}TrackInfo: { track_id: u32, kind: TrackKind, duration: u64, timescale: NonZeroU32 }duration / timestamp はタイムスケール単位。秒は timescale で割るduration は init segment 由来で 0 になることが多いSample<'a>: { track: &'a TrackInfo, sample_entry: Option<&'a SampleEntry>, keyframe: bool, timestamp: u64, duration: u32, data_offset: u64, data_size: usize, composition_time_offset: Option<i64> }sample_entry は前のサンプルから変更がない場合 None (最初のサンプルは常に Some)timestamp は DTS。PTS は timestamp + composition_time_offsetdata_offset は file demuxer ではファイル先頭からの絶対位置、segment demuxer では入力バッファ先頭からの相対位置Mp4FileMuxer - MP4 ファイルのマルチプレックス複数トラックのサンプルを統合して MP4 ファイルを生成する。
基本的な使用フロー:
new() または with_options(Mp4FileMuxerOptions) でインスタンス生成initial_boxes_bytes() のバイト列をファイルに書き込む (ftyp + 予約領域 + mdat ヘッダー)append_sample(&Sample) でメタデータを通知finalize() で完了し、FinalizedBoxes::offset_and_bytes_pairs() の内容をファイルの該当オフセットに書き込む| メソッド | 説明 |
|---|---|
new() / with_options(options) | インスタンス生成 |
initial_boxes_bytes() | 初期ボックス群のバイト列 (ファイル先頭に書く) |
append_sample(&Sample) | サンプルを追加。エラー時は内部状態が変わらない (再呼び出し可能) |
advance_position(u64) | サンプルデータ以外のバイト列 (moof / mdat ヘッダ等) 分だけ書き込み位置を進める。OBS の Hybrid MP4 用 |
finalize() | マルチプレックス完了。&FinalizedBoxes を返す |
finalized_boxes() | ファイナライズ結果を後から取得 (finalize() 前は None) |
Sample のフィールド (mux::Sample):
| フィールド | 説明 |
|---|---|
track_kind: TrackKind | トラック種別 |
sample_entry: Option<SampleEntry> | コーデック情報。最初のサンプルでは必須、以降は省略可 (前のサンプルを引き継ぐ) |
keyframe: bool | キーフレームか。stss ボックスの生成に使われる |
timescale: NonZeroU32 | タイムスケール。同一トラック内で統一必須 (不一致は TimescaleMismatch) |
duration: u32 | サンプルの尺 (タイムスケール単位) |
composition_time_offset: Option<i64> | PTS - DTS。負値は i32::MIN..=-1、非負値は 0..=u32::MAX の範囲のみ |
data_offset: u64 | ファイル内でのサンプルデータの開始位置。直前の append_sample() の位置と一致必須 (PositionMismatch) |
data_size: usize | サンプルデータのサイズ |
注意点:
keyframe = false だと finalize() が NoSyncSamples を返すcomposition_time_offset は ctts ボックスに書き出されるuse shiguredo_mp4::mux::{Mp4FileMuxer, Sample};
let mut muxer = Mp4FileMuxer::new()?;
let initial_bytes = muxer.initial_boxes_bytes();
// file.write_all(initial_bytes)?;
let sample = Sample {
track_kind: TrackKind::Video,
sample_entry: Some(sample_entry),
keyframe: true,
timescale: NonZeroU32::MIN.saturating_add(30 - 1),
duration: 1,
composition_time_offset: None,
data_offset: initial_bytes.len() as u64,
data_size: 1024,
};
muxer.append_sample(&sample)?;
let finalized = muxer.finalize()?;
for (offset, bytes) in finalized.offset_and_bytes_pairs() {
// file.seek(SeekFrom::Start(offset))?;
// file.write_all(bytes)?;
}Mp4FileMuxerOptions::reserved_moov_box_size に予約サイズを指定すると、moov をファイル先頭付近に配置する
faststart 形式になる (FinalizedBoxes::is_faststart_enabled() で判定)。
estimate_maximum_moov_box_size(&[sample_count_per_track]) で概算サイズを計算できる。
予約サイズより moov が大きい場合は moov はファイル末尾に配置され、faststart は無効になる。
Mp4FileMuxerOptions のフィールド:
reserved_moov_box_size: usize - faststart 用の moov 予約サイズ (デフォルト 0 = 無効)creation_timestamp: Duration - 作成時刻 (デフォルト UNIX エポック)audio_track / video_track / subtitle_track: TrackMetadata - mdhd.language / hdlr.name のメタデータTrackMetadata は { language: LanguageCode, name: Utf8String }。
Fmp4SegmentMuxer - fMP4 セグメントのマルチプレックス初期化セグメント (ftyp + moov) とメディアセグメント (moof + mdat) を生成する。
| メソッド | 説明 |
|---|---|
new() / with_options(SegmentMuxerOptions) | インスタンス生成 |
create_media_segment_metadata(&[Sample]) | メディアセグメントの先頭メタデータ (moof + mdat ヘッダー) を生成。mdat ペイロードは含まない。サンプルの track 情報と sample entry を内部に蓄積する |
create_media_segment_metadata_with_sidx(&[Sample]) | 先頭に sidx ボックスを付加したメディアセグメントを生成 (DASH 等向け) |
init_segment_bytes() | その時点までに観測した内容を反映した初期化セグメントを返す。未観測なら EmptyTracks |
mfra_bytes() | ランダムアクセスインデックス (mfra) のバイト列を生成。ファイル末尾に付加 |
注意点:
Sample.data_offset は「ファイル全体の絶対位置」ではなく「今回のセグメントの mdat payload 領域の先頭からの相対位置」data_offset 昇順で連続配置する必要がある (1 track = 1 traf = 1 trun 前提)composition_time_offset は trun に書くため i32::MIN..=i32::MAX の範囲に限られる。負値と > i32::MAX の値の混在はエラーkeyframe = false でも NoSyncSamples にはならない (trun の SampleFlags と sidx の SAP 判定に使われる)mfra_bytes() は、実際にファイル先頭に配置する init segment を確定させた後で呼ぶこと (tfra の moof_offset は init segment のサイズ基準で計算される)use shiguredo_mp4::mux::{Fmp4SegmentMuxer, Sample};
let mut muxer = Fmp4SegmentMuxer::new()?;
let segment = muxer.create_media_segment_metadata(&samples)?;
let init_segment = muxer.init_segment_bytes()?;
let mfra = muxer.mfra_bytes()?;shiguredo_mp4::boxes モジュールに全ボックスが定義されている。
各ボックスは Encode / Decode / BaseBox を実装し、フィールドがすべて pub なので直接構築・参照できる。
| ボックス | 説明 |
|---|---|
RootBox | トップレベルボックスの enum (Free / Mdat / Moov / Moof / Mfra / Sidx / Unknown) |
FtypBox | ファイル種別 (major_brand / minor_version / compatible_brands) |
MdatBox | メディアデータ本体 (payload: Vec<u8>) |
FreeBox | 空き領域 (payload: Vec<u8>) |
UnknownBox | 未知のボックスの受け皿 |
Brand | ブランド定数 (ISOM / ISO2 / MP41 / AVC1 / HEV1 / HVC1 / AV01 等) |
boxes_moov_tree)| ボックス | 説明 |
|---|---|
MoovBox | movie ボックス (mvhd_box + trak_boxes + mvex_box: Option + unknown_boxes) |
MvhdBox | movie ヘッダー。DEFAULT_RATE / DEFAULT_VOLUME / DEFAULT_MATRIX 定数あり |
TrakBox | トラック (tkhd_box + edts_box: Option + mdia_box) |
TkhdBox | トラックヘッダー (track_id / duration / width / height 等) |
EdtsBox / ElstBox / ElstEntry | 編集リスト |
MdiaBox | メディア情報 (mdhd_box + hdlr_box + minf_box) |
MdhdBox | メディアヘッダー (timescale / duration / language / creation_time) |
HdlrBox | ハンドラー (HANDLER_TYPE_VIDE / HANDLER_TYPE_SOUN / HANDLER_TYPE_SUBT / HANDLER_TYPE_TEXT 定数あり) |
MinfBox | メディア情報ボックス (media_header: Option<MediaHeader> + dinf_box + stbl_box) |
MediaHeader | enum (Smhd / Vmhd / Sthd / Nmhd) |
DinfBox / DrefBox / UrlBox | データ参照 (DinfBox::LOCAL_FILE 定数あり) |
StblBox | サンプルテーブル |
StsdBox | サンプル説明 (entries: Vec<SampleEntry>) |
SttsBox / SttsEntry | デコード時間テーブル (from_sample_deltas() で構築可能) |
CttsBox / CttsEntry | コンポジション時間オフセット |
CslgBox | コンポジション時間シフト |
SdtpBox / SdtpSampleFlags | 独立/再利用可能サンプル |
StscBox / StscEntry | サンプル-チャンクマッピング |
StszBox | サンプルサイズ。Fixed { sample_size } / Variable { entry_sizes } の enum |
StcoBox / Co64Box | チャンクオフセット (32bit / 64bit)。Either::A / Either::B で使い分ける |
StssBox | 同期サンプル (不在 = 全サンプル同期) |
MvexBox / MehdBox / TrexBox | ムービー拡張 (fMP4 用) |
EsdsBox | ES 記述子 (AAC 用) |
boxes_fmp4)| ボックス | 説明 |
|---|---|
MoofBox | ムービーフラグメント (mfhd_box + traf_boxes) |
MfhdBox | フラグメントヘッダー (sequence_number) |
TrafBox | トラックフラグメント (tfhd_box + tfdt_box: Option + trun_boxes) |
TfhdBox | トラックフラグメントヘッダー。FLAG_BASE_DATA_OFFSET_PRESENT 等のフラグ定数あり。default_base_is_moof / base_data_offset / default_sample_* フィールド |
TfdtBox | フラグメントデコード時間 (base_media_decode_time) |
TrunBox | トラックフラグメントラン (data_offset: Option<i32> + samples: Vec<TrunSample>) |
TrunSample | duration / size / flags / composition_time_offset (すべて Option) |
SidxBox / SidxReference | セグメントインデックス (DASH 用) |
MfraBox / TfraBox / TfraEntry / MfroBox | ムービーフラグメントランダムアクセス |
TrunBox のフィールドに Option を渡すと、対応するフラグが立っていない場合はフィールドが省略される。
boxes_sample_entry)SampleEntry は以下の enum:
| variant | ボックス種別 | コーデック |
|---|---|---|
Avc1(Avc1Box) | avc1 | H.264 / AVC |
Hev1(Hev1Box) | hev1 | H.265 / HEVC (パラメータセット in-band) |
Hvc1(Hvc1Box) | hvc1 | H.265 / HEVC (パラメータセット out-of-band) |
Vp08(Vp08Box) | vp08 | VP8 |
Vp09(Vp09Box) | vp09 | VP9 |
Av01(Av01Box) | av01 | AV1 |
Opus(OpusBox) | Opus | Opus |
Mp4a(Mp4aBox) | mp4a | AAC |
Flac(FlacBox) | fLaC | FLAC |
Stpp(StppBox) | stpp | XML 字幕 (TTML / IMSC) |
Wvtt(WvttBox) | wvtt | WebVTT 字幕 |
Tx3g(Tx3gBox) | tx3g | 3GPP タイムドテキスト |
Unknown(UnknownBox) | - | 未知のサンプルエントリー |
SampleEntry のヘルパー:
audio_channel_count() / audio_sample_rate() / audio_sample_size() - 音声のチャンネル数 / サンプリングレート / ビット深度video_resolution() - (幅, 高さ) を返すコーデック設定ボックス (avcC / hvcC / vpcC / av1C / dOps / dfLa 等) も同モジュールで提供される。
Avc1Box 等の映像系は VisualSampleEntryFields (幅・高さ・解像度等)、音声系は AudioSampleEntryFields を持つ。
StblBox をラップしてサンプル情報を簡単に取り出すための構造体。
SampleTableAccessor<T>: new(stbl_box) / sample_count() / chunk_count() / get_sample(NonZeroU32) / get_sample_by_timestamp(u64) / get_chunk(NonZeroU32) / samples() / chunks() / stbl_box()SampleAccessor<'a, T>: index() / duration() / timestamp() / data_size() / data_offset() / is_sync_sample() / sync_sample() / composition_time_offset() / chunk()ChunkAccessor<'a, T>: index() / offset() / sample_entry() / sample_entry_index() / sample_count() / samples()SampleTableAccessor::new() は stts / stsz / stsc / stco(または co64) / stss / ctts の整合性を検証し、
不整合 (InconsistentSampleCount / FirstChunkIndexIsNotOne / ChunkIndicesNotMonotonicallyIncreasing 等) を
SampleTableAccessorError で報告する。
use shiguredo_mp4::aux::{SampleTableAccessor, SampleAccessor};
let table = SampleTableAccessor::new(&stbl_box)?;
for sample in table.samples() {
println!(
"sample {}: ts={}, duration={}, offset={}, size={}",
sample.index(),
sample.timestamp(),
sample.duration(),
sample.data_offset(),
sample.data_size(),
);
}EsDescriptor / DecoderConfigDescriptor / DecoderSpecificInfo / SlConfigDescriptor を提供。
OBJECT_TYPE_INDICATION_AUDIO_ISO_IEC_14496_3 (0x40) 等の定数あり。
docs::hybrid_mp4 - OBS の Hybrid MP4 の取り扱いdocs::subtitle - 字幕トラックの取り扱いmp4a) / Opus (Opus) / FLAC (fLaC)vp08) / VP9 (vp09) / AV1 (av01) / H.264 (avc1) / H.265 (hev1, hvc1)stpp / wvtt / tx3g© shiguredo, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/shiguredo-mp4 of shiguredo/mp4-rs.
Open the folder on GitHubat commit 1282b70
shiguredo_mp4 Rust MP4 Library Reference next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| shiguredo_mp4 Rust MP4 Library Reference this skillshiguredo/mp4-rs | 159 | — | ~4.4k | Automated safety check: Pass | Apache-2.0 | |
| Style Checkernoumena-labs/Sipp | 121 | — | ~1.4k | Automated safety check: Pass | Apache-2.0 | |
| Working With Nixxmtp/libxmtp | 121 | — | ~1.4k | Automated safety check: Pass | MIT | |
| Upgrade Dear Imgui StackLatias94/dear-imgui-rs | 108 | — | ~977 | Automated safety check: Pass | Apache-2.0 | |
| Automerge Syncnteract/nteract | 180 | — | ~4.5k | Automated safety check: Pass | BSD-3-Clause | |
| Profiling Wado Compilerwado-lang/wado | 117 | — | ~2.9k | Automated safety check: Notes | MIT |
noumena-labs/Sipp
Enforces this monorepo's coding style rules by inspecting git diffs, reading .agents/skills/style-checker/references/styleguidance.md, fixing style violations, and reporting the result.
xmtp/libxmtp
A skill your agent uses when working with Nix flakes, selecting devShells, debugging environment issues, or understanding Nix infrastructure - covers shell selection, environment detection, common…
Latias94/dear-imgui-rs
A skill your agent uses when a user asks to upgrade Dear ImGui, cimgui, ImPlot, ImPlot3D, ImNodes, ImGuizmo, Dear ImGui Test Engine, or related bindings in this repository.
nteract/nteract
Automerge sync protocol internals, document model (OpSet, ChangeGraph, fork/merge, save/load lifecycle), and higher-level protocol design patterns.
wado-lang/wado
Profile the native Rust wado binary (compile/serve/run) for host-side bottlenecks — CPU with a sampling profiler, memory with the span trace's RSS and valgrind DHAT.
nteract/nteract
Develop, debug, and manage the runtimed daemon, Python bindings, and build system.
Works with
Categories
API reference for the shiguredo_mp4 Rust library: muxing and demuxing MP4 and fragmented MP4, encoding and decoding boxes, and its Sans I/O design. This skill answers questions about shiguredo_mp4, a Rust crate from Shiguredo for reading and writing MP4 (ISO Base Media File Format). The library is Sans I/O, so reading and writing files is left to the caller, it has no external dependencies beyond core and alloc, and it supports no_std.
shiguredo_mp4 Rust MP4 Library Reference fits situations like: asking how to mux or demux an MP4 or fragmented MP4 file with shiguredo_mp4; encoding or decoding individual MP4 boxes in Rust; checking which errors muxing and demuxing can return; looking up codec-specific sample entries or ISO/IEC 14496 conformance details.
Run `npx skills add shiguredo/mp4-rs --skill shiguredo-mp4 -a claude-code`. Or copy the skill folder (skills/shiguredo-mp4 in shiguredo/mp4-rs) into .claude/skills/shiguredo-mp4 in your project. Claude Code loads it when a task matches its description.
Run `npx skills add shiguredo/mp4-rs --skill shiguredo-mp4 -a codex`. Or copy the skill folder (skills/shiguredo-mp4 in shiguredo/mp4-rs) into .agents/skills/shiguredo-mp4 in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add shiguredo/mp4-rs --skill shiguredo-mp4 -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/shiguredo-mp4, .gemini/skills/shiguredo-mp4, .github/skills/shiguredo-mp4 and .opencode/skills/shiguredo-mp4 in your project.
SKILL.md names no scripts, command-line tools or credentials: shiguredo_mp4 Rust MP4 Library Reference is instructions for the agent only. Our summary lists: Rust 1.93 or newer, the documented minimum version.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
shiguredo_mp4 Rust MP4 Library Reference is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.4k tokens (SKILL.md is roughly 17k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with shiguredo_mp4 Rust MP4 Library Reference: Style Checker (noumena-labs/Sipp, 121 stars), Working With Nix (xmtp/libxmtp, 121 stars), Upgrade Dear Imgui Stack (Latias94/dear-imgui-rs, 108 stars) and Automerge Sync (nteract/nteract, 180 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
shiguredo (a GitHub organization) maintains it in shiguredo/mp4-rs, which has 159 GitHub stars. The repository was last updated on October 7, 2026.
Source: shiguredo/mp4-rs on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.