stytra.hardware.video package¶
Subpackages¶
Submodules¶
stytra.hardware.video.ring_buffer module¶
stytra.hardware.video.write module¶
-
class
stytra.hardware.video.write.
VideoWriter
(input_queue, finished_signal, saving_evt, log_format='hdf5')[source]¶ Bases:
stytra.utilities.FrameProcess
Writes behavior movies into video files using PyAV
- Parameters
folder – output folder
input_queue – queue of incoming frames
finished_signal – signal to finish recording
kbit_rate – ouput movie bitrate
Module contents¶
Module to interact with video surces as cameras or video files. It also implement video saving
-
class
stytra.hardware.video.
VideoSource
(rotation=False, max_mbytes_queue=200, n_consumers=1)[source]¶ Bases:
stytra.utilities.FrameProcess
Abstract class for a process that generates frames, being it a camera or a file source. A maximum size of the memory used by the process can be set.
Input Queues:
- self.control_queue :
queue with control parameters for the source, e.g. from a
CameraControlParameters
object.
Output Queues
- self.frame_queue :
TimestampedArrayQueue from the arrayqueues module where the frames read from the camera are sent.
Events
- self.kill_signal :
When set kill the process.
- Parameters
rotation (int) – n of times image should be rotated of 90 degrees
max_mbytes_queue (int) – maximum size of camera queue (Mbytes)
-
class
stytra.hardware.video.
CameraSource
(camera_type, *args, downsampling=1, roi=(-1, -1, -1, -1), max_buffer_length=1000, camera_params={}, **kwargs)[source]¶ Bases:
stytra.hardware.video.VideoSource
Process for controlling a camera.
Cameras currently implemented:
Ximea
Add some info
Avt
Add some info
- Parameters
camera_type (str) – specifies type of the camera (currently supported: ‘ximea’, ‘avt’)
downsampling (int) – specifies downsampling factor for the camera.
-
class
stytra.hardware.video.
VideoFileSource
(source_file=None, loop=True, **kwargs)[source]¶ Bases:
stytra.hardware.video.VideoSource
A class to stream videos from a file to test parts of stytra without a camera available, or do offline analysis
- Parameters
source_file – path of the video file
loop (bool) – continue video from the beginning if the end is reached
-
class
stytra.hardware.video.
VideoControlParameters
(**kwargs)[source]¶ Bases:
lightparam.param_qt.ParametrizedQt
-
class
stytra.hardware.video.
CameraControlParameters
(**kwargs)[source]¶ Bases:
lightparam.param_qt.ParametrizedQt
HasPyQtGraphParams class for controlling the camera params. Ideally, methods to automatically set dynamic boundaries on frame rate and exposure time can be implemented. Currently not implemented.