Caution
This package is at a very early development stage. Expect major API changes!
A decoder for .bik video files that can be used to play or transcode videos.
- Supports Bink 1, revisions
ctoiinclusive - Handles demuxing and decompression of audio and video streams
- TypeScript/JavaScript only (no WASM or native code)
- Uses Web Streams API for efficient reading of video files
- Isomorphic
- runs on client/server runtimes that support at least ES2022
- can be run with older runtimes by using the syntax lowering feature of some bundlers
- No support for Bink 2 or for revision
bof Bink 1 - Some image corruption has been observed for a small proportion of videos
To install the decoder:
npm install unbikitTo use it:
import { BikDecoder, type BikFrame } from "unbikit";
let stream: ReadableStream;
// ... assign a source to the stream
const decoder = await BikDecoder.open(() => stream);
let frame: BikFrame | null;
while ((frame = await decoder?.getNextFrame())) {
// ... process frame
}TODO: Add more installation instructions and more detailed usage instructions/examples
This section is intended for code contributors to this project.
First, ensure that you have pnpm and Node.js installed in your development environment.
To install dependencies:
pnpm installTo run linting/formatting/type-checking:
pnpm checkTo build for production:
pnpm buildTo build and view the documentation:
pnpm build:docs
pnpm preview:docsVerification is performed by the CI flow for all pull requests before they can be merged to the main branch. Commit logs are checked for Conventional Commits compliance as part of this flow.
Sources of reference material about decoding the .bik format:
- MultimediaWiki pages on the file format
- Kostya's Boring Codec World
- libav (see the FFmpeg website)
- Wikipedia for information about various mathematical transformations
- related research papers on efficient algorithm implementations (searchable online):
- Arai-Agui-Nakajima (AAN) IDCT algorithm
- Cooley-Tukey FFT algorithm for IRDFT
- Byeong Gi Lee (1984) IDCT algorithm
This software is distributed under Apache License (Version 2.0) or MIT License terms, at your option.
See LICENSE for details.
SPDX-License-Identifier: MIT OR Apache-2.0
The .bik file format is a proprietary format used by
Bink Video, developed by
Epic Games Tools (formerly RAD Game Tools).
The redistribution of Bink Video files may require an additional license from
Epic Games Tools. More information can be found in their
Bink FAQ.