nemo_curator.utils.nvcodec_utils
Module Contents
Classes
Functions
Data
API
Bases: enum.Enum
Policy for extracting frames from video, supporting full extraction or FPS-based sampling.
This enum defines the available strategies for frame extraction from video content.
Low-level NVIDIA hardware-accelerated video decoder.
This class provides direct access to NVIDIA’s hardware video decoding capabilities, handling frame decoding and memory management for video processing pipelines.
Generate decoded frames from the video.
Returns: list[torch.Tensor]
List of decoded frames as tensors.
Get the next frames from the video.
Returns: torch.Tensor | None
Next frames from the video as a tensor.
High-level frame extraction interface using PyNvVideoCodec.
This class provides a simplified interface for extracting frames from videos using hardware acceleration, supporting both full extraction and FPS-based sampling.
Extract frames from the video.
Parameters:
Path to the video file to process.
Policy for extracting frames.
Sampling rate for FPS-based extraction.
Returns: torch.Tensor
List of decoded frames as tensors.
GPU-accelerated video decoder that processes video frames in batches.
This class handles video decoding using NVIDIA hardware acceleration, supporting batch processing of frames with color space conversion and resizing capabilities.
Process video frames in batches using GPU acceleration.
Parameters:
Path to the video file to process.
Returns: torch.Tensor | None
Processed video frames as a tensor.
Get the frame rate of the video.
Returns: int | None
Frame rate of the video.
Decode video frames for stitching using GPU acceleration.
Parameters:
GPU device ID.
CUDA context.
CUDA stream.
Path to the video file to process.
List of frame indices to decode.
Number of frames to process in each batch.
Returns: list[torch.Tensor]
List of decoded frames as tensors.