Add VP9 video codec support to Muxide, complementing the existing AV1 support. VP9 is a royalty-free video codec developed by Google, commonly used in WebM containers and supported by major browsers.
- ✅ AV1 support exists (OBU format parsing)
- ✅ H.264/H.265 support exists (Annex B format)
- ✅ MP4 container structure established
- ✅ Codec abstraction pattern established
VP9 uses IVF (Intra Video Frame) containers for storage, but for MP4 muxing we need:
- Compressed VP9 frames (similar to AV1 OBUs but different structure)
- Frame headers containing temporal and spatial information
- Key frame detection for sync samples
- Resolution extraction from sequence headers
VP9 Frame:
├── Frame Header (variable length)
│ ├── Frame Marker (2 bytes: 0x49, 0x83, 0x42)
│ ├── Profile (2 bits)
│ ├── Show Existing Frame (1 bit)
│ ├── Frame Type (1 bit: 0=key, 1=inter)
│ ├── Show Frame (1 bit)
│ ├── Error Resilient (1 bit)
│ └── ... (additional header fields)
├── Compressed Data (variable length)
└── Optional: Frame Size (4 bytes)
- VP9 frame header parsing
- Key frame detection
- Resolution extraction from sequence parameters
- Basic frame validation
- VP9 codec configuration box (vpcC)
- Sample entry creation
- Frame data extraction and writing
- Sync sample detection
- Unit tests with VP9 fixtures
- Integration tests
- FFmpeg compatibility verification
- Performance benchmarking
src/codec/mod.rs- Add VP9 modulesrc/codec/vp9.rs- New VP9 codec implementationsrc/api.rs- Add VideoCodec::Vp9 variantsrc/muxer/mp4.rs- Integrate VP9 codec handling
tests/- Add VP9 test fixturestests/vp9_muxing.rs- VP9-specific tests
- No new external dependencies (maintain zero-dependency goal)
- Use existing bit manipulation utilities
- VP9 video files mux correctly into MP4
- FFmpeg can play resulting MP4 files
- Performance comparable to other codecs
- Comprehensive test coverage
- Documentation updated
- Low Risk: Similar to AV1 implementation pattern
- Medium Complexity: VP9 headers more complex than H.264 but similar to AV1
- Testing: Need VP9 sample data (can generate with ffmpeg)
- Phase 1: 2-3 days (parsing logic)
- Phase 2: 1-2 days (MP4 integration)
- Phase 3: 1-2 days (testing & validation)
- Total: 4-7 days
- Research VP9 bitstream specification
- Obtain/create VP9 test fixtures
- Implement basic frame parsing
- Integrate with MP4 muxer
- Test and validate c:\Users\micha\repos\muxide\VP9_IMPLEMENTATION_PLAN.md