abhiTronix / vidgear

A High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features :fire:
https://abhitronix.github.io/vidgear
Apache License 2.0
3.37k stars 254 forks source link

No attribute 'y_tube' #189

Closed rapierbit closed 3 years ago

rapierbit commented 3 years ago

Not sure this is a bug, hence filing as a question.

I'm very new to vidgear but I have gotten it to work in a very specific circumstance for a root user, but not for a non-root user. I'm trying to use your baseline example to stream from youtube using Raspberry Pi.

If I am logged on as pi (the root user), and install opencv and vidgear as follows, the baseline example just works: sudo apt-get install python3-opencv (installs opencv-3.2.0+dfsg-6) pip3 install vidgear (installs vidgear-0.2.0)

Issue: I want to get this working for a non-root user on the RPi. For this circumstance, I'm trying to use pip3 alone to install opencv and vidgear; however, pip3 install opencv-python installs opencv-4.4.0.46 (in contrast to what I get with apt-get install). under this circumstance, I get this error:

01:34:30 :: Helper :: ERROR :: module 'cv2.cv2' has no attribute 'y_tube' Traceback (most recent call last): File "/home/3user1/.local/lib/python3.7/site-packages/vidgear/gears/helper.py", line 450, in capPropId integer_value = getattr(cv2, property) AttributeError: module 'cv2.cv2' has no attribute 'y_tube' 01:34:30 :: Helper :: CRITICAL ::y_tubeis not a valid OpenCV property! Traceback (most recent call last): File "./stream.py", line 8, in <module> stream = CamGear(source='https://youtu.be/dQw4w9WgXcQ', y_tube =True).start() # YouTube Video URL as input File "/home/3user1/.local/lib/python3.7/site-packages/vidgear/gears/camgear.py", line 311, in __init__ "[CamGear:ERROR] :: Source is invalid, CamGear failed to intitialize stream on this source!" RuntimeError: [CamGear:ERROR] :: Source is invalid, CamGear failed to intitialize stream on this source!

Is this an opencv issue, or does it have something to do with vidgear? If it's not vidgear, why does vidgear appear to work under root with opencv3 and not under root with opencv4? I admit I'm a little new to the differences between pip3 and sudo apt-get install. I usually work as root only on RPi but I have a need to run this as an unprivileged user. I tried forcing the install of opencv v3 with pip 3, but the earliest version I could find is 3.4.2.16.

Any tips would be appreciated.

Acknowledgment

Context

Your Environment

Optional

welcome[bot] commented 3 years ago

Thanks for opening this issue, a maintainer will get back to you shortly!

In the meantime:

abhiTronix commented 3 years ago

@rapierbit y_tube parameter has been changed to stream_mode in the latest v0.2.0, Kindly see CamGear Docs Example.

abhiTronix commented 3 years ago

@rapierbit Thanks, Stackoverflow example updated too.