QVideo 4.8.0__tar.gz → 4.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qvideo-4.8.0 → qvideo-4.9.0}/PKG-INFO +1 -1
- {qvideo-4.8.0 → qvideo-4.9.0}/QVideo.egg-info/PKG-INFO +1 -1
- {qvideo-4.8.0 → qvideo-4.9.0}/QVideo.egg-info/SOURCES.txt +2 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Basler/_camera.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Basler/_tree.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Flir/QListFlirCameras.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Flir/_camera.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Flir/_tree.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Genicam/_camera.py +4 -4
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Genicam/_tree.py +33 -27
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/IDS/_camera.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/IDS/_tree.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/MV/_camera.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/MV/_tree.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Noise/_camera.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Noise/_tree.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/OpenCV/QListCVCameras.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/OpenCV/_camera.py +2 -1
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/OpenCV/_tree.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Picamera/_camera.py +7 -6
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Picamera/_imx500.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Picamera/_tree.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Vimbax/_camera.py +1 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Vimbax/_tree.py +1 -0
- qvideo-4.9.0/dvr/QBacklogMonitor.py +114 -0
- qvideo-4.9.0/dvr/QCircularBuffer.py +148 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/dvr/QCircularDVRWidget.py +77 -16
- {qvideo-4.8.0 → qvideo-4.9.0}/dvr/QDVRWidget.py +78 -85
- {qvideo-4.8.0 → qvideo-4.9.0}/dvr/__init__.py +5 -1
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/_MedianBase.py +2 -1
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/circletransform.py +8 -8
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/exposure.py +4 -4
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/momean.py +1 -1
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/threshold.py +8 -8
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/unsharp.py +1 -1
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QCamera.py +1 -1
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QUniformityWidget.py +2 -2
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QVideoReader.py +1 -1
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QVideoSource.py +1 -1
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/_camera.py +48 -116
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/_jupyter.py +117 -8
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/gentl.py +62 -39
- {qvideo-4.8.0 → qvideo-4.9.0}/overlays/trackpy.py +6 -4
- {qvideo-4.8.0 → qvideo-4.9.0}/overlays/yolo.py +7 -3
- {qvideo-4.8.0 → qvideo-4.9.0}/pyproject.toml +1 -1
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_camera.py +154 -30
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_circularbuffer.py +45 -97
- qvideo-4.9.0/tests/test_circulardvrwidget.py +402 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_dejitter.py +1 -1
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_jupyter.py +15 -0
- qvideo-4.9.0/tests/test_qbacklogmonitor.py +150 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qdvrwidget.py +70 -121
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qfilterrackwidget.py +167 -7
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qgenicamcamera.py +8 -8
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qgenicamtree.py +1 -1
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qhdf5writer.py +3 -3
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qopencvwriter.py +3 -2
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qpicamera.py +10 -0
- qvideo-4.9.0/tests/test_teardown.py +131 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_trackpy_overlay.py +9 -1
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_yolo_overlay.py +9 -1
- qvideo-4.8.0/dvr/QCircularBuffer.py +0 -200
- qvideo-4.8.0/tests/test_circulardvrwidget.py +0 -150
- qvideo-4.8.0/tests/test_teardown.py +0 -69
- {qvideo-4.8.0 → qvideo-4.9.0}/LICENSE.md +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/QCamcorder.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/QVideo.egg-info/dependency_links.txt +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/QVideo.egg-info/requires.txt +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/QVideo.egg-info/top_level.txt +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/README.md +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/__main__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Basler/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Flir/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Genicam/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/IDS/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/MV/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Noise/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/OpenCV/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/OpenCV/_devices.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Picamera/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/Vimbax/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/cameras/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/demos/ROIdemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/demos/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/demos/circulardemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/demos/combineddemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/demos/compositedemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/demos/demo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/demos/filterdemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/demos/filterrackdemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/demos/histogramdemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/demos/trackpydemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/demos/uniformitydemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/demos/yolodemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/dvr/QHDF5Reader.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/dvr/QHDF5Writer.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/dvr/QOpenCVReader.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/dvr/QOpenCVWriter.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/dvr/QPyAVReader.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/dvr/QPyAVWriter.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/dvr/icons/record.svg +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/artistic.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/blob.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/darkframe.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/dejitter.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/dog.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/edge.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/flatfield.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/foreground.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/gamma.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/invert.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/laplacian.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/median.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/momedian.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/normalize.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/rgb.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/roi.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/samplehold.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/smoothing.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/filters/sobel.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QCameraTree.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QFilterPipeline.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QFilterRack.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QFilterRackWidget.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QFrameRelay.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QHistogramWidget.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QListCameras.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QSnapshot.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QVideoFilter.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QVideoScreen.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/QVideoWriter.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/_launch.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/_qabc.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/chooser.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/clickable.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/errors.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/imageops.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/lib/videotypes.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/overlays/__init__.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/setup.cfg +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_artistic.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_blob.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_chooser.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_circletransform.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_circulardemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_clickable.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_combineddemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_compositedemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_darkframe.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_demo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_demo_recipes.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_docs_quickstart.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_dog.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_edge.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_exposure.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_filter_export.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_filterdemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_filterrackdemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_filters_gray.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_flatfield.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_foreground.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_gamma.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_gentl.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_histogramdemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_histogramwidget.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_imageops.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_invert.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_laplacian.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_launch.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_mainwindow.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_median.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_momean.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_momedian.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_normalize.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_overlays_package.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qabc.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qbaslercamera.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qcamcorder.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qcamera.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qcameratree.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qfilterpipeline.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qfilterrack.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qflircamera.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qframerelay.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qhdf5reader.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qidscamera.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qimxcamera.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qlistcameras.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qlistcvcameras.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qlistflircameras.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qmvcamera.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qnoisecamera.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qnoisetree.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qopencvcamera.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qopencvdevices.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qopencvreader.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qopencvtree.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qpicameratree.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qpyavreader.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qpyavwriter.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qsnapshot.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qt_binding.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qvideoreader.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qvideoscreen.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qvideosource.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qvideowriter.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_qvimbaxcamera.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_resolutions.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_rgb.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_roi.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_roidemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_samplehold.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_smoothing.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_sobel.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_threshold.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_trackpydemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_uniformitydemo.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_uniformitywidget.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_unsharp.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_vendor_trees.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_videofilter.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_videotypes.py +0 -0
- {qvideo-4.8.0 → qvideo-4.9.0}/tests/test_yolodemo.py +0 -0
|
@@ -56,6 +56,7 @@ demos/histogramdemo.py
|
|
|
56
56
|
demos/trackpydemo.py
|
|
57
57
|
demos/uniformitydemo.py
|
|
58
58
|
demos/yolodemo.py
|
|
59
|
+
dvr/QBacklogMonitor.py
|
|
59
60
|
dvr/QCircularBuffer.py
|
|
60
61
|
dvr/QCircularDVRWidget.py
|
|
61
62
|
dvr/QDVRWidget.py
|
|
@@ -163,6 +164,7 @@ tests/test_momedian.py
|
|
|
163
164
|
tests/test_normalize.py
|
|
164
165
|
tests/test_overlays_package.py
|
|
165
166
|
tests/test_qabc.py
|
|
167
|
+
tests/test_qbacklogmonitor.py
|
|
166
168
|
tests/test_qbaslercamera.py
|
|
167
169
|
tests/test_qcamcorder.py
|
|
168
170
|
tests/test_qcamera.py
|
|
@@ -479,11 +479,11 @@ class QGenicamCamera(QCamera):
|
|
|
479
479
|
ptype=ptype,
|
|
480
480
|
**meta)
|
|
481
481
|
|
|
482
|
-
def
|
|
482
|
+
def hasNode(self, name: str) -> bool:
|
|
483
483
|
'''Return ``True`` if the named node exists in the node map.
|
|
484
484
|
|
|
485
485
|
Unlike :meth:`node`, this never logs a warning for missing names.
|
|
486
|
-
Use it to guard calls to :meth:`node` or :meth:`
|
|
486
|
+
Use it to guard calls to :meth:`node` or :meth:`isReadWrite` in
|
|
487
487
|
reactive code paths (e.g. UI update loops) where absent names are
|
|
488
488
|
expected and not an error.
|
|
489
489
|
|
|
@@ -519,7 +519,7 @@ class QGenicamCamera(QCamera):
|
|
|
519
519
|
logger.warning(f'node {name} is unknown')
|
|
520
520
|
return None
|
|
521
521
|
|
|
522
|
-
def
|
|
522
|
+
def isReadWrite(self, feature: str) -> bool:
|
|
523
523
|
'''Return ``True`` if the named feature is currently writable.
|
|
524
524
|
|
|
525
525
|
Parameters
|
|
@@ -550,7 +550,7 @@ class QGenicamCamera(QCamera):
|
|
|
550
550
|
Parameters
|
|
551
551
|
----------
|
|
552
552
|
name : str
|
|
553
|
-
GenICam node name. It must exist (see :meth:`
|
|
553
|
+
GenICam node name. It must exist (see :meth:`hasNode`).
|
|
554
554
|
|
|
555
555
|
Returns
|
|
556
556
|
-------
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'''Camera property tree for GenICam cameras.'''
|
|
1
2
|
from typing import Any
|
|
2
3
|
import math
|
|
3
4
|
from qtpy import QtCore
|
|
@@ -118,36 +119,41 @@ class QGenicamTree(QCameraTree):
|
|
|
118
119
|
this['step'] = feature.inc
|
|
119
120
|
elif isinstance(feature, IFloat):
|
|
120
121
|
this['type'] = 'float'
|
|
121
|
-
|
|
122
|
-
if unit in _MICROSECOND_UNITS:
|
|
123
|
-
scale = 1e-6
|
|
124
|
-
self._scaleFactors[feature.node.name] = scale
|
|
125
|
-
this['siPrefix'] = True
|
|
126
|
-
unit = 's'
|
|
127
|
-
else:
|
|
128
|
-
scale = 1.0
|
|
129
|
-
this['value'] = this['default'] = feature.value * scale
|
|
130
|
-
lo = feature.min * scale
|
|
131
|
-
hi = feature.max * scale
|
|
132
|
-
this['min'] = lo
|
|
133
|
-
this['max'] = hi
|
|
134
|
-
this['units'] = unit
|
|
135
|
-
if feature.has_inc():
|
|
136
|
-
this['step'] = feature.inc * scale
|
|
137
|
-
if lo > 0 and hi / lo > 100:
|
|
138
|
-
self._decParams.add(feature.node.name)
|
|
139
|
-
v = feature.value * scale
|
|
140
|
-
if v > 0:
|
|
141
|
-
this['step'] = 10 ** (math.floor(math.log10(v)) - 1)
|
|
122
|
+
self._describeFloat(feature, this)
|
|
142
123
|
elif isinstance(feature, IString):
|
|
143
124
|
this['type'] = 'str'
|
|
144
125
|
this['value'] = this['default'] = feature.value
|
|
145
126
|
else:
|
|
146
|
-
#
|
|
127
|
+
# Register nodes (IRegister) give raw access to bytes of the
|
|
128
|
+
# camera's memory; there is nothing to show in a control tree.
|
|
147
129
|
logger.debug(
|
|
148
130
|
f'Unsupported node type: {feature.node.name}: {type(feature)}')
|
|
149
131
|
return this
|
|
150
132
|
|
|
133
|
+
def _describeFloat(self, feature: IFloat, this: dict[str, Any]) -> None:
|
|
134
|
+
'''Add the value, limits, units and step of a float *feature*.'''
|
|
135
|
+
unit = feature.unit
|
|
136
|
+
if unit in _MICROSECOND_UNITS:
|
|
137
|
+
scale = 1e-6
|
|
138
|
+
self._scaleFactors[feature.node.name] = scale
|
|
139
|
+
this['siPrefix'] = True
|
|
140
|
+
unit = 's'
|
|
141
|
+
else:
|
|
142
|
+
scale = 1.0
|
|
143
|
+
this['value'] = this['default'] = feature.value * scale
|
|
144
|
+
lo = feature.min * scale
|
|
145
|
+
hi = feature.max * scale
|
|
146
|
+
this['min'] = lo
|
|
147
|
+
this['max'] = hi
|
|
148
|
+
this['units'] = unit
|
|
149
|
+
if feature.has_inc():
|
|
150
|
+
this['step'] = feature.inc * scale
|
|
151
|
+
if lo > 0 and hi / lo > 100:
|
|
152
|
+
self._decParams.add(feature.node.name)
|
|
153
|
+
v = feature.value * scale
|
|
154
|
+
if v > 0:
|
|
155
|
+
this['step'] = 10 ** (math.floor(math.log10(v)) - 1)
|
|
156
|
+
|
|
151
157
|
def _connectSignals(self) -> None:
|
|
152
158
|
super()._connectSignals()
|
|
153
159
|
for item in self.listAllItems():
|
|
@@ -226,8 +232,8 @@ class QGenicamTree(QCameraTree):
|
|
|
226
232
|
p = item.param
|
|
227
233
|
if p.opts.get('visible', False):
|
|
228
234
|
name = p.opts['name']
|
|
229
|
-
if self.camera.
|
|
230
|
-
p.setOpts(enabled=self.camera.
|
|
235
|
+
if self.camera.hasNode(name):
|
|
236
|
+
p.setOpts(enabled=self.camera.isReadWrite(name))
|
|
231
237
|
|
|
232
238
|
def _updateLimits(self) -> None:
|
|
233
239
|
'''Refresh Parameter constraints from the live GenICam node values.
|
|
@@ -241,7 +247,7 @@ class QGenicamTree(QCameraTree):
|
|
|
241
247
|
if not p.opts.get('visible', False):
|
|
242
248
|
continue
|
|
243
249
|
name = p.opts.get('name')
|
|
244
|
-
if not self.camera.
|
|
250
|
+
if not self.camera.hasNode(name):
|
|
245
251
|
continue
|
|
246
252
|
state = self.camera.state(name)
|
|
247
253
|
kind, inc = state['kind'], state.get('inc')
|
|
@@ -284,7 +290,7 @@ class QGenicamTree(QCameraTree):
|
|
|
284
290
|
if not p.opts.get('visible', False):
|
|
285
291
|
continue
|
|
286
292
|
name = p.opts.get('name')
|
|
287
|
-
if not self.camera.
|
|
293
|
+
if not self.camera.hasNode(name):
|
|
288
294
|
continue
|
|
289
295
|
state = self.camera.state(name)
|
|
290
296
|
if state['access'] != EAccessMode.RO:
|
|
@@ -328,7 +334,7 @@ class QGenicamTree(QCameraTree):
|
|
|
328
334
|
if not p.opts.get('visible', False):
|
|
329
335
|
continue
|
|
330
336
|
name = p.opts.get('name')
|
|
331
|
-
if not self.camera.
|
|
337
|
+
if not self.camera.hasNode(name):
|
|
332
338
|
continue
|
|
333
339
|
state = self.camera.state(name)
|
|
334
340
|
if state['access'] not in (EAccessMode.RO, EAccessMode.RW):
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'''OpenCV camera and threaded video source (USB and built-in).'''
|
|
1
2
|
from QVideo.lib import QCamera, QVideoSource
|
|
2
3
|
from QVideo.cameras.OpenCV._devices import (
|
|
3
4
|
capture_backend, configure, probe_formats)
|
|
@@ -63,7 +64,7 @@ class QOpenCVCamera(QCamera):
|
|
|
63
64
|
``width`` and ``height`` are registered as writable properties.
|
|
64
65
|
Changes are applied to the open device via OpenCV's V4L2 backend, which
|
|
65
66
|
handles the required ``VIDIOC_STREAMOFF`` / ``VIDIOC_S_FMT`` /
|
|
66
|
-
``VIDIOC_STREAMON`` cycle internally. The camera mutex
|
|
67
|
+
``VIDIOC_STREAMON`` cycle internally. The camera mutex serializes these
|
|
67
68
|
writes against concurrent reads, so no source stop/restart is needed.
|
|
68
69
|
:class:`~QVideo.cameras.OpenCV.QOpenCVTree.QOpenCVTree` exposes them as
|
|
69
70
|
read-only display fields; the ``resolution`` enum in that tree changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'''Raspberry Pi camera and threaded video source (picamera2).'''
|
|
1
2
|
from contextlib import suppress
|
|
2
3
|
from typing import TYPE_CHECKING
|
|
3
4
|
from QVideo.lib import QCamera, QVideoSource
|
|
@@ -111,7 +112,7 @@ class QPicamera(QCamera):
|
|
|
111
112
|
def _createDevice(self) -> 'Picamera2 | None':
|
|
112
113
|
'''Return a new :class:`~picamera2.Picamera2` instance.
|
|
113
114
|
|
|
114
|
-
Subclasses can override this to return a
|
|
115
|
+
Subclasses can override this to return a specialized device
|
|
115
116
|
(e.g. :class:`~picamera2.devices.imx500.IMX500`) while inheriting
|
|
116
117
|
the rest of :meth:`_initialize`.
|
|
117
118
|
|
|
@@ -159,8 +160,8 @@ class QPicamera(QCamera):
|
|
|
159
160
|
sensor = info[self._cameraID].get('Model')
|
|
160
161
|
if sensor is not None:
|
|
161
162
|
self._modelName = _CAMERA_MODELS.get(sensor, sensor)
|
|
162
|
-
except Exception:
|
|
163
|
-
|
|
163
|
+
except Exception as ex:
|
|
164
|
+
logger.debug(f'cannot read the camera model: {ex}')
|
|
164
165
|
# Save controls set before this restart (e.g. fps changed while
|
|
165
166
|
# the device was closed). _probeControls will overwrite
|
|
166
167
|
# _controlValues from fresh metadata, so we save them here and
|
|
@@ -220,7 +221,7 @@ class QPicamera(QCamera):
|
|
|
220
221
|
----------
|
|
221
222
|
metadata : dict
|
|
222
223
|
Frame metadata from :meth:`~picamera2.Picamera2.capture_metadata`,
|
|
223
|
-
used to
|
|
224
|
+
used to initialize cached control values.
|
|
224
225
|
'''
|
|
225
226
|
for name, ptype in _CONTROL_TYPES.items():
|
|
226
227
|
if name not in self._device.camera_controls:
|
|
@@ -277,7 +278,7 @@ class QPicamera(QCamera):
|
|
|
277
278
|
----------
|
|
278
279
|
metadata : dict
|
|
279
280
|
Frame metadata from :meth:`~picamera2.Picamera2.capture_metadata`,
|
|
280
|
-
used to
|
|
281
|
+
used to initialize the cached ``AfState`` value.
|
|
281
282
|
'''
|
|
282
283
|
if 'AfTrigger' not in self._device.camera_controls:
|
|
283
284
|
return
|
|
@@ -303,7 +304,7 @@ class QPicamera(QCamera):
|
|
|
303
304
|
----------
|
|
304
305
|
metadata : dict
|
|
305
306
|
Frame metadata from :meth:`~picamera2.Picamera2.capture_metadata`,
|
|
306
|
-
used to
|
|
307
|
+
used to initialize cached gain values.
|
|
307
308
|
'''
|
|
308
309
|
if 'ColourGains' not in self._device.camera_controls:
|
|
309
310
|
return
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'''Measure how far the writer of a recording is behind the camera.'''
|
|
2
|
+
import math
|
|
3
|
+
import numpy as np
|
|
4
|
+
import psutil
|
|
5
|
+
from qtpy import QtCore
|
|
6
|
+
from QVideo.lib.videotypes import Image, FrameInfo
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
__all__ = ['QBacklogMonitor']
|
|
10
|
+
|
|
11
|
+
#: Steps in which the backlog is reported.
|
|
12
|
+
_STEPS = 20
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class QBacklogMonitor(QtCore.QObject):
|
|
16
|
+
|
|
17
|
+
'''Measures how far the writer of a recording is behind the camera.
|
|
18
|
+
|
|
19
|
+
A recorder must not drop frames, so frames wait in memory while the
|
|
20
|
+
writer is slower than the camera. The monitor compares the capture
|
|
21
|
+
time of each frame that the camera delivers (a
|
|
22
|
+
:class:`~QVideo.lib.videotypes.FrameInfo`) with that of the newest
|
|
23
|
+
frame that the writer has taken up. The difference is the backlog, and
|
|
24
|
+
it is measured even while the writer is stuck inside a single write,
|
|
25
|
+
and for sources that capture slowly.
|
|
26
|
+
|
|
27
|
+
The monitor does not need a recorder: any object with a ``received``
|
|
28
|
+
attribute, which holds the ``FrameInfo`` of the newest frame that it has
|
|
29
|
+
taken up (``None`` until it has taken one), can be watched, provided that
|
|
30
|
+
it is meant to take every frame.
|
|
31
|
+
|
|
32
|
+
The allowance is the smaller of *lagLimit* seconds and the time that the
|
|
33
|
+
camera takes to fill *maxMemory* bytes, so one limit serves both. The
|
|
34
|
+
monitor only measures: what to do about a recording that falls behind is
|
|
35
|
+
for the application (:class:`~QVideo.dvr.QDVRWidget.QDVRWidget` stops
|
|
36
|
+
it, by default).
|
|
37
|
+
|
|
38
|
+
Signals
|
|
39
|
+
-------
|
|
40
|
+
backlog(float)
|
|
41
|
+
Emitted whenever the backlog changes by 5% of the allowance, with
|
|
42
|
+
the backlog as a fraction of it: ``1.`` is the point at which
|
|
43
|
+
``behind`` is emitted.
|
|
44
|
+
behind(float)
|
|
45
|
+
Emitted once each time the backlog passes the allowance, with the
|
|
46
|
+
lag in seconds. It is emitted again after the writer has caught up
|
|
47
|
+
and fallen behind anew.
|
|
48
|
+
'''
|
|
49
|
+
|
|
50
|
+
#: Emitted as the backlog changes, as a fraction of what is allowed.
|
|
51
|
+
backlog = QtCore.Signal(float)
|
|
52
|
+
#: Emitted when the backlog passes the allowance, with the lag [s].
|
|
53
|
+
behind = QtCore.Signal(float)
|
|
54
|
+
|
|
55
|
+
def __init__(self, parent: QtCore.QObject | None = None) -> None:
|
|
56
|
+
super().__init__(parent)
|
|
57
|
+
self._writer = None
|
|
58
|
+
self._fps = 1.
|
|
59
|
+
self._lagLimit = 1.
|
|
60
|
+
self._budget = float('inf')
|
|
61
|
+
self._level = 0
|
|
62
|
+
|
|
63
|
+
def start(self,
|
|
64
|
+
writer,
|
|
65
|
+
fps: float,
|
|
66
|
+
lagLimit: float = 1.,
|
|
67
|
+
maxMemory: float | None = None) -> None:
|
|
68
|
+
'''Begin to watch *writer*.
|
|
69
|
+
|
|
70
|
+
Parameters
|
|
71
|
+
----------
|
|
72
|
+
writer : QVideoWriter or object
|
|
73
|
+
The consumer, usually a writer; its ``received`` attribute is
|
|
74
|
+
the :class:`~QVideo.lib.videotypes.FrameInfo` of the newest
|
|
75
|
+
frame that it has taken up.
|
|
76
|
+
fps : float
|
|
77
|
+
Frame rate of the camera [frames per second].
|
|
78
|
+
lagLimit : float
|
|
79
|
+
How far [seconds] the writer may fall behind the newest frame.
|
|
80
|
+
maxMemory : float or None
|
|
81
|
+
Memory [bytes] that the waiting frames may occupy. ``None``
|
|
82
|
+
means 80% of the memory that is available now.
|
|
83
|
+
'''
|
|
84
|
+
self._writer = writer
|
|
85
|
+
self._fps = fps
|
|
86
|
+
self._lagLimit = lagLimit
|
|
87
|
+
self._budget = maxMemory or 0.8 * psutil.virtual_memory().available
|
|
88
|
+
self._level = 0
|
|
89
|
+
|
|
90
|
+
def stop(self) -> None:
|
|
91
|
+
'''Stop watching. A frame that is delivered late is ignored.'''
|
|
92
|
+
self._writer = None
|
|
93
|
+
|
|
94
|
+
@QtCore.Slot(np.ndarray)
|
|
95
|
+
@QtCore.Slot(np.ndarray, object)
|
|
96
|
+
def check(self, frame: Image, info: FrameInfo | None = None) -> None:
|
|
97
|
+
'''Compare the frame that has just been captured with the writer.
|
|
98
|
+
|
|
99
|
+
The backlog is reported in steps, not for every frame, and
|
|
100
|
+
``behind`` once each time that it passes the allowance.
|
|
101
|
+
'''
|
|
102
|
+
taken = self._writer and self._writer.received
|
|
103
|
+
if info is None or not taken:
|
|
104
|
+
return
|
|
105
|
+
lag = max(info.timestamp - taken.timestamp, 0.)
|
|
106
|
+
fill = self._budget / (self._fps * frame.nbytes)
|
|
107
|
+
fraction = lag / min(self._lagLimit, fill)
|
|
108
|
+
level = math.ceil(fraction * _STEPS)
|
|
109
|
+
if level == self._level:
|
|
110
|
+
return
|
|
111
|
+
was, self._level = self._level, level
|
|
112
|
+
self.backlog.emit(fraction)
|
|
113
|
+
if level > _STEPS >= was:
|
|
114
|
+
self.behind.emit(lag)
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
'''Ring buffer that keeps the most recent frames and their capture times.'''
|
|
2
|
+
from collections import deque
|
|
3
|
+
from time import perf_counter
|
|
4
|
+
from qtpy import QtCore
|
|
5
|
+
import numpy as np
|
|
6
|
+
import psutil
|
|
7
|
+
import logging
|
|
8
|
+
|
|
9
|
+
from QVideo.lib.videotypes import Image, FrameInfo
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
__all__ = ['QCircularBuffer']
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
logger = logging.getLogger(__name__)
|
|
16
|
+
|
|
17
|
+
_MEMORY_WARN_FRACTION = 0.25
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class QCircularBuffer(QtCore.QObject):
|
|
21
|
+
|
|
22
|
+
'''Ring buffer that keeps the most recent frames and their capture times.
|
|
23
|
+
|
|
24
|
+
Each frame appended via :meth:`append` is stored together with its
|
|
25
|
+
:class:`~QVideo.lib.videotypes.FrameInfo`. When the buffer is full the
|
|
26
|
+
oldest frame is discarded. :meth:`frames` returns the contents, and
|
|
27
|
+
:attr:`actualFps` the rate at which they were captured. Writing them
|
|
28
|
+
to a file is the job of
|
|
29
|
+
:class:`~QVideo.dvr.QCircularDVRWidget.QCircularDVRWidget`.
|
|
30
|
+
|
|
31
|
+
Parameters
|
|
32
|
+
----------
|
|
33
|
+
fps : float
|
|
34
|
+
Nominal frame rate used to size the buffer and as a fallback
|
|
35
|
+
fps when fewer than two frames have been captured.
|
|
36
|
+
duration : int
|
|
37
|
+
Buffer length in seconds. The buffer holds at most
|
|
38
|
+
``fps × duration`` frames.
|
|
39
|
+
|
|
40
|
+
Slots
|
|
41
|
+
-----
|
|
42
|
+
append(frame : numpy.ndarray, info : FrameInfo) -> None
|
|
43
|
+
Add *frame* to the buffer with its capture information.
|
|
44
|
+
'''
|
|
45
|
+
|
|
46
|
+
def __init__(self,
|
|
47
|
+
fps: float = 24.,
|
|
48
|
+
duration: int = 5,
|
|
49
|
+
parent=None) -> None:
|
|
50
|
+
super().__init__(parent)
|
|
51
|
+
self._fps = float(fps)
|
|
52
|
+
self._duration = max(1, int(duration))
|
|
53
|
+
self._buffer: deque = deque(
|
|
54
|
+
maxlen=max(1, int(self._fps * self._duration)))
|
|
55
|
+
self._frameBytes: int = 0
|
|
56
|
+
self._warned: bool = False
|
|
57
|
+
self._appended: int = 0
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def fps(self) -> float:
|
|
61
|
+
'''Nominal frame rate [frames per second].'''
|
|
62
|
+
return self._fps
|
|
63
|
+
|
|
64
|
+
@fps.setter
|
|
65
|
+
def fps(self, fps: float) -> None:
|
|
66
|
+
self._fps = float(fps)
|
|
67
|
+
self._resize()
|
|
68
|
+
|
|
69
|
+
@property
|
|
70
|
+
def duration(self) -> int:
|
|
71
|
+
'''Buffer length [seconds].'''
|
|
72
|
+
return self._duration
|
|
73
|
+
|
|
74
|
+
@duration.setter
|
|
75
|
+
def duration(self, seconds: int) -> None:
|
|
76
|
+
self._duration = max(1, int(seconds))
|
|
77
|
+
self._resize()
|
|
78
|
+
|
|
79
|
+
def _resize(self) -> None:
|
|
80
|
+
maxlen = max(1, int(self._fps * self._duration))
|
|
81
|
+
items = list(self._buffer)
|
|
82
|
+
self._buffer = deque(items[-maxlen:], maxlen=maxlen)
|
|
83
|
+
self._warned = False
|
|
84
|
+
|
|
85
|
+
def __len__(self) -> int:
|
|
86
|
+
return len(self._buffer)
|
|
87
|
+
|
|
88
|
+
def clear(self) -> None:
|
|
89
|
+
'''Discard all buffered frames.'''
|
|
90
|
+
self._buffer.clear()
|
|
91
|
+
|
|
92
|
+
@staticmethod
|
|
93
|
+
def _totalRAM() -> int:
|
|
94
|
+
'''Return total physical RAM in bytes.'''
|
|
95
|
+
return psutil.virtual_memory().total
|
|
96
|
+
|
|
97
|
+
def _checkMemory(self) -> None:
|
|
98
|
+
self._warned = True
|
|
99
|
+
estimated = self._buffer.maxlen * self._frameBytes
|
|
100
|
+
total = self._totalRAM()
|
|
101
|
+
if estimated > _MEMORY_WARN_FRACTION * total:
|
|
102
|
+
est_mb = estimated / 1024 ** 2
|
|
103
|
+
pct = 100 * estimated / total
|
|
104
|
+
total_gb = total / 1024 ** 3
|
|
105
|
+
logger.warning(
|
|
106
|
+
f'Circular buffer may use {est_mb:.0f} MB '
|
|
107
|
+
f'({pct:.0f}% of {total_gb:.1f} GB RAM); '
|
|
108
|
+
f'consider reducing duration or frame rate.'
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
@QtCore.Slot(np.ndarray)
|
|
112
|
+
@QtCore.Slot(np.ndarray, object)
|
|
113
|
+
def append(self, frame: Image, info: FrameInfo | None = None) -> None:
|
|
114
|
+
'''Add *frame* to the buffer with its capture information.
|
|
115
|
+
|
|
116
|
+
Parameters
|
|
117
|
+
----------
|
|
118
|
+
frame : numpy.ndarray
|
|
119
|
+
Video frame to buffer.
|
|
120
|
+
info : FrameInfo, optional
|
|
121
|
+
Capture metadata for *frame*. If omitted, the frame is
|
|
122
|
+
stamped with the current time.
|
|
123
|
+
'''
|
|
124
|
+
self._frameBytes = frame.nbytes
|
|
125
|
+
if not self._warned:
|
|
126
|
+
self._checkMemory()
|
|
127
|
+
if info is None:
|
|
128
|
+
info = FrameInfo(self._appended, perf_counter())
|
|
129
|
+
self._appended += 1
|
|
130
|
+
self._buffer.append((frame, info))
|
|
131
|
+
|
|
132
|
+
def frames(self) -> list[tuple[Image, FrameInfo]]:
|
|
133
|
+
'''Return the buffered ``(frame, info)`` pairs, oldest first.'''
|
|
134
|
+
return list(self._buffer)
|
|
135
|
+
|
|
136
|
+
@property
|
|
137
|
+
def actualFps(self) -> float:
|
|
138
|
+
'''Frame rate of the buffered frames, from their capture times.
|
|
139
|
+
|
|
140
|
+
This is the nominal :attr:`fps` when the buffer holds fewer than
|
|
141
|
+
two frames, or frames that were all captured at the same time.
|
|
142
|
+
'''
|
|
143
|
+
if len(self._buffer) < 2:
|
|
144
|
+
return self._fps
|
|
145
|
+
elapsed = self._buffer[-1][1].timestamp - self._buffer[0][1].timestamp
|
|
146
|
+
if elapsed <= 0:
|
|
147
|
+
return self._fps
|
|
148
|
+
return (len(self._buffer) - 1) / elapsed
|