pliers.stimuli.VideoFrameCollectionStim

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

Bases: Stim

A collection of video frames.

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

  • frame_index (list) – List of indices of frames retained from the original video. Uses every frame by default (i.e. for normal VideoStims).

  • 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, frame_index=None, onset=None, url=None, clip=None)[source]
get_filename()

Return the source filename of the current Stim.

get_frame(index)[source]

Get video frame at the specified index.

Parameters

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

property history

Return stimulus history.

save(path)[source]

Save source video to file.

Parameters

path (str) – Filename to save to.

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

frames.