Projects / 04
oicut
Native Odin media codecs and containers. Video, audio and image decoding and encoding with no FFmpeg or other codec library at runtime.
- Odin
- MIT
- no FFmpeg
- Vulkan Video
- VideoToolbox
- Linux · Windows · macOS
By the numbers
- ProRes 4444 + alpha, 1080p
- 329 fps
- through RGBA, 8 threads (89 fps on one)
- per 1080p H.265 frame, Vulkan Video decode
- 1.40 ms
- three in flight (2.46 ms one at a time); FFmpeg's Vulkan Video takes 1.87
- native H.264 encode, 1080p, QP 27
- 176 fps
- 16 slices on 16 workers; x264 medium with the same tools does 226
- WebP corpus files
- 131 / 131
- RGBA-identical to dwebp
Figures from oicut v0.0.22's BENCHMARKS.md (bash tests/compare.sh, measured 2026-10-27, AV1 against dav1d 2026-11-02, on a Ryzen 9 9900X3D and an RX 9070 XT) and its image/webp README.
What's in it
01One API over everything
media encodes and decodes through the native codecs, the system's or the hardware's, choosing what the machine supports.
02Hardware when it's there
Vulkan Video sessions for H.264, H.265 and AV1 on Linux, VideoToolbox H.264 and HEVC decoding and encoding on macOS, the native codecs as the software path.
03Movie files in one call
video turns RGBA or planar frames and f32 PCM into MP4 or WebM and back, with frame-accurate seeking.
04Patented formats on request
Native H.264 and H.265 are compiled in only with -define:OICUT_PATENTED=true. A default build leaves them out and sends both formats through Vulkan Video or VideoToolbox.
05Your threads, not ours
Parallel work runs on the caller's common.Work_Pool. The codecs never create threads of their own.
06Plain Odin
The native codecs and containers build for Linux, Windows and macOS with nothing else to install.
07A player included
viewer is an SDL3 player for every format oicut reads.
Formats
Video
- H.264
- encode progressive 8-bit 4:2:0, decode 4:0:0 to 4:4:4 at 8 to 10 bits and lossless, encoder checkpoints for editing
- H.265
- encode + decode, Main, Main 10 and range extensions, alpha layers
- ProRes
- decode, 422 and 4444/XQ with alpha
- VP9
- decode, profiles 0–3, alpha streams; encode, profile 0 with alpha
- AV1
- decode, profiles 0–2 at 8 to 12 bits, identical to dav1d on 11 libaom, SVT-AV1 and rav1e test streams, in 1.36× its time on one core; encode to MP4, its qp on H.264's scale, and against v0.0.22 at equal PSNR 13.3% fewer bits on 1080p camera footage (in about 40% more time) and 27.6% on a motion-graphics clip; hardware decode through Vulkan Video
Audio
- AAC-LC
- encode + decode, 1 to 8 channels
- Opus
- decode: SILK, hybrid, CELT, loss concealment, FEC, DTX, surround; encode, CELT only (music): against libopus's CELT-only encoder, the same rate and 0 to 0.03 dB higher SNR from 32 to 192 kb/s, in about its cycles on one core
- FLAC
- 4 to 32 bits
- ALAC
- decode, 16, 20, 24 and 32 bits, 1 to 8 channels
- MP3
- MPEG-1/2/2.5 Layer III
- Vorbis
- decode
Images
- WebP
- lossy, lossless, alpha and animation to RGBA8
- JPEG
- baseline and progressive, identical to libjpeg-turbo
- GIF
- the first frame, or the animation composited as browsers show it
- PNG
- decode + write
- BMP · TGA · QOI
- decode to RGBA8
- Radiance HDR
- decode to linear f32
Containers
- MP4 / MOV
- read (fragmented MP4 too) + write
- WebM / Matroska
- read, and VP9 WebM write with alpha and Opus sound
- Ogg
- for Ogg Opus and Ogg Vorbis
- WAV
- WAV, RF64 and RIFX read, 16-bit PCM and float write
Some packages are ported from permissively licensed projects (libopus, libwebp, Apple ALAC, minimp3, PDMP3, gen2brain/h265, oxideav-h265, Kvazaar, OpenH264); their notices are kept beside the code.
Use it
import video "deps:oicut/video" // -collection:deps=.. (the directory holding oicut)
config := video.default_writer_config(1920, 1080, 30000, 1001) // qp 23, faststart
config.codec = .H264 // or .H265
config.sample_rate, config.channels = 48000, 2
w: video.Writer
err := video.create(&w, "out.mp4", config) // or create_stream
err = video.write_audio(&w, pcm) // any amount, any time
for frame in frames do err = video.write_frame(&w, frame.rgba, frame.width * 4)
err = video.finish(&w)
video.destroy(&w)r: video.Reader
err := video.open_reader(&r, "in.mov", {preference = .Native}) // or open_reader_stream
// r.video: codec, width, height, frame_count, fps_num/den, duration, rotation,
// color, has_alpha, bit_depth, chroma
// r.audio: codec, present, sample_rate, channels, samples
for {
f, e := video.next_frame(&r) // sequential playback
if e == .End_Of_Stream do break
// f.rgba (borrowed until the next call), f.pts, f.time, f.index
}odin build viewer -o:speed && ./viewer.bin FILEThe family
- ocurves
Curve geometry: exact pixel coverage, and booleans that keep their curves
- ovg
2D vector graphics: paths, SVG, Lottie, text, filters
- oglyph
Fonts and OpenType text shaping, checked against HarfBuzz
- oicut
Video, audio and image codecs with no FFmpeg
- oksl
SkSL and Shadertoy shaders to SPIR-V, MSL and CPU
- o3d
3D in three.js terms, on the GPU or the CPU
- ottis
Text to speech with a time for every word
- odawg
Music from songs as data: synths, sampled instruments, an 808, a 909 and a 303, mixed and mastered
- onimite
Videos from Lua scripts, written by you or your coding agent