ibllib.io.deprecated.video

Functions for fetching video frames, meta data and file locations

Functions

get_video_meta

Return a bunch of video information with the fields (‘length’, ‘fps’, ‘width’, ‘height’, ‘duration’, ‘size’)

label_from_path

Return the video label, i.e. ‘left’, ‘right’ or ‘body’.

url_from_eid

Return the video URL(s) for a given eid

Classes

VideoStreamer

Provides a wrapper to stream a video from a password protected HTTP server using opencv

class VideoStreamer(url_vid)[source]

Bases: object

Provides a wrapper to stream a video from a password protected HTTP server using opencv

get_frame(frame_index)[source]
get_video_meta(video_path, one=None)[source]

Return a bunch of video information with the fields (‘length’, ‘fps’, ‘width’, ‘height’, ‘duration’, ‘size’)

Parameters
  • video_path – A path to the video. May be a file path or URL.

  • one – An instance of ONE

Returns

A Bunch of video mata data

url_from_eid(eid, label=None, one=None)[source]

Return the video URL(s) for a given eid

Parameters
  • eid – The session id

  • label – The video label (e.g. ‘body’) or a tuple thereof

  • one – An instance of ONE

Returns

The URL string if the label is a string, otherwise a dict of urls with labels as keys

label_from_path(video_name)[source]

Return the video label, i.e. ‘left’, ‘right’ or ‘body’

Parameters

video_name – A file path, URL or file name for the video

Returns

The string label or None if the video doesn’t match