PngSource

Inheritance diagram of PngSource

PngSource inheritance diagram

class savant.client.PngSource(source_id, file, pts=0, framerate=(30, 1), updates=None)

Frame source for PNG files.

Parameters:
  • source_id (str) – Source ID.

  • file (str | PathLike | BinaryIO) – Path to a PNG file or a file handle to a PNG file opened as binary.

  • pts (int) – Frame presentation timestamp.

  • framerate (Tuple[int, int]) – Framerate (numerator, denominator).

  • updates (List[VideoFrameUpdate] | None) – List of frame updates.

build_frame()

Build a frame.

Returns:

A tuple of a frame metadata and its content.

Return type:

Tuple[VideoFrame, bytes]

property duration: int

Frame duration.

property filepath: str | PathLike | None

Path to a JPEG file.

property framerate: Tuple[int, int]

Framerate.

property pts: int

Frame presentation timestamp.

property source_id: str

Source ID.

property updates: List[VideoFrameUpdate]

List of frame updates.

with_framerate(framerate)

Set framerate.

with_pts(pts)

Set frame presentation timestamp.

with_update(update)

Apply an update to a frame.