weldx.util.media_file.MediaFile#

class weldx.util.media_file.MediaFile(path_or_array, reference_time=None, fps=None)#

Encapsulates a media file, like video or image stacks making them accessible.

The underlying images are encapsulated to be loaded lazily (via Dask) and can be accessed by a time coordinate in case of videos.

Parameters:
  • path_or_array (Union[str, Path, DataArray, ndarray, list, tuple]) – Path pointing towards a video, or tiff stack. If an array is given, it will be treated as a video.

  • reference_time (Optional[Timestamp]) – A reference time, when this media was recorded. Useful, when passing arrays.

  • fps (Optional[float]) – Frames per second in case of a video. Has to be passed in case path_or_array was given as list of frames.

Methods

file

File reference to underlying file/directory.

Attributes

attrs

Video attributes.

data

Get underlying DataArray.

duration

In case of time-dynamic data, return its duration.

fps

Frames per second.

from_file

Initialized from file or not?

reference_time

Time of recording of this media (if known).

resolution

Resolution in pixels (widths, height).