Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError @uvc_bindings.pyx #95

Open
anmorick opened this issue Nov 3, 2023 · 1 comment
Open

AttributeError @uvc_bindings.pyx #95

anmorick opened this issue Nov 3, 2023 · 1 comment

Comments

@anmorick
Copy link

anmorick commented Nov 3, 2023

Hi All.
I meet a problem when I run at python3.
Here is my erre message.
it said uvc_bindings.pyx having AttributeError.
But I saw it , it seems correctly as normal.
Traceback (most recent call last):
File "cc.py", line 12, in
cap.frame_mode = (1280, 960, 30)
File "uvc_bindings.pyx", line 941, in uvc_bindings.Capture.frame_mode.set
File "uvc_bindings.pyx", line 629, in uvc_bindings.Capture._configure_stream
AttributeError: 'tuple' object has no attribute 'format_native'

uvc_bindings.pyx.txt
Many thank. All

Rick

@psarahdactyl
Copy link

I am having this problem too on my raspberry pi. my code is just:

import uvc
import numpy as np
from PIL import Image

# Setup GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(LED_PIN, GPIO.OUT)
GPIO.setup(SENSOR_PIN, GPIO.IN)

# Initialize Camera
cap = uvc.Capture(uvc.device_list()[0]['uid'])
cap.frame_mode = (640, 400, 7)

and my error message is:

  File "/home/sak/Documents/audiotrope_raspberry_pi/led_camera_sensor_trigger_threaded.py", line 23, in <module>
    cap.frame_mode = (640, 400, 7)
  File "uvc_bindings.pyx", line 931, in uvc_bindings.Capture.frame_mode.__set__
  File "uvc_bindings.pyx", line 625, in uvc_bindings.Capture._configure_stream
AttributeError: 'tuple' object has no attribute 'format_native'

when I go through the modes in a loop as in the example in https://github.com/pupil-labs/pyuvc/blob/master/examples/access_100_frames.py I get this output:

 CameraMode(width=320, height=200, fps=10, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=320, height=200, fps=15, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=320, height=200, fps=20, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=320, height=200, fps=30, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=320, height=200, fps=60, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=320, height=200, fps=120, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=320, height=240, fps=10, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=320, height=240, fps=15, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=320, height=240, fps=20, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=320, height=240, fps=30, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=320, height=240, fps=60, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=320, height=240, fps=120, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=360, fps=10, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=360, fps=20, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=360, fps=30, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=360, fps=60, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=360, fps=120, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=400, fps=10, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=400, fps=15, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=400, fps=20, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=400, fps=30, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=400, fps=60, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=400, fps=120, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=480, fps=10, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=480, fps=15, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=480, fps=20, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=480, fps=30, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=480, fps=60, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=640, height=480, fps=120, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=800, height=600, fps=10, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=800, height=600, fps=15, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=800, height=600, fps=20, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=800, height=600, fps=30, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=800, height=600, fps=60, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=800, height=600, fps=120, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=1280, height=720, fps=10, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=1280, height=720, fps=15, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=1280, height=720, fps=20, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=1280, height=720, fps=30, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=1280, height=720, fps=60, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=1280, height=720, fps=120, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=1280, height=800, fps=10, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=1280, height=800, fps=15, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=1280, height=800, fps=30, format_native=7, format_name='MJPG', supported=True)
 CameraMode(width=1280, height=800, fps=120, format_native=7, format_name='MJPG', supported=True)

so I am pretty sure this function should work. please help if possible! thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants