libmedia Documentation

repository·master·Indexed 18 days ago

https://github.com/zhaohappy/libmedia

A high-performance multimedia processing library for the Web using a hybrid TypeScript and WebAssembly architecture. It provides FFmpeg-like APIs for muxing, demuxing, encoding, decoding, and rendering. Key modules include avcodec (Wasm and WebCodecs), avformat, avrender (WebGL/WebGPU), and avnetwork (Fetch, WebSocket, WebTransport). It supports various formats like MP4, FLV, and Matroska, and protocols including HLS, DASH, RTMP, and RTSP.

Tokens
75.1K
Snippets
231
Records
332
Agent score
57%

What's inside libmedia

  1. Overview of libmedia

    master

    libmedia is a multimedia processing library designed for Web platforms. It enables handling of audio, video, and subtitles directly in the client environment.

    Key capabilities include:

    • Cross-platform compatibility: Works in mainstream browsers, mobile environments, Electron, and Node.js.
    • Client-side processing: Most computations run on the client, reducing server costs and enhancing privacy by keeping user data local.
    • High performance: Designed with multi-threading and zero-copy overhead. It features negligible interoperability overhead with Wasm modules and supports WebCodecs for hardware acceleration.
    • Extensibility: Provides low-level APIs for custom complex logic, alongside high-level, out-of-the-box tools like players and transcoders.
  2. Overview of @libmedia/avcodec

    master

    The @libmedia/avcodec package is an audio/video codec library. It provides access to codecs through two primary implementations:

    1. Wasm-based codecs: Compiled from C/C++ sources, including FFmpeg and other specialized codec projects, optimized for WebAssembly environments.
    2. WebCodecs: Standard Web platform APIs for high-performance hardware-accelerated decoding and encoding.

    This package allows developers to handle media encoding and decoding tasks in web environments using either highly compatible software codecs (via Wasm) or native browser capabilities (via WebCodecs).

  3. Overview of libmedia audio/video rendering capabilities

    master

    The @libmedia/avrender package provides high-performance audio and video rendering capabilities. It supports various bit depths and high dynamic range formats, as well as modern web-based rendering technologies.

    Supported features include:

    • Video Rendering: 8-bit, 10-bit, and HDR support.
    • Web Technologies: WebGL and WebGPU rendering engines.
    • Audio Rendering: audioWorklet support for low-latency audio processing.
  4. Overview of @libmedia/avnetwork

    master

    The @libmedia/avnetwork package provides network-related file I/O capabilities for the libmedia Web platform. It is designed to handle various data transport and file access methods required for media processing in a web environment.

    Supported I/O mechanisms include:

    • Fetch: Standard HTTP/HTTPS requests.
    • WebSocket: Full-duplex communication channels.
    • WebTransport: Modern, low-latency transport protocol.
    • File: Local file system access.