ffmpeg-bitstream

Rewrite H.264 and HEVC bitstream headers without re-encoding using FFmpeg filters.

15|4|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/damionrashford/media-os --skill ffmpeg-bitstream
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ffmpeg-bitstream
Source: https://github.com/damionrashford/media-os/tree/main/skills/ffmpeg-bitstream
Command: npx skills add https://github.com/damionrashford/media-os --skill ffmpeg-bitstream

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Modify video and audio bitstreams without re-encoding to fix muxing errors and compatibility issues.

Core Features & Use Cases

  • Reframe AVCC to Annex-B for H.264/HEVC to ensure compatibility when multiplexing MP4/MOV into TS/HLS.
  • Rewrite header data like SPS/PPS/VPS, VUI parameters, and AUD/SEI without touching the encoded video data.
  • Extract or duplicate extradata (SPS/PPS) as side-data for downstream tools, or dump extradata before keyframes to keep segments joinable.

Quick Start

Apply bitstream filters to rewrite headers for MP4/MOV without re-encoding, such as converting H.264 framing to Annex-B.

Frequently Asked Questions about ffmpeg-bitstream

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert H.264 MP4 to Annex-B for HLS muxing without re-encoding?

To convert H.264 MP4 to Annex-B for HLS muxing without re-encoding, apply the h264_mp4toannexb bitstream filter with the -c copy flag in FFmpeg. This reframes AVCC to Annex-B, ensuring compatibility when multiplexing MP4/MOV into TS/HLS.

Can I rewrite SPS/PPS or VPS headers without touching the encoded video data?

Yes, you can rewrite SPS/PPS or VPS headers without touching encoded video data by using FFmpeg bitstream filters. This modifies the header data like VUI parameters and AUD/SEI while keeping the underlying stream intact using -c copy.

What's the best way to extract or duplicate extradata as side-data for downstream tools?

The best way to extract or duplicate extradata as side-data for downstream tools is using the extract_extradata or dump_extra bitstream filters. This duplicates SPS/PPS side-data or dumps extradata before keyframes to keep segments joinable.

Does FFmpeg bitstream filtering work with HEVC and AV1 container transitions?

FFmpeg bitstream filtering works with HEVC and AV1 container transitions by applying specific filters like hevc_mp4toannexb. It modifies video and audio bitstreams without re-encoding to fix muxing errors across MP4/MOV to TS/HLS transitions.

Why do I need the -c copy flag when applying bitstream filters to fix muxing errors?

You need the -c copy flag when applying bitstream filters to fix muxing errors because it prevents re-encoding. Bitstream filters like filter_units and setts modify headers and NAL-units directly, requiring -c copy to operate losslessly.

When should I use the filter_units bitstream filter for NAL-unit filtering?

You should use the filter_units bitstream filter for NAL-unit filtering when you need to modify specific NAL-units without re-encoding. It enables targeted removal or rewriting of NAL-units to resolve container transition and compatibility issues.