pupil_recording_interface.VideoRecorder

class pupil_recording_interface.VideoRecorder(folder, resolution, fps, name=None, encode_every=1, backend='ffmpeg', color_format='bgr24', codec='libx264', encoder_kwargs=None, source_timestamps=True, **kwargs)

Bases: pupil_recording_interface.process.recorder.BaseRecorder

Recorder for a video stream.

__init__(folder, resolution, fps, name=None, encode_every=1, backend='ffmpeg', color_format='bgr24', codec='libx264', encoder_kwargs=None, source_timestamps=True, **kwargs)

Constructor.

Parameters
  • folder (str) – Path to the recording folder.

  • resolution (tuple, len 2) – Resolution of the recorded video.

  • fps (int) – Frame rate of the recorded video.

  • name (str, optional) – The name of the recorder. If not specified, device.device_uid will be used.

  • encode_every (int, default 1) – Only encode every Nth frame. By default, all frames are encoded.

  • color_format (str, default 'bgr24') – The target color format. Set to ‘gray’ for eye cameras.

  • codec (str, default 'libx264') – The desired video codec.

  • encoder_kwargs (dict) – Addtional keyword arguments passed to the encoder.

Methods

Config(*args, **kwargs)

Configuration for this class.

__init__(folder, resolution, fps[, name, …])

Constructor.

from_config(config, stream_config, device, …)

Create a process from a ProcessConfig.

process(packet, notifications)

Process new data.

process_notifications(notifications)

Process new notifications.

process_packet(packet)

Process a new packet.

start()

Start the process.

stop()

Stop the recorder.

write(frame, timestamp, source_timestamp)

Write data to disk.

Attributes

process_type

classmethod Config(*args, **kwargs)

Configuration for this class.

classmethod from_config(config, stream_config, device, **kwargs)

Create a process from a ProcessConfig.

process(packet, notifications)

Process new data.

process_notifications(notifications)

Process new notifications.

process_packet(packet)

Process a new packet.

start()

Start the process.

stop()

Stop the recorder.

write(frame, timestamp, source_timestamp)

Write data to disk.