Package: python-recorder
python-recorderDevice independent framework for synchronized recording. Originally designed to
record audio and video from a Realsense camera and several microphones. This
framework is designed for researchers collecting multimodal datasets. It
provides an easy to use command line application that allows to configure, test and
use the available sensors in the host machine while providing intuitive mechanisms
to synchronize the recording devices with the specific event that one wants to record.
The framework can be divided in two main features:DevicesThey provide a common interface to initialize,startandstopa recording,
whether is a camera, a microphone or any other sensor. When the recording is
stopped, device parameters (e.g.,sampleratein microphones,frameratein
cameras) as well as astart_timestampand anend_timestampare saved
together with the recorded data which allows fine synchronization of data from
multiple devices in post-processing.Devices are configurable through a command line application, which searches for
available options in the host machine. At the same time, they are saved in ayamlformatted text file. Which allows easy access
to device exclusive configuration parameters.Multiple devices compose aRecorderobject, which
is responsible for initializing all its devices, setup an output folder for the
recordings, and start and stop the recording.Adding new devices classes is simple, one just needs to extend theDeviceclassand override its abstract methods (find,_start,_stopandshow_results).ListenersResearchers usually want to synchronize the recording with a specific event, a
test or experiment, which can be triggered by a different machine. AListeneris an interface between aRecorderand an external event. At the moment, the
only one available is aLocalhostlistener. Which triggers the recording
according toGETrequests through the local network. But additional listeners
can be added by extending theListenerclassand overriding its abstract methods. An
example of another listener would be aROSnode that subscribes to a specific
topic and triggers the recording according to a specific set of messages.Listeners can be setup through thelistencommand. This command does not initialize
the devices. The listener is responsible of executingrecorder.setup()as it
sees fit. In the case of thelocalhostlistener, aGETrequest to the/setupendpoint is necessary before trying to start the recording via the/startendpoint.SetupIt is recommended to use a virtual environment in order to isolate the
installation, as it provides a command line interface namedrecorderthat can
conflict with other system packages.python -m venv venvActivate the environment on Windows:venv\Scripts\activateor on MacOS and Linux:source venv/bin/activateInstall frompypi. There are
optional dependencies that define which devices and listeners are available,
due to the fact some of these dependencies are not available for all operative
systems. Checkextrasfor more information about it.pip install python-recorder[all]or install this repository to use the latest development versions.pip install git+https://github.com/AcousticOdometry/python-recorder.git[all]ExtrasExtras can be installed throughthepip installcommandby specifying them at the end of the package name:pip install python-recorder[extra_one,extra_two]The available extras are defined inpyproject.tomland
are described here:realsense:Intel
Realsensedevices depend onpyrealsense2.all: All the extras defined above.UsageCheck the usage with the--helpoption:recorder --helpWorkflowConfigure the devices to be used. One can always modify the configuration
manually in the generatedyamlfile.recoder configTest that the chosen audio devices are workingrecorder test microphoneRecord an experiment with the configured devicesrecorder recordListen toGETrequests through the local networkrecorder listen localhostContributingWe are open to contributions. Please, feel free to open an issue or pull
request with any improvement or bug report. The framework is simple and easily
extensible, it should fit easily in many projects.TODOROS listenerComplete test suiteCamera device withOpenCVSpeedup the configuration file creation with compiled code?