pliers.stimuli.VideoStim

class pliers.stimuli.VideoStim(filename=None, onset=None, url=None, clip=None)[source]

Bases: VideoFrameCollectionStim

A video.

Parameters
  • filename (str) – Path to input file, if one exists.

  • onset (float) – Optional onset of the video file (in seconds) with respect to some more general context or timeline the user wishes to keep track of.

  • url (str) – Optional url source for a video.

  • clip (VidoFileClip) – Optional moviepy VideoFileClip to initialize from.

__init__(filename=None, onset=None, url=None, clip=None)[source]
get_bytestring(encoding='utf-8')[source]

Return the video data as a bytestring.

Parameters

encoding (str) – Encoding to use. Defaults to utf-8.

Returns: A string.

get_filename()

Return the source filename of the current Stim.

get_frame(index=None, onset=None)[source]

Overrides the default behavior by giving access to the onset argument.

Parameters
  • index (int) – Positional index of the desired frame.

  • onset (float) – Onset (in seconds) of the desired frame.

property history

Return stimulus history.

save(path)

Save source video to file.

Parameters

path (str) – Filename to save to.

Notes: Saves entire source video to file, not just currently selected

frames.