Open Media codecs abstraction - A modern, modular multimedia framework with a clean C++ API.
OpenMedia is a next-generation multimedia library designed to provide decoding, encoding, and demuxing capabilities for audio, video, and image formats. Built with modern C++20, it offers a flexible plugin-style architecture for codec integration while maintaining a simple, intuitive API.
Note: Not all codecs currently support encoding yet and is currently a work in progress. The library currently focuses on decoding and demuxing.
- Audio Codecs: AAC, ALAC, FLAC, Opus, Vorbis, MP3, AAC, PCM, and more
- Video Codecs: AV1, H.264/AVC, H.265/HEVC, H.266/VVC, EVC, VP8, VP9, and more
- Image Formats: PNG, JPEG, WebP, GIF, BMP, TIFF, TGA
- Container Support - Matroska (MKV/MKA/WebM), MP4, Ogg, Wav, and more
- Modular Architecture - Enable/disable codecs at compile-time via CMake options
- Hardware Acceleration - Support for Vulkan Video, DirectX 11/12 Video, VA-API
- Modern C++20 API - Clean, type-safe interfaces, exception-free, rtti-free
- Example Player - SDL3-based reference player
Status: ✅ Implemented | 🔧 Planned
| Codec | Decoding | Encoding | Backends |
|---|---|---|---|
| AAC | ✅ | ✅ | libfdk-aac, WMF, FFmpeg |
| ALAC | ✅ | ✅ | libalac, FFmpeg |
| FLAC | ✅ | 🔧 | libFLAC, FFmpeg |
| Opus | ✅ | ✅ | libopus, FFmpeg |
| Vorbis | ✅ | ✅ | libvorbis, FFmpeg |
| MP3 | ✅ | 🔧 | minimp3, WMF, FFmpeg |
| WAV/PCM | ✅ | ✅ | OpenMedia |
Status: ✅ Implemented | 🔧 Planned
| Codec | Decoding | Encoding | Backends |
|---|---|---|---|
| AV1 | ✅ | 🔧 | Hardware, dav1d (decoding only) |
| VP8/VP9 | ✅ | ✅ | Hardware, libvpx |
| H264/AVC | ✅ | ✅ | Hardware, OpenH264, FFmpeg |
| H265/HEVC | ✅ | ✅ | Hardware, FFmpeg |
| H266/VVC | ✅ | 🔧 | VVdeC (Broken), VVenC, FFmpeg |
| Apple ProRes | ✅ | 🔧 | Apple Hardware + FFmpeg only |
| EVC | Untested | Untested | xevd, xeve |
Status: ✅ Implemented | 🔧 Planned
| Codec | Decoding | Encoding | Backends |
|---|---|---|---|
| PNG | ✅ | 🔧 | Portable Network Graphics (decoder & demuxer) |
| JPEG | ✅ | 🔧 | Joint Photographic Experts Group |
| WebP | ✅ | 🔧 | Modern image format by Google |
| GIF | ✅ | 🔧 | Graphics Interchange Format |
| BMP | ✅ | 🔧 | Bitmap image format |
| TIFF | ✅ | 🔧 | Tagged Image File Format |
| TGA | ✅ | 🔧 | Truevision TARGA |
| EXR | 🔧 | 🔧 | OpenEXR |
OpenMedia provides interfaces for hardware-accelerated decoding and encoding:
Status: ✅ Implemented | 🔧 Planned
| API | Status | Platform |
|---|---|---|
| VideoToolbox | Done | macOS |
| VA-API | Only H264 High | Linux |
| AMF | Decoding Only | Windows |
| Vulkan Video | Only H264 Decode | Windows/Linux |
| DirectX 11 Video | Mostly done but unstable | Windows |
| DirectX 12 Video | Mostly done but unstable | Windows |
| CUDA/NVDEC | TBD | Windows/Linux |
| NVENC | TBD | Windows/Linux |
| Intel® Media SDK | 🔧 | Windows |
| MediaCodec | Untested | Android |
Status: ✅ Implemented | 🔧 Planned
| Format | Demuxing | Muxing | Description |
|---|---|---|---|
| Matroska (MKV/MKA/WebM) | ✅ | ✅ | Matroska container (libwebm) |
| MP4/MOV/M4A (BMFF) | ✅ | 🔧 | ISO Base Media File Format |
| MOV/QuickTime (BMFF) | ✅ | 🔧 | Apple QuickTime format |
| Ogg | ✅ | ✅ | Ogg container |
| WAV | ✅ | ✅ | WAV container |
| FLAC | ✅ | 🔧 | FLAC container |
| MP3 | ✅ | 🔧 | MP3 container |
| AVI | 🔧 | Not planned | Audio Video Interleave |
- CMake 3.21+
- C++20 compatible compiler (Clang, MSVC, GCC)
mkdir build && cd build
cmake .. -DOPENMEDIA_EXAMPLES=ON
cmake --build .#include <openmedia/codec_api.hpp>
#include <openmedia/format_detector.hpp>
#include <openmedia/codec_registry.hpp>
#include <openmedia/format_registry.hpp>
using namespace openmedia;
int main() {
// Initialize registries
CodecRegistry codec_registry;
FormatRegistry format_registry;
FormatDetector format_detector;
// Register built-in codecs and formats
registerBuiltInCodecs(&codec_registry);
registerBuiltInFormats(&format_registry);
format_detector.addAllStandard();
// Create decoder for a specific codec
auto decoder = codec_registry.createDecoder(OM_CODEC_AV1);
if (decoder) {
DecoderOptions options;
options.format = /* ... */;
decoder->configure(options);
auto result = decoder->decode(packet);
if (result.isOk()) {
auto frames = result.unwrap();
// Process decoded frames...
}
}
return 0;
}OpenMedia is provided under the terms of its respective license. See LICENSE for details.
Contributions are welcome! Whether it's adding new codecs, improving existing implementations, or fixing bugs, please feel free to submit issues and pull requests.