gilestrolab / ethoscope

a platform from monitoring animal behaviour in real time from a raspberry pi
http://lab.gilest.ro/ethoscope/
GNU General Public License v3.0
17 stars 25 forks source link

Video recording's performance is too slow. #181

Closed ggilestro closed 3 months ago

ggilestro commented 1 year ago

commit b3a49e5 changed the way we handle cameras to allow expansion to other cameras for the creation of superscope. however, the recording capabilities using the rPI camera have dramatically suffered going down to 8FPS for regular resolution and 1FPS for HD. cv2.writer is just not performing fast enough. We need to go back to legacy behaviour and record h264 files using the picamera appropriate start_recording method.

This could be done using split_recording as we were doing before or using the new feature record_sequence:

import picamera
with picamera.PiCamera() as camera:
    for filename in camera.record_sequence([
            'clip01.h264',
            'clip02.h264',
            'clip03.h264']):
        print('Recording to %s' % filename)
        camera.wait_recording(10)