components.io.rawfilereader

class RawFileReader(config={}, **kwds)[source]

Bases: pyctools.core.base.Component

Read “raw” YUV or RGB files.

RawFileReader has been superseded by VideoFileReader2.

Video is usually stored in file formats (such as AVI) with a complex structure to allow a mix of audio, video and other data. These can be read with the VideoFileReader component.

This component reads simple “raw” files that contain nothing but the picture data. Even the image dimensions have to be stored in a separate “metadata” file. (Use the pyctools-setmetadata tool to create or modify the metadata file.)

There are many possible arrangements of data in raw files. For example, the colour components can be packed (multiplexed) together or stored in separate planes. The formats are labelled with a short string knows as a fourcc code. This code needs to be in the metadata file with the image dimensions.

Note that when reading “YUV” formats the U & V outputs are offset by 128 to restore their range to -128..127 (from the file range of 0..255). This makes subsequent processing a lot easier.

The zperiod config item can be used to adjust the repeat period so it is an integer multiple of a chosen number, e.g. 4 frames for a PAL encoded sequence. It has no effect if looping is not repeat.

Config

path

str

Path name of file to be read.

looping

str

Whether to play continuously. Can be 'off', 'repeat' or 'reverse'.

noaudit

bool

Don’t output file’s “audit trail” metadata.

zperiod

int

Adjust repeat period to an integer multiple of zperiod.

outputs = ['output_Y_RGB', 'output_UV']

Comments or questions? Please email jim@jim-easterbrook.me.uk.