Package: pirecorder
pirecorderA Python package for controlled and automated image and video recording with the raspberry pipirecorderis a Python package, built on thepicameraandOpenCVlibraries, that provides a flexible solution for the collection of consistent image and video data with the raspberry pi. It was developed to overcome the need for a complete solution to help researchers, especially those with limited coding skills, to easily set up and configure their raspberry pi to run large numbers of controlled and automated image and video recordings using optimal settings.A paper accompanying this package is published in the Journal of Open Source Software:Jolles, J.W. (2020). pirecorder: controlled and automated image and video recording with the raspberry pi. J. Open Source Softw. 5, 2584. doi:10.21105/joss.02584.Key FeaturesControlled recording using custom, easy-to-edit configuration filesRecord single images and videos, timelapses, and sequences of videosConfigure camera settings interactively via a live camera streamDynamically draw the region of interest for your recordingsAutomatic naming of files and folders with relevant and custom labelsEasy scheduling and automating recordings in the futureDirect control of all modules via simple terminal commandsConvert (folders of) images and videos with resize, monitor, and label optionsDedicated documentation website with detailed guides and tutorialsJupyter notebook tutorial filesAn overviewModulespirecorderconsists of a mainPiRecordermodule to run image and video recordings,streamandcamconfigmodules with interactive user interfaces for help setting up, calibrating, and configuring the camera, aschedulemodule for scheduling future recordings, and aconvertmodule for the easy converting of (folders of) recorded images and videos.InstallNote:! pirecorder relies on picamera, which is not properly integrated in the latest Raspberry Pi OS (Bullseye). Therefore it is highly recommended to use the previous OS Buster to use pirecorder and picamera. It still works but there may be issues with dependencies. You can download Buster OShereand find more information from the Raspberry Pi foundation about the issuehere. I hope to be able to update pirecorder later this year to work easier with bullseye.To install the latest release of pirecorder, simply open a terminal window and enter:pip install pirecorderTo install the latest development version, enter:pip install git+https://github.com/jollejolles/pirecorder.git --upgradeDependenciespirecorderbuilds strongly on thepicamerapackage. As some users want to use pirecorder on computers other than a raspberry pi, the picamera package is not set as a dependency. Therefore when using pirecorder for any other functionality it needs to be installed:pip install "picamera[array]".pirecorderalso usesnumpyandpyyaml, and relies on various utility functions of the accompanyingpythutilspackage. Scheduling functionality is based onCronTaband the associatedpython-crontabpackage. All these ependencies are automatically installed withpirecorder.OpenCV: has to be manually installed due to its various dependencies on raspberry pi. Clickherefor my quick install guide.FFmpeg: is only needed for the convert functionality ofpirecorder. Clickhereandherefor guides to install on raspberry pi and OS X respectively.DocumentationFor detailed documentation and tutorials aboutpirecorderand all its functionalities, see the dedicated websitejollejolles.github.io/pirecorder/.quick guidethe pirecorder packagesetting up your raspberry piinstalling pirecorderposition and calibrate the cameraconfigure recording settingsconfigure camera settingsrecord and schedule recordingsconverting mediarun from the command lineTestsTo test all functionalities of the pirecorder package, run thetests/test.pyfile (here), or alternatively run commands manually using the documented jupyter fileshere. Note that running the tests will require user input as some of the functionalities are interactive.Developmentpirecorderis developed by Dr Jolle Jolles, a research fellow at the Max Planck Institute of Animal Behavior, and at the Zukunftskolleg, Institute of Advanced Study at the University of Konstanz.For an overview of version changes see theCHANGELOGand for detailed changes see thecommits page. Please submit bugs or feature requests to the GitHub issue trackerhere.Contributions to this package are welcomed via the usual pull request mechanism.CitingIf you use pirecorder in your research, please cite the accompanying paper:@misc{Jolles2020,
      title = {pirecorder: controlled and automated image and video recording with the raspberry pi},
      author = {Jolles, Jolle W.},
      year = {2020},
      volume = {5},
      number = {54},
      pages = {2584},
      doi = {https://doi.org/10.21105/joss.02584}
}LicenseReleased under a Apache 2.0 License. SeeLICENSEfor details.