Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Environment:NVIDIA DALI FFmpeg Environment

From Leeroopedia


Knowledge Sources
Domains Infrastructure, Video_Processing
Last Updated 2026-02-08 16:00 GMT

Overview

FFmpeg 8.0.1 environment for video preprocessing (scene splitting, transcoding) required by DALI video processing pipelines.

Description

This environment provides the FFmpeg CLI tool required for preprocessing video data before feeding it into DALI video pipelines. DALI builds a custom, minimal FFmpeg (`dali-ffmpeg` conda package, version 8.0.1) tailored specifically for video decoding needs. The FFmpeg environment is used to split videos into scene segments and transcode them to a consistent resolution before the DALI `fn.readers.video` operator reads them.

Usage

Use this environment for video data preparation workflows. It is the mandatory prerequisite for the FFmpeg_Scene_Processing implementation, which performs scene detection and multi-resolution transcoding as a pre-processing step before DALI video pipelines run.

System Requirements

Category Requirement Notes
OS Linux FFmpeg CLI must be in PATH
Hardware CPU (GPU optional for NVDEC) CPU transcoding is default; NVDEC available if GPU present
Disk 10GB+ For intermediate video files during transcoding

Dependencies

System Packages

  • `ffmpeg` >= 4.0 (DALI builds custom `dali-ffmpeg` 8.0.1)
  • `libvorbis` = 1.3.7 (for audio codec support)

Python Packages

  • `ffmpeg-python` >= 0.2.0 (optional Python wrapper for FFmpeg CLI)

Credentials

No credentials required.

Quick Install

# Install FFmpeg (system)
apt-get install -y ffmpeg

# Or via conda (DALI's custom build)
conda install -c nvidia dali-ffmpeg

# Install Python wrapper (optional)
pip install ffmpeg-python>=0.2.0

# Verify
ffmpeg -version

Code Evidence

FFmpeg scene processing from `docs/examples/sequence_processing/video/superres_pytorch/prepare_data.sh:1-16`:

#!/bin/bash
# Scene splitting and transcoding for DALI video reader
for file in "$INPUT_DIR"/*.mp4; do
    # Split by scene detection
    ffmpeg -i "$file" -filter:v "select='gt(scene,0.4)'" -vsync vfr "$OUTPUT_DIR/scene_%04d.mp4"
    # Transcode to consistent resolution
    ffmpeg -i "$file" -vf scale=256:256 -c:v libx264 "$OUTPUT_DIR/resized.mp4"
done

Custom FFmpeg conda build from `conda/third_party/dali_ffmpeg/recipe/meta.yaml:1-39`:

package:
  name: dali-ffmpeg
  version: '8.0.1'
# Builds minimal FFmpeg tailored for DALI's video decoding needs

Common Errors

Error Message Cause Solution
`ffmpeg: command not found` FFmpeg not installed or not in PATH `apt-get install ffmpeg` or install via conda
`Unknown encoder 'libx264'` FFmpeg built without H.264 support Reinstall FFmpeg with `--enable-libx264`
`Scene detection produces too many/few segments` Scene threshold too low/high Adjust `scene` filter threshold (default 0.4)

Compatibility Notes

  • DALI Custom FFmpeg: DALI builds its own minimal FFmpeg (8.0.1) via conda. This is optimized for video decoding and may lack some codecs present in system FFmpeg.
  • libvorbis: Pinned to exact version 1.3.7 for audio processing compatibility.
  • NVDEC: When an NVIDIA GPU is available, DALI's `fn.readers.video` uses hardware-accelerated video decoding via NVDEC, bypassing FFmpeg for the decoding step.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment