Skip to content
QuaLix

QuaLix

A video codec for game cutscenes and transparent effects.

Encode lossless RGBA or set a target bitrate for SDR and 10-bit PQ/HLG video. The same decoder plays your clips on the web, in native apps, and in Cocos, Godot, and Unity.

A folded blue Q with a play triangle cut into its center

One QLX clip, decoded live in WebAssembly

Switch the language tab or choose Lossless q0, Perceptual VBR, or Strict CBR, then click Decode & Play.

Example source language
import { inspectQuaLix, openQuaLix, QLX_MIME_TYPE } from '@quajs/qualix'
import { QuaLixCanvasPlayer } from '@quajs/qualix/web'

export async function mountClip(canvas: HTMLCanvasElement, url: string) {
  const bytes = new Uint8Array(await (await fetch(url)).arrayBuffer())
  const header = inspectQuaLix(bytes)
  console.log(`${QLX_MIME_TYPE} ${header.width}x${header.height} @ ${header.fps.toFixed(2)} fps`)

  const clip = await openQuaLix(bytes)
  const first = clip.decode(0)
  console.log(`frame 0 rows [${first.firstRow}, ${first.endRow}) (${first.pixels.byteLength} bytes)`)
  clip.close()

  return await QuaLixCanvasPlayer.create(canvas, bytes, {
    loop: true,
    pauseWhenHidden: true,
  })
}
use qualix::{ClipInfo, Color, DEFAULT_BUDGET, Decoder};
use std::fs::File;
use std::io::BufReader;

fn main() -> std::io::Result<()> {
    let file = BufReader::with_capacity(64 * 1024, File::open("opening.qlx")?);
    let mut decoder = Decoder::open(file, DEFAULT_BUDGET)?;
    let info: ClipInfo = decoder.info();

    let mut hash: u64 = 14695981039346656037;
    for index in 0..info.frames {
        let frame = decoder.decode(index)?;
        if info.color == Color::Srgb8 {
            for &byte in &frame.pixels[frame.dirty_rows.start as usize * info.width as usize * 4
                ..frame.dirty_rows.end as usize * info.width as usize * 4]
            {
                hash = (hash ^ u64::from(byte)).wrapping_mul(1099511628211);
            }
        }
    }
    println!(
        "{}x{} frames={} key_interval={} dirty_hash={:016x}",
        info.width, info.height, info.frames, info.key_interval, hash
    );
    Ok(())
}
WebAssembly decoder & canvas preview
Encoding profile
QLX · 1,382,400 B → 99,325 B 13.9× · Exact RGBA
QLX · 1,382,400 B → 19,939 B 69.3× · Adaptive VBR
QLX · 1,382,400 B → 35,000 B 39.5× · Fixed Packet CBR
WASM frame decoding requires JavaScript. Ready to decode in WASM