Recording unifi_video.recording

class unifi_video.recording.UnifiVideoRecording(api, data=None)[source]

Bases: unifi_video.single.UnifiVideoSingle

Recording container

Variables:
  • _id (str) – Recording ID (MongoDB ObjectID as hex string)
  • start_time (datetime) – Recording start time and date (local time)
  • end_time (datetime) – Recording end time and date (local time)
  • start_time_utc (datetime) – Recording start time and date (UTC)
  • end_time_utc (datetime) – Recording end time and date (UTC)
  • rec_type (str) – Recording type. Either motionRecording, or fullTimeRecording.
  • locked (bool, NoneType) – Whether or not recording is locked
  • in_progress (bool, NoneType) – Recording is in progress
  • marked_for_deletion (bool, NoneType) – Recording is marked for deletion
  • cameras (list) – List of camera IDs
delete()[source]

Delete recording

download(filename=None)[source]

Download recording

Parameters:filename (str, NoneType, bool) – Filename (str) to save the image as or True (bool) if you want the response body as a return value. You can also leave this out or set it to None or False and a filename will be generated for you.
Return value:

Depends on input params.

  • When filename is str, NoneType or False: True if write to file was successful, otherwise NoneType
  • When filename is True: raw response body (str)
motion(filename=None)[source]

Download recording motion

Parameters:filename (str, NoneType, bool) – Filename (str) to save the image as or True (bool) if you want the response body as a return value. You can also leave this out or set it to None or False and a filename will be generated for you.
Return value:

Depends on input params.

  • When filename is str, NoneType or False: True if write to file was successful, otherwise NoneType
  • When filename is True: raw response body (str)
snapshot(width=600, filename=None)[source]

Download recording thumbnail

Parameters:
  • width (int) – Image pixel width
  • filename (str, NoneType, bool) – Filename (str) to save the image as or True (bool) if you want the response body as a return value. You can also leave this out or set it to None or False and a filename will be generated for you.
Return value:

Depends on input params.

  • When filename is str, NoneType or False: True if write to file was successful, otherwise NoneType
  • When filename is True: raw response body (str)