--- id: decord2 version: "3.4.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # decord2 — Decord2 is a high-performance, efficient video decoding and loading library for deep learning research, featuring smart shuffling, random frame access, GPU acceleration, and seamless integration with popular frameworks. License: permissive · Maintenance: active · Downloads: 613.1K/mo ## What it is and what it does Decord2 is a video and audio decoding library optimized for deep learning pipelines. It wraps hardware-accelerated decoders (FFMPEG, NVIDIA NVDEC, Intel codecs) to provide efficient random frame access and batch loading—operations that are typically slow in standard video libraries. The library handles the awkward seeking patterns common during neural network training by using smart shuffling and caching strategies to minimize redundant decoding. The package provides three main interfaces: VideoReader for direct frame access from files, VideoLoader for training-scale batch loading across many video files, and AudioReader for audio extraction. It also offers AVReader to decode video and audio simultaneously with frame-level synchronization. Runtime dependency is numpy; GPU acceleration requires building from source with CUDA. Use it for: - Load random frames from videos during deep learning training without expensive seeks or redundant decoding. - Batch-load frames from multiple video files with configurable shuffling strategies for efficient data pipeline. - Extract synchronized audio and video samples from media files for multimodal model training. - Decode audio from video files at custom sample rates and channel layouts for audio processing tasks. - Stream video frames in-memory from file-like objects for cloud or streaming scenarios. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Decord2 decodes video and audio files with hardware acceleration, providing efficient random frame access and batch loading for deep learning workflows. Yes, with conditions. Install if you need efficient random video frame access for deep learning and can tolerate medium setup friction. Prebuilt wheels work out-of-the-box for CPU use on recent Python versions, but GPU acceleration requires source compilation. Active maintenance, no known vulnerabilities, and permissive licensing make it safe to adopt. Skip if your workload is sequential video playback or if building from source is not feasible. ## Install pip install decord2 uv add decord2 poetry add decord2 ## Installing decord2 Before you install: Medium install friction: prebuilt wheels available for recent Python versions (3.10–3.14) on Linux, macOS, and Windows, but GPU acceleration requires building from source with CUDA/compiler toolchain. Active maintenance with recent commits. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions; attribution required. Quickstart: pip install decord2 from decord import VideoReader, cpu vr = VideoReader('video.mp4', ctx=cpu(0)) frames = vr.get_batch([0, 5, 10]) print(frames.shape) PYPI wheels are CPU-only; GPU acceleration (NVIDIA NVDEC, Intel codecs) requires building from source with appropriate compiler and CUDA toolkit. Requires Python >=3.9.0. Verify before relying: - Whether Intel codec support is production-ready or still in development - Performance benchmarks against other video loaders for typical deep learning workloads - Audio-video synchronization accuracy and latency characteristics - Memory overhead of batch loading and internal frame caching strategies ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 613.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags video decoding for deep learning, random frame access video, GPU accelerated video loader, efficient video shuffling, batch video frame extraction, audio video synchronized decoding, FFMPEG hardware acceleration, video dataset loading, video-decoding, deep-learning-data, gpu-acceleration [View on SkillFed](https://skillfed.io/packages/decord2) · [View on PyPI](https://pypi.org/project/decord2/)