Skip to content

Windows 10 x64, Python 3.10.6 x64, pyuvc v 1.0: Can't open stream control - error: 'Operation not supported' #100

@Raduq91

Description

@Raduq91

Windows 10 x64
Python 3.10.6 x64 (thonny-4.0.1-windows-portable)
pyuvc v 1.0
libusbK-3.0.7.0-setup(same issue with libusbK-3.1.0.0-setup)

Followed instructions from here:
https://github.com/pupil-labs/pyuvc/blob/master/WINDOWS_USER.md
and installed pupil-labs-uvc, is there something else to do?

(and https://int80k.com/libuvc/ does not work for me: The connection has timed out)

code from examples:

import uvc

    devices = uvc.device_list()
    print("Available devices", devices)

    for device in devices:

        try:
            cap = uvc.Capture(device["uid"])
        except uvc.DeviceNotFoundError:
            continue

        print(f"{cap.name}")

        print("Available modes:")
        for mode in cap.available_modes:
            print(
                f"MODE: {mode.width} x {mode.height} @ {mode.fps} ({mode.format_name})"
            )

        print("Iterating over frame sizes and rates")
        for res in cap.frame_sizes:
            cap.frame_size = res
            for rate in cap.frame_rates:
                cap.frame_rate = rate
                print(f"RES/RATE: {res[0]} x {res[1]} @ {rate} Hz")

        cap.close()

output:

Available devices [{'name': 'RYS HFR USB2.0 Camera', 'manufacturer': 'RYS HFR USB2.0 Camera', 'serialNumber': 'unknown', 'idProduct': 5461, 'idVendor': 5546, 'device_address': 9, 'bus_number': 1, 'uid': '1:9'}]
RYS HFR USB2.0 Camera
Available modes:
MODE: 640 x 360 @ 330 (MJPG)
MODE: 1280 x 720 @ 120 (MJPG)
MODE: 1920 x 1080 @ 60 (MJPG)
Iterating over frame sizes and rates
RES/RATE: 640 x 360 @ 330 Hz
RES/RATE: 1280 x 720 @ 120 Hz
RES/RATE: 1920 x 1080 @ 60 Hz

import uvc

for device in uvc.device_list():

    cap = uvc.Capture(device["uid"])

    for mode in cap.available_modes:
        print(f"{cap.name} running at {mode}")
        try:
            cap.frame_mode = mode
        except uvc.InitError as err:
            print(f"{cap.name} mode selection - {err}")
            continue
        try:
            for x in range(10):
                frame = cap.get_frame_robust()
                print("frame gray mean", frame.gray.mean())
            # print(frame.img.mean())
        except uvc.InitError as err:
            print(f"{cap.name} getting frames - {err}")

    cap.close()

output:

RYS HFR USB2.0 Camera running at CameraMode(width=640, height=360, fps=330, format_native=7, format_name='MJPG', supported=True)
RYS HFR USB2.0 Camera getting frames - Can't open stream control - error: 'Operation not supported'
RYS HFR USB2.0 Camera running at CameraMode(width=1280, height=720, fps=120, format_native=7, format_name='MJPG', supported=True)
RYS HFR USB2.0 Camera getting frames - Can't open stream control - error: 'Operation not supported'
RYS HFR USB2.0 Camera running at CameraMode(width=1920, height=1080, fps=60, format_native=7, format_name='MJPG', supported=True)
RYS HFR USB2.0 Camera getting frames - Can't open stream control - error: 'Operation not supported'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions