Docs /Templates/ sinapsis-data-readers

MultiVideoReaderFFMPEG

sinapsis-data-readerscommunity

Python template · sinapsis_data_readers.templates.video_readers.video_reader_ffmpeg

Overview

Template to read multiple videos using the FFMPEG library, This template expands the functionality of VideoReaderFFMPEG where video_file_path is a list of paths instead of a single string. For each of the video_file_path it creates a new instance of the video reader and appends each frame to the ImagePacket list in DataContainer, Attributes for the MultiVideoReaderBase video_file_path (list[str] | str): path or list of paths to the video(s) interleaved (bool): Whether to load the videos interleaving them parallel_exec (bool): Whether to load the frames of the videos

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-data-readers==1.0.0
uv pip install sinapsis-data-readers==1.0.0
uv add sinapsis-data-readers==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

device
typing.Literal['cpu', 'gpu']
Optional
Default: "cpu"
metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
root_dir
str | None
Optional
Default: null
batch_size
int
Optional
Default: 1
interleaved

Whether to load the videos interleaving them

bool
Optional
Default: false
loop_forever
bool
Optional
Default: false
video_source
int | str | None
Optional
Default: "836c104a-f9c8-4ee5-865c-e96f413a0b21"
parallel_exec

Whether to load the frames of the videos

bool
Optional
Default: false
video_file_pathRequired

path or list of paths to the video(s)

str | list[str]
Required
Default: null

Configuration example

Generated from documented defaults. Replace any placeholders and complete required nested settings before running.

yaml
templates:
  - template_name: "MultiVideoReaderFFMPEG"
    class_name: "MultiVideoReaderFFMPEG"
    attributes:
      device: "cpu"
      root_dir: null
      batch_size: 1
      interleaved: false
      loop_forever: false
      video_source: "836c104a-f9c8-4ee5-865c-e96f413a0b21"
      parallel_exec: false
      video_file_path: "<required>"

Inheritance

Immediate parent: sinapsis_data_readers.templates.video_readers.base_video_reader.MultiVideoReaderBase

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.