pupil_recording_interface.VideoStream
- class pupil_recording_interface.VideoStream(device, pipeline=None, name=None, color_format='bgr24', side='both')
Bases:
pupil_recording_interface.stream.BaseStream
Video stream.
- __init__(device, pipeline=None, name=None, color_format='bgr24', side='both')
Constructor.
- Parameters
device (BaseVideoDevice) – The device producing the stream.
name (str, optional) – The name of the stream. If not specified, device.device_uid will be used.
color_format (str, default 'bgr24') – The target color format. Set to ‘gray’ for eye cameras.
side (str, default 'both') – For stereo cameras, which side to record. Can be ‘left’, ‘right’ or ‘both’.
Methods
Config
(*args, **kwargs)Configuration for this class.
__init__
(device[, pipeline, name, …])Constructor.
from_config
(config[, device, folder])Create a stream from a StreamConfig.
Get the last data packet from the stream.
get_status
([packet])Get information about the stream status.
run
()Main loop.
run_in_thread
([stop_event, status_queue, …])Main loop for running in a dedicated thread.
Run hook(s) after processing thread(s) finish(es).
Run hook(s) before dispatching processing thread(s).
start
([allow_failure])Start the stream.
stop
()Stop the stream.
Attributes
Current average fps.
listen_for
stream_type
- classmethod Config(*args, **kwargs)
Configuration for this class.
- property current_fps
Current average fps.
- classmethod from_config(config, device=None, folder=None)
Create a stream from a StreamConfig.
- get_packet()
Get the last data packet from the stream.
- get_status(packet=None)
Get information about the stream status.
- run()
Main loop.
- run_in_thread(stop_event=None, status_queue=None, notification_queue=None, priority_queue=None)
Main loop for running in a dedicated thread.
- Parameters
stop_event (multiprocessing.Event, optional) – An event that stops the stream in a multi-threaded setting.
status_queue (thread safe deque, optional) – A queue for the current status in a multi-threaded setting.
notification_queue (thread safe deque, optional) – A queue for incoming notifications in a multi-threaded setting.
priority_queue (thread safe deque, optional) – A queue for incoming priority notifications in a multi-threaded setting.
- run_post_thread_hooks()
Run hook(s) after processing thread(s) finish(es).
- run_pre_thread_hooks()
Run hook(s) before dispatching processing thread(s).
- start(allow_failure=False)
Start the stream.
- stop()
Stop the stream.