Third-party cameras - Pupil Capture supports third-party USB cameras that fulfill the following criteria:
- UVC compatible (Chapters below refer to this document)
- Support
Video Interface Class Code 0x0E CC_VIDEO
(see A.1) - Support
Video Subclass Code 0x02 SC_VIDEOSTREAMING
(see A.2) - Support for the
UVC_VS_FRAME_MJPEG (0x07)
video streaming interface descriptor subtype (A.6) - Support
UVC_FRAME_FORMAT_COMPRESSED
frame format
Access Pupil cameras via libuvc These are the steps that pyuvc uses to access Pupil cameras:
- Use
uvc_init()
to create a context - Use
uvc_get_device_list()
to enumerate available devices - Use
uvc_open()
to create a device handle for a given device from step 2 - Use
uvc_get_format_descs()
to enumerate available format descriptions - Enumerate available frame sizes and rates for format descriptions with the
bDescriptorSubtype == UVC_VS_FRAME_MJPEG
- Get a stream control handle by passing
UVC_FRAME_FORMAT_COMPRESSED
and a valid frame size/rate combination touvc_get_stream_ctrl_format_size()
- Open the stream with
vc_stream_open_ctrl()
- Start the stream with
uvc_stream_start()
passing 2.0 as bandwidth_factor - Use
uvc_stream_get_frame()
to access frames - Use
uvc_stream_stop()
to stop the stream - Use
uvc_stream_close()
to close the stream - Use
uvc_close()
to close the device handle - Use
uvc_unref_device()
to unrefence the selected device