Skip to content

Add MPEG-4 Part 2 (ASP) video codec support #156

Open
wiedymi wants to merge 2 commits intoVanilagy:mainfrom
wiedymi:feature/mpeg4-codec
Open

Add MPEG-4 Part 2 (ASP) video codec support #156
wiedymi wants to merge 2 commits intoVanilagy:mainfrom
wiedymi:feature/mpeg4-codec

Conversation

@wiedymi
Copy link

@wiedymi wiedymi commented Sep 30, 2025

Features:

  • Full MPEG-4 Part 2 ASP encoder and decoder
  • WASM-based implementation using Xvid library
  • Worker-based processing for non-blocking operation
  • Support across all containers (AVI, MP4, MOV, MKV)
  • VOP coding type detection for keyframe identification

Package structure:

  • packages/mpeg4/ - Standalone codec package
  • Uses Emscripten-compiled Xvid for WebAssembly

Codec integration:

  • Added 'mpeg4' to VIDEO_CODECS list
  • Codec string mapping (mp4v.20.9 for encoding, mp4v for extraction)
  • Packet type detection via VOP headers (0x000001B6)

Container support:

  • AVI: XVID/DX50/FMP4/MP4V fourCC mapping
  • ISOBMFF (MP4/MOV): mp4v sample entry with esds box
  • Matroska: V_MPEG4/ISO/ASP codec string

Tests:

  • 4 new test suites for AVI, MP4, MOV, MKV with mpeg4 samples
  • Total 8 tests validating mpeg4 codec support

@wiedymi wiedymi changed the title Implements MPEG-4 Part 2 Advanced Simple Profile video codec using Xvid for encoding/decoding. @wiedymi Add MPEG-4 Part 2 (ASP) video codec support Sep 30, 2025
@wiedymi wiedymi changed the title @wiedymi Add MPEG-4 Part 2 (ASP) video codec support Add MPEG-4 Part 2 (ASP) video codec support Sep 30, 2025
@wiedymi wiedymi force-pushed the feature/mpeg4-codec branch 11 times, most recently from 10aecb2 to 8a229d8 Compare September 30, 2025 16:14
Implements reading and writing of AVI (Audio Video Interleave) files, a RIFF-based container format.

Features:
- Full AVI demuxer with support for multiple video and audio codecs
- AVI muxer with RF64 support for large files (>4GB)
- Codec mapping for common fourCC codes (H.264, HEVC, VP8, VP9, AV1, etc.)
- Audio codec support (AAC, MP3, Vorbis, FLAC, PCM variants, μ-law, A-law)
- Index (idx1) generation for seeking
- Proper timestamp and duration handling

Files added:
- src/avi/avi-demuxer.ts - AVI file parser
- src/avi/avi-muxer.ts - AVI file writer
- src/avi/avi-misc.ts - Codec mappings and utilities
- src/avi/riff-writer.ts - RIFF chunk writing utility

Integration:
- Added AviInputFormat and AviOutputFormat classes
- Exported AVI singleton in ALL_FORMATS
- Test suite with 7 tests covering format detection, muxing, and demuxing
Implements MPEG-4 Part 2 Advanced Simple Profile video codec using Xvid for encoding/decoding.

Features:
- Full MPEG-4 Part 2 ASP encoder and decoder
- WASM-based implementation using Xvid library
- Worker-based processing for non-blocking operation
- Support across all containers (AVI, MP4, MOV, MKV)
- VOP coding type detection for keyframe identification

Package structure:
- packages/mpeg4/ - Standalone codec package
- Uses Emscripten-compiled Xvid for WebAssembly

Codec integration:
- Added 'mpeg4' to VIDEO_CODECS list
- Codec string mapping (mp4v.20.9 for encoding, mp4v for extraction)
- Packet type detection via VOP headers (0x000001B6)

Container support:
- AVI: XVID/DX50/FMP4/MP4V fourCC mapping
- ISOBMFF (MP4/MOV): mp4v sample entry with esds box
- Matroska: V_MPEG4/ISO/ASP codec string

Tests:
- 4 new test suites for AVI, MP4, MOV, MKV with mpeg4 samples
- Total 8 tests validating mpeg4 codec support
@wiedymi wiedymi force-pushed the feature/mpeg4-codec branch from 8a229d8 to e26fcce Compare February 16, 2026 13:26
@wiedymi
Copy link
Author

wiedymi commented Feb 16, 2026

@Vanilagy I also rebased this one. But I will double check on everything later, it were done so long ago, so I am not sure anymore, lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant