stytra.hardware.video package¶
Subpackages¶
- stytra.hardware.video.cameras package
- Submodules
- stytra.hardware.video.cameras.abstract_class module
- stytra.hardware.video.cameras.avt module
- stytra.hardware.video.cameras.mikrotron module
- stytra.hardware.video.cameras.opencv module
- stytra.hardware.video.cameras.spinnaker module
- stytra.hardware.video.cameras.ximea module
- Module contents
Submodules¶
stytra.hardware.video.ring_buffer module¶
stytra.hardware.video.write module¶
-
class
stytra.hardware.video.write.
VideoWriter
(folder, input_queue, finished_signal, saving_evt, format='hdf5', kbit_rate=4000)[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=100, 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), **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.