Comments (6)
Okay - I figured out the Test script is calling the VideoCapture() method with just the index of the video device while the script itself gives the parameter cv2.CAP_GSTREAMER.
vc = cv2.VideoCapture(0)
vc = cv2.VideoCapture(0,cv2.CAP_GSTREAMER)
by removing the parameter the script seems to run - I can see that sync is active in the hue app. Unfortunately im not at home atm so I cant see if the lights are actually changing 🤣
I checked with videotest.py that the resolution is 640x360:
print("width: ")
print(vc.get(cv2.CAP_PROP_FRAME_WIDTH))
print("height: ")
print(vc.get(cv2.CAP_PROP_FRAME_HEIGHT))
I dont know if calling with cv2.CAP_GSTREAMER changes the resolution... I am to dumb to find a proper documentation I understand..
If found this:
def __gstreamer_pipeline(
camera_id,
capture_width=1920,
capture_height=1080,
display_width=1920,
display_height=1080,
framerate=30,
flip_method=0,
):
return (
"nvarguscamerasrc sensor-id=%d ! "
"video/x-raw(memory:NVMM), "
"width=(int)%d, height=(int)%d, "
"format=(string)NV12, framerate=(fraction)%d/1 ! "
"nvvidconv flip-method=%d ! "
"video/x-raw, width=(int)%d, height=(int)%d, format=(string)BGRx ! "
"videoconvert ! "
"video/x-raw, format=(string)BGR ! appsink max-buffers=1 drop=True"
% (
camera_id,
capture_width,
capture_height,
framerate,
flip_method,
display_width,
display_height,
)
)
stream = cv2.VideoCapture(__gstreamer_pipeline(camera_id=0, flip_method=2), cv2.CAP_GSTREAMER)
Adding the define and changing the call of VideoCapture seems not to provoke the warnings/errors.. however, I dont get any video shown. I am a bit lost now.. I will try again when I have local access and dont have to fiddle with VPN.
from harmonizeproject.
At home.. changing
vc = cv2.VideoCapture(0,cv2.CAP_GSTREAMER)
to
vc = cv2.VideoCapture(0)
seems to have it solved for me. Lights are running back again - Yay! I cant see a difference to before.
Adding the last codesnippet above seems not to open the videodevice - just nothing happens. Seems like gstreamer is waiting for something.
Maybe somebody is able to explain ^^
from harmonizeproject.
from harmonizeproject.
I tried that at first, because the line is still in the code. Unfortunately it results in:
./harmonize.py
--- Starting Harmonize Project ---
INFO: Single Hue bridge detected on network via mDNS.
Querying hue bridge for entertainment areas on local network.
groupid = 7
Using Entertainment area with group_id: 7
Starting computer vision engine...
--- INFO: Detected video capture card on /dev/video0 ---
Disabling streaming on Entertainment area...
ERROR: Unable to open capture device.
from harmonizeproject.
from harmonizeproject.
Not knowing much about python I fiddled around half the day.
my OpenCV has definetely ffmpeg support builtin:
>>> import cv2
>>> cv2.__version__
>>> info = cv2.getBuildInformation()
>>> video, parallel = info.index('Video'), info.index('Parallel')
>>> print(info[video:parallel])
results in:
'4.5.4'
Video I/O:
DC1394: YES (2.2.6)
FFMPEG: YES
avcodec: YES (58.134.100)
avformat: YES (58.76.100)
avutil: YES (56.70.100)
swscale: YES (5.9.100)
avresample: NO
GStreamer: YES (1.19.90)
PvAPI: NO
v4l/v4l2: YES (linux/videodev2.h)
gPhoto2: YES
But I didnt get any further. I also took a look into: ffmpegcv but was not able to get it reading from /dev/video0 . Sadly all the documentations are terrible....
from harmonizeproject.
Related Issues (20)
- Instruction Updates and Corrupt JPEG data HOT 3
- Integration with HomeAssistant
- VIDEOIO ERROR: V4L2: setting property #38 is not supported HOT 6
- Hue App HOT 1
- Can’t connect to the Hue Bridge HOT 2
- Lights Flickering HOT 2
- Build process doesn't seem to work. HOT 13
- does it work on odroid xu4 HOT 1
- Does it works with bulbs also or only ledstrip? HOT 1
- Running harmonize.py line error 15 #14 HOT 2
- Only shows first frame / image then errors out HOT 2
- Option to increase light's brightness HOT 7
- Dead image links in README HOT 2
- [Enhancement] HDMI to CSI adapter HOT 3
- bridge = int(input()) Error (multiple bridges?) HOT 3
- Finds bridge and then doesn't HOT 2
- Harmonize sees the Hue Hub but cannot sync + NameError: name 'baseurl' is not defined HOT 3
- More configuration Values for fine tunig the grapper input HOT 1
- Error with "rgb_bytes" & "w" not defined HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from harmonizeproject.