ffmpeg-bitstream

ffmpeg-bitstream is a skill for Claude Code from damionrashford/media-os. It costs 146 tokens per session (5,215 once invoked), scanned A, original, MIT.

A guide to FFmpeg bitstream filters, which change video or audio packet metadata without re-encoding the media. It covers common H.264, HEVC, AAC, timestamp, and packet-structure fixes.

In plain words
What is it for?
Use it when remuxing MP4, TS, HLS, or MKV files, fixing AAC or H.264 compatibility errors, changing codec metadata, adjusting timestamps, or removing packet data that a decoder rejects.
Why use it?
It helps resolve format and muxing problems while preserving the original pixels and avoiding the quality loss and time of re-encoding.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the media-os plugin — 121 skills, 11 agents, 5 hooks, 1 plugin shipped together

Good fit Use it when remuxing MP4, TS, HLS, or MKV files, fixing AAC or H.264 compatibility errors, changing codec metadata, adjusting timestamps, or removing packet data that a decoder rejects.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/damionrashford/media-os/ffmpeg-bitstream
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add damionrashford/media-os --skill ffmpeg-bitstream
Clone the repo
git clone --depth 1 https://github.com/damionrashford/media-os

Made for: Claude Code.

Or install media-os, the plugin that ships this one along with the rest of its 121 skills, 11 agents, 5 hooks, 1 plugin.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ffmpeg-bitstream

README.md
[![agentmods](https://agentmods.dev/badge/skills/damionrashford/media-os/ffmpeg-bitstream/github.svg)](https://agentmods.dev/skills/damionrashford/media-os/ffmpeg-bitstream)
Your own site
<a href="https://agentmods.dev/skills/damionrashford/media-os/ffmpeg-bitstream"><img src="https://agentmods.dev/badge/skills/damionrashford/media-os/ffmpeg-bitstream/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ffmpeg-bitstream

Your own site · 80×15
<a href="https://agentmods.dev/skills/damionrashford/media-os/ffmpeg-bitstream"><img src="https://agentmods.dev/badge/skills/damionrashford/media-os/ffmpeg-bitstream.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 146 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,215 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00146 $0.05215
Opus 5 $0.00073 $0.02608
Sonnet 5 $0.00029 $0.01043
Haiku 4.5 $0.00015 $0.00522

Measured 10d ago against content hash cc81c7682a23, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

ffmpeg-bitstream scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/bsf.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ffmpeg-bitstream/SKILL.md · 405 lines

How it starts

The opening of the file, as written. The whole thing — 405 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Ffmpeg Bitstream

Context: $ARGUMENTS

Quick start

  • MP4 H.264 → TS/HLS: -bsf:v h264_mp4toannexb → Step 3, recipe A
  • MP4 HEVC → TS: -bsf:v hevc_mp4toannexb → Step 3, recipe A
  • TS AAC → MP4: -bsf:a aac_adtstoasc → Step 3, recipe B
  • Old DivX/XviD packed B-frames: -bsf:v mpeg4_unpack_bframes → Step 3, recipe D
  • Rewrite H.264 level / VUI: -bsf:v h264_metadata=... → Step 3, recipe E
  • Strip SEI / AUD / filler NALs: -bsf:v filter_units=remove_types=6 → Step 3, recipe F
  • Dump extradata into every keyframe (streaming recovery): -bsf:v dump_extra=freq=k
  • Zero-base timestamps without re-encoding: -bsf:v setts=ts=PTS-STARTPTS
  • Debug NAL/SPS/PPS structure: -bsf:v trace_headers

When to use

  • Container mux fails with Malformed AAC bitstream detected / H.264 bitstream not in Annex-B format.
  • Need to remux MP4 ↔ TS / HLS / MKV with -c copy (no re-encode, no quality loss).
  • Change H.264/HEVC level, profile, color primaries, or VUI flags without touching pixels.
  • Split a stream into segments that need keyframe-carried SPS/PPS for mid-stream joins.
  • Strip SEI/AUD NAL units a downstream decoder chokes on.
  • Rewrite PTS/DTS on the packet level (e.g. zero-base timestamps, offset by N).
  • Pull SPS/PPS out of a file for a hardware pipeline.
  • Fix broken old MP4s with packed B-frames (DivX/XviD era).
  • For re-encode workflows use ffmpeg-transcode; for trimming use ffmpeg-cut-concat; for pure container inspection use ffmpeg-probe.

Step 1 — Identify the mux / codec mismatch

Probe first — bsf choice depends on codec + source container + target container:

ffprobe -v error -show_entries stream=index,codec_type,codec_name,profile -of json "$IN"

What to look at:

  • Video codec_name = h264 → pick h264_mp4toannexb or h264_metadata.
  • Video codec_name = hevc / h265 → pick hevc_mp4toannexb or hevc_metadata.
  • Audio codec_name = aac coming from mpegts → need aac_adtstoasc for MP4.
  • Source container = .mp4 / .mov (AVCC / length-prefixed NAL) vs .ts / .flv (Annex-B / start-code NAL) — this is the framing that bsf rewrites.

Read the full file on GitHub · 405 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 405 lines · 146 tokens per session scan A cc81c7682a23

Subscribe to this mod's changes

ffmpeg-bitstream is a skill published in the GitHub repository damionrashford/media-os (18 stars, last pushed 3mo ago), licensed MIT. It adds 146 tokens to every session and 5,215 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

loudcheck

Loudness compliance verdicts against formal published standards — EBU R 128, ATSC A/85, or BS.1770 measure-only. Use it when audio or video has to pass a delivery gate: "is this file broadcast-legal?", "will this mix get rejected?", "how far off target is it and what's the exact fix?", batch-checking a delivery…

chaoz23/loudcheck · 109 tokens

slideshow

Author a HyperFrames slideshow — a presentation, pitch deck, or interactive deck with discrete slides, fragment reveals, branching, hotspot navigation, and built-in presenter mode with speaker notes; also converts an existing page into a deck. Output is a navigable deck, not a rendered MP4. If the user didn't…

heygen-com/hyperframes · 83 tokens

faceless-explainer

Turn arbitrary text — an article, notes, a topic, a brief — into a faceless explainer video: there is no site or footage to capture, so the visuals are invented per scene (typography, abstract graphics, diagrams, data-viz). Use for topic explainers, concept breakdowns, how-tos, listicles. Not a video built from a…

heygen-com/hyperframes · 98 tokens

figma

Import Figma content into a HyperFrames composition — rendered assets, brand tokens, components, storyboard sections → reconstructed motion (frames read as states, not slides) (REST/CLI), connector-assisted motion when available, and shaders from a connector or native export. Use when the user pastes a figma.com link…

heygen-com/hyperframes · 89 tokens

general-video

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated…

heygen-com/hyperframes · 92 tokens

remotion-to-hyperframes

Port an existing Remotion (React) composition's source to HyperFrames HTML. Use ONLY on an explicit ask to port/convert/migrate/translate a Remotion source — one-way, Remotion-only. A passing Remotion mention, reference-only code, or "make something like my Remotion video" is a fresh build (/general-video). Unclear →…

heygen-com/hyperframes · 84 tokens