LaboratoireMecaniqueLille / crappy

Command and Real-time Acquisition Parallelized in Python
https://crappy.readthedocs.io/en/stable/
GNU General Public License v2.0
78 stars 16 forks source link

Remove duplicate formats when using `v4l2-ctl` in Cameras #100

Closed WeisLeDocto closed 6 months ago

WeisLeDocto commented 6 months ago

When using Camera objects relying on the V4L2Helper class (either CameraGstreamer or CameraOpencv), it was possible with some hardware that a same image format was listed several times in the Camera Configuration window. This was likely caused by duplicates in the output of the call to v4l2-ctl --list-formats-ext. This behavior was user-unfriendly, as it was unnecessarily spamming the configuration window, and a possible source of confusion for users.

With this PR, duplicate formats are first removed before being exposed to the user. Moreover, the formats are also sorted according to their name, associated FPS, and image width, so that the formats are listed in a user-friendly order in the configuration window.