Code Monkey home page Code Monkey logo

harmonizeproject's Introduction

Harmonize Project for Philips Hue

PRs Welcome Open Source Love

Harmonize Project connects Philips Hue lights and lightstrips to your TV screen content, creating an amazing ambient lighting effect! This application utilizes a low-latency video and color analysis built with Python 3.

Check out our Reddit thread here and watch the demo below! Electromaker explains how our application works at a high level in his podcast here!

Harmonize Project Demo Video

Harmonize Project (formerly known as Harmonize Hue) has no affiliation with Signify or Philips Hue. Hue and Philips Hue are trademarks of Signify.

New Features

  • v2.3: Added support to adjust maximum brightness
  • v2.2: Support for webcam stream input via file/URL
  • v2.1: Support for multiple Hue bridges
  • v2.0: Support for gradient lightstrips is now available!
  • v1.3: Added multicast DNS discovery for detecting bridge
  • v1.2: Latency now optimized for a single light source centered behind display (use the -s argument at the command prompt to enable)

Thank you to all those who have contributed to this project. Please keep your pull requests coming!

Features

  • Light color and intensity follows relative location to the display perimeter
  • Video -> Light streaming latency of 80ms
  • Approximately 60 color updates per second

Requirements

Lights:

  • Minimum of one compatible Hue light required (obviously). Limited to a maximum of 20 lights for streaming. A gradient lightstrip counts as 7 lights.

Minimum Hardware:

  • Hue bridge using firmware version 194808600 or greater
  • Raspberry Pi 4B/3B/Zero or Linux box running at 1.5GHz+ with at least 4 CPU cores (tested on Ubuntu 22.04 64-bit LTS). The RPi 4B will exhibit optimal performance at 1080p resolution. Good performance can be achieved on the RPi 3B and Zero with minimal tweaking to lower frame rates (~10 FPS for the Zero) and video resolutions.
  • HDMI video capture card or Webcam input device (ex. https://github.com/silvanmelchior/RPi_Cam_Web_Interface)

Example Hardware configuration (tested successfully unless otherwise noted below):

  • RPi RAM: minimum of 256MB free (512MB free RAM recommended)
  • RPi CPU: 1.5GHz+, 4 Cores strongly recommended due to running three concurrent threads
  • Rpi power input: use recommended power supply and wattage requirements
  • HDMI Splitter capable of outputting 4k and 1080/720p simultaneously, such as the AVSTAR 4K HDMI 2.0 Splitter 1X2. A/V receivers with 2 or more HDMI outputs may also be considered.
  • USB3.0 HDMI Capture Card (Capable of capturing 720/1080p; delay should be 50ms or under.) Tested successfully on the WIIStar Also tested successfully on the Elgato Cam Link 4k. The following are untested: Panoraxy | Aliexpress (This shape/style tends to perform well.)

Setup

Software Setup:

Ubuntu Desktop 22.04 LTS 64-bit with Python v3.10.4 (most recent version tested)

Install OS from Raspberry Pi Imager software onto SD card (see https://www.raspberrypi.org/software/). Install SD card and boot.

Install all dependencies via the following commands. Be sure to watch for errors!

  • Install pip:
sudo apt-get install python3-pip
  • Install HTTP Parser, NumPy, and zerconf Python dependencies via pip:
pip3 install http-parser numpy zeroconf termcolor
  • Install Snap:
sudo apt install snapd
  • Install Avahi (multicast DNS daemon):
sudo snap install avahi
  • Install Screen (SSH multiple window manager):
sudo apt install screen
sudo apt-get install cmake
sudo apt-get install gcc g++
sudo apt-get install python3-dev python3-numpy libpython3-all-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev
sudo apt-get install libgtk-3-dev
sudo apt-get install git
git clone https://github.com/opencv/opencv.git
mkdir opencv/build
cd opencv/build
cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_opencv_java=OFF -D BUILD_opencv_python2=OFF -D BUILD_opencv_python3=ON -D PYTHON_DEFAULT_EXECUTABLE=$(which python3) -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_CUDA=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF ..
make -j4
sudo make install
cd ../..
git clone https://github.com/MCPCapital/HarmonizeProject.git

Legacy Software Setup (currently unsupported and not maintained):

Download the latest scripts and install all dependencies via the following commands. Be sure to watch for errors! You will need about 1GB of free space. The script can run for up to an hour.

git clone https://github.com/MCPCapital/HarmonizeProject.git
cd HarmonizeProject
sudo ./setup.sh

Hardware Setup Example A:

  • Connect Video Device (PS4, FireStick, etc.) to the splitter input.
  • Connect an HDMI cable from the 4k output to the TV; and from Output 2 (downscaled) to the video capture card connected to your device.
  • Ensure your splitter's switches are set to downscale Output 2 to 1080 or 720p!
  • Connections diagram

Hardware Setup Example B (for A/V receivers with 2 or more HDMI outputs):

  • Connect your video device (PS4, FireStick, etc.) to an available HDMI input on your A/V receiver.
  • Connect an HDMI cable from the HDMI output 1 from A/V receiver to the TV.
  • Connect an HDMI cable from HDMI output 2 from the receiver to the HDMI input on the splitter.
  • Connect an HDMI cable from the HDMI output 1 of the splitter to the HDMI input on the video capture device.
  • Connect the video capture device USB 3.0 output to a USB 3.0 port (not a USB 2.0 port) on the Raspberry Pi.
  • Ensure that the DIP switches on the splitter are set to downscale HDMI Output 1 to 1080 or 720p.

Entertainment Area Configuration:

  • Hue App -> Settings -> Entertainment Areas
  • Harmonize will use the height and the horizontal position of lights in relation to the TV. The depth/vertical position are currently ignored.
  • In the example below, the light on the left is to the left of the TV at the bottom of it. The light on the right is on the right side of the TV at the top of it.

First-Time Run Instructions:

  • If you have not set up a bridge before, the program will attempt to register you on the bridge. You will have 60 seconds to push the button on the bridge.
  • If multiple bridges and/or entertainment areas are found, you will be given the option to select one or use the command line arguments.

Usage

To start the program:

  • screen
  • cd HarmonizeProject
  • ./harmonize.py
  • Type Ctrl+A and Ctrl-D to continue running the script in the background.
  • To resume the terminal session use screen -r
  • Press ENTER to safely stop the program.

Command line arguments:

  • -v Display verbose output
  • -g # Use specific Entertainment area group number (#)
  • -b <id> Use specified bridge ID
  • -i <ip> Use specified bridge IP address
  • -s Enable latency optimization for single light source centered behind display
  • -w # Sets the video device wait time to the specified value, in seconds. Defaults to 0.75.
  • -f <file/url> Use the specified file or URL video stream instead of a video device.
  • -l [0-255] Decrease brightness from 0 to 255 (0 is maximum brightness, default is 30).

Configurable values within the script: (Advanced users only)

  • Line 293 - breadth - determines the % from the edges of the screen to use in calculations. Default is 15%. Lower values can result in less lag time, but less color accuracy.
  • Line 380 - time.sleep(0.015) - Determines how frequently messages are sent to the bridge. Keep in mind the rest of the function takes some time to run in addition to this sleep command. Bridge requests are capped by Philips at a rate of 60/s (1 per ~16.6ms) and the excess are dropped.
  • Utilize the nice command to give Harmonize higher priority over other CPU tasks.

Troubleshooting

  • "Import Error" - Ensure you have all the dependencies installed. Run through the manual dependency install instructions above.
  • No video input // lights are all dim gray - Run python3 ./videotest.py to see if your device (via OpenCV) can properly read the video input.
  • w, h, or rgbframe not defined - Increase the waiting time from the default 0.75 seconds by passing the -w argument *This is a known bug (race condition).
  • python3-opencv installation fails - Compile from source - Follow this guide.
  • Sanity check: The output of the command ls -ltrh /dev/video* should provide a list of results that includes /dev/video0 when the OS properly detects the video capture card.
  • Many questions are answered on our Reddit release thread here. New issues should be raised on Github.

Contributions & License

Pull requests are encouraged and accepted! Whether you have some code changes or enhancements to the readme, feel free to open a pull request. Harmonize Project is licensed under The Creative Commons Attribution-NonCommercial 4.0 International Public License.

Development credits to Matthew C. Pilsbury (MCP Capital LLC), Ares N. Vlahos, and Brad Dworak.

licensebuttons by-nc

harmonizeproject's People

Contributors

analyticeth avatar apoorvprecisely avatar bradleydworak avatar cavus700 avatar lvlyke avatar mcpcapital avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

harmonizeproject's Issues

Can’t connect to the Hue Bridge

Hi,

I cannot seem to connect to my hue hub, I get the below error:

pi@raspberrypi:~/HarmonizeProject $ python3 ./harmonize.py
I will use the bridge at 192.168.5.24
Hue bridge not found. Mission failed, better luck next time

originally my hue hub was in 192.168.4.206, it’s all on the same network but I switched it and cleared the pi cache. I have also done it on a brand new install.

I noticed a closed issue where someone suggests deleting the config.json file but I do not have the file.

Any ideas would be appreciated.

More configuration Values for fine tunig the grapper input

Hey great script.

i use it on a raspberry 3b with a LogiLink Audio und Video Grabber USB 2.0

my questions is there a way to input more code for fine tuning to the script like values for:

  • cropping
  • saturation
  • contrast
  • brightness

thx

bridge = int(input()) Error (multiple bridges?)

Hello,
I get the error:

"File "./harmonize.py", line 28, in

import mbedtls

File "/usr/local/lib/python3.7/dist-packages/mbedtls/init.py", line 8, in

import mbedtls.cipher as cipher

File "/usr/local/lib/python3.7/dist-packages/mbedtls/cipher/init.py", line 12, in

from . import AES, ARC4, ARIA, CHACHA20, DES, DES3, Blowfish, Camellia, DES3dbl

File "/usr/local/lib/python3.7/dist-packages/mbedtls/cipher/AES.py", line 11, in

from mbedtls.exceptions import TLSError

ModuleNotFoundError: No module named 'mbedtls.exceptions'"

Maybe you can help me

Option to increase light's brightness

Wanted to know if there's an option or a parameter one can tweak to increase the intensity of light through the script. It works great ofcourse but I've noticed that the lights are dimmer compared to the app version of hue sync. Apologies if this is something obvious that I'm missing.

Instruction Updates and Corrupt JPEG data

Following up from #7 (comment)

In the instructions, there are some missing steps.
change cd harmonizeproject to cd HarmonizeProject
after sudo ./setup.sh you will need to give executable rights to ./harmonize.py
run - ls -la
If there is an X missing from harmonize.py then run the following:
sudo chmod +x harmonize.py

If you run ls -la, you'll see the file is now executable

now run sudo ./harmonize.py

I was looking at the trace and noticed a lot of corrupt jpeg data

LAstly, when I try to re-run the .py I get this error

sudo ./harmonize.py
I will use the bridge at 192.168.1.7
Hue bridge not found. Mission failed, better luck next time
pi@raspberrypi:~/HarmonizeProject $


WHEN IT DOES RUN I GOT THIS ERROR

You selected groupid 4
VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
Unable to stop the stream: Device or resource busy
Press return to stopException in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "./harmonize.py", line 226, in averageimage
coords[0] = ((coords[0])+1) * w//2 #Translates x value and resizes to video aspect ratio
NameError: name 'w' is not defined

Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "./harmonize.py", line 309, in buffer_to_light
for i in rgb_bytes:
NameError: name 'rgb_bytes' is not defined

OpenCV and Mbedtls Errors

Originally reported by Unknown {Restoring old issues}

"Hello, I am trying to install this on my PI4 using Rasbian Buster Lite OS but it seems to encounter a lot of missing dependencies. What OS should I be using? I already purchased a HDMI - USB capture card but have been having difficulties getting this thing to run. Any help would be appreciated. Thanks"

Harmonize sees the Hue Hub but cannot sync + NameError: name 'baseurl' is not defined

Opened by @Bboy486 on August 13th

This is two issues in one. One is fixed.

1- The project sees the hue hub and when I press the button (or hold it down) I get an error that it has timed out have a nice day (something like that). I had to
cd harmonizeproject
and install from the folder.

2- After I did that I was able to add my hub. But I did receive the error below.
Success! I generated a username and client key to access the bridge's Entertainment API!
Traceback (most recent call last):
File "./harmonize.py", line 143, in
r = requests.get(url = baseurl+"/config")
NameError: name 'baseurl' is not defined

Build process doesn't seem to work.

I have attempted both paths you list on a Raspberry Pi running Ubuntu 20.04 and neither build path produces a harmonize.py that starts.

Can you confirm that both install processes have been tested recently? I'm trying to understand why I'm having such trouble, given that you seem to have very clear instructions (they were easy to follow).

There are a couple packages that it says it can't find (when running your install script) so I don't know if they've been recently retired/changed or not. That's why I want to confirm that the install approaches have been tried recently from a clean install of the OS (that's where I started from)

Thanks!

Hue App

Hello,
I have implemented everything so far and it runs flawlessly. Only I do not know where to open the Hue app. Where and what do I have to do?
Thanks in advance!

module v4l2src0 reported: Internal data stream error.

Hey,
I had this running on raspberryos for more than a year. Used it almost daily. I wanted to bump it to the latest version and I got this error. I started completely from scratch with a clean ubuntu server install on the rpi4. Same hardware that worked before.
After adding my user to the video group I was finally getting video, but not in the script.
I see the Input on videotest.py (installed gnome and used xforwarding...) but its showing the warning. Harmonize script itself wont work.

lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID eba4:7588 USB3.0 HD Audio Capture USB3.0 HD Video Capture
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
v4l2-ctl -D
Driver Info:
        Driver name      : uvcvideo
        Card type        : USB3.0 HD Video Capture: USB3.0
        Bus info         : usb-0000:01:00.0-1.1
        Driver version   : 5.15.64
        Capabilities     : 0x84a00001
                Video Capture
                Metadata Capture
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x04200001
                Video Capture
                Streaming
                Extended Pix Format
Media Driver Info:
        Driver name      : uvcvideo
        Model            : USB3.0 HD Video Capture: USB3.0
        Serial           : HU123450
        Bus info         : usb-0000:01:00.0-1.1
        Media version    : 5.15.64
        Hardware revision: 0x00000328 (808)
        Driver version   : 5.15.64
Interface Info:
        ID               : 0x03000002
        Type             : V4L Video
Entity Info:
        ID               : 0x00000001 (1)
        Name             : USB3.0 HD Video Capture: USB3.0
        Function         : V4L2 I/O
        Flags            : default
        Pad 0x01000007   : 0: Sink
          Link 0x02000010: from remote pad 0x100000a of entity 'Processing 3' (Video Pixel Formatter): Data, Enabled, Immutable
v4l2-ctl --info -d /dev/video0 --list-formats-ext
Driver Info:
        Driver name      : uvcvideo
        Card type        : USB3.0 HD Video Capture: USB3.0
        Bus info         : usb-0000:01:00.0-1.1
        Driver version   : 5.15.64
        Capabilities     : 0x84a00001
                Video Capture
                Metadata Capture
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x04200001
                Video Capture
                Streaming
                Extended Pix Format
Media Driver Info:
        Driver name      : uvcvideo
        Model            : USB3.0 HD Video Capture: USB3.0
        Serial           : HU123450
        Bus info         : usb-0000:01:00.0-1.1
        Media version    : 5.15.64
        Hardware revision: 0x00000328 (808)
        Driver version   : 5.15.64
Interface Info:
        ID               : 0x03000002
        Type             : V4L Video
Entity Info:
        ID               : 0x00000001 (1)
        Name             : USB3.0 HD Video Capture: USB3.0
        Function         : V4L2 I/O
        Flags            : default
        Pad 0x01000007   : 0: Sink
          Link 0x02000010: from remote pad 0x100000a of entity 'Processing 3' (Video Pixel Formatter): Data, Enabled, Immutable
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'MJPG' (Motion-JPEG, compressed)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 960x540
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 800x450
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
python3 videotest.py
Press ESC to exit.
[ WARN:0] global ./modules/videoio/src/cap_gstreamer.cpp (2075) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error.
[ WARN:0] global ./modules/videoio/src/cap_gstreamer.cpp (1053) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global ./modules/videoio/src/cap_gstreamer.cpp (616) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
./harmonize.py -v
--- Starting Harmonize Project ---
INFO: Detected Philips Hue - 6D35D3._hue._tcp.local. via mDNS at IP address: 172.17.172.8
INFO: Single Hue bridge detected on network via mDNS.
INFO: Hue bridge located at: 172.17.172.8
Checking whether Harmonizer application is already registered (Looking for client.json file).
INFO: Client data found from client.json file.
INFO: Client data valid: {'username': 'XXXXXXXXXXXXXXXX', 'clientkey': 'XXXXXXXXXXXXXXXXXXXXXXXX'}
Requesting bridge information...
INFO: The bridge is capable of streaming via APIv2. Firmware version 1955082050 detected...
Querying hue bridge for entertainment areas on local network.
groupid =  7
Using Entertainment area with group_id: 7
Selected Entertainment UDID: XXXXXXXXXXXXXXXXXXXXXXXX
INFO: 5 light(s) found in selected Entertainment area. Locations [x,y,z] are as follows:
 {'0': [-0.93, -0.28, 0.0], '1': [1.0, 0.43, 1.0], '2': [-1.0, 0.92, 0.0], '3': [0.95999, 0.68997, 0.0], '4': [0.91, 0.97, 0.0]}
Hue application id: 3c90b91a-6f58-4272-ae4b-987a6257ba27
Enabling streaming to your Entertainment area
{'data': [{'rid': 'XXXXXXXXXXXXXXXXXXXXXXX', 'rtype': 'entertainment_configuration'}], 'errors': []}
Starting computer vision engine...
OpenCV version: 4.5.4
--- INFO: Detected video capture card on /dev/video0 ---
[ WARN:0] global ./modules/videoio/src/cap_gstreamer.cpp (2075) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error.
[ WARN:0] global ./modules/videoio/src/cap_gstreamer.cpp (1053) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global ./modules/videoio/src/cap_gstreamer.cpp (616) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Disabling streaming on Entertainment area...
{'data': [{'rid': 'XXXXXXXXXXXXXXXXXXXXXXXX', 'rtype': 'entertainment_configuration'}], 'errors': []}
ERROR: Unable to open capture device.

VIDEOIO ERROR: V4L2: setting property #38 is not supported

After selecting groupid, VIDEOIO ERROR: V4L2: setting property #38 is not supported

pi@raspberrypi:~/HarmonizeProject $ v4l2-ctl --list-devices
bcm2835-codec-decode (platform:bcm2835-codec):
/dev/video10
/dev/video11
/dev/video12

bcm2835-isp (platform:bcm2835-isp):
/dev/video13
/dev/video14
/dev/video15
/dev/video16

USB3.0 HD VIDEO: USB3.0 HD VIDE (usb-3f980000.usb-1.4):
/dev/video0
/dev/video1


[video4linux2,v4l2 @ 0x5dd1c0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480
[video4linux2,v4l2 @ 0x5dd1c0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480

Error with "rgb_bytes" & "w" not defined

Error Log:

Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "harmonize.py", line 226, in averageimage
coords[0] = ((coords[0])+1) * w//2 #Translates x value and resizes to video aspect ratio
NameError: name 'w' is not defined

Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "harmonize.py", line 309, in buffer_to_light
for i in rgb_bytes:
NameError: name 'rgb_bytes' is not defined

Got the same error using sudo and without.
changed the time at line 329/331 but still got the "w not defined" error

setup:
raspberry pi zero (got same error on Raspberry Pi 3b)
Roxio game capture

afbeelding

Only shows first frame / image then errors out

I always get this error,
Script connects successfully, turns Hue Gradient dark and then shows colors of picture / first frame.

python3 harmonize.py -g 2 -i a.b.c.d -f bigbuckbunny.mp4

Then this shows up:

  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.9/threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "/HarmonizeProject/harmonize.py", line 378, in cv2input_to_buffer
    rgbframe = cv2.cvtColor(bgrframe, cv2.COLOR_BGR2RGB) #corrects BGR to RGB
cv2.error: OpenCV(4.5.1) ../modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'```



[Enhancement] HDMI to CSI adapter

Originally opened by @spapadim on August 4th 2020:
"Very cool and inspiring project! Always wanted one of these, but off-the-shelf prices are ridiculous..

First thing that immediately came to mind when I saw this: would this work with an HDMI-to-CSI adapter, such as eg https://www.amazon.com/dp/B0899L6ZXZ/ref=cm_sw_r_cp_apa_i_edwkFbJ7V4HT2 ?

Tl;dr: with GPU-accelerated frame processing, I'm hoping this could run even on a Zero..! :)

Other than potentially reducing cost a little bit (CSI adapter vs USB capture), the main advantage is that video downscaling (to compute average color intensities around border) could be offloaded to Pi's GPU (eg, see picamera Python module docs on "advanced configurations" -- GPU can even compute motion vector data quite efficiently, let alone just do pixel averaging). This could possibly allow the use of a smaller Pi, perhaps even a Zero, which would then really reduce cost.

The converters' frame rate is relatively low ("up to" 25fps), but I don't believe this matters here.

The only real catch is that these converters don't do HDCP. But, perhaps, if there is a reasonably priced splitter that can also do HDCP stripping on lower-res port..

I just wish my TV could do full HDMI pass-through (not just ARC to receiver but, eg, for chaining a second monitor), or my receiver could route to both zone's HDMI outputs simultaneously (rather than switching video and splitting just audio), but both of these features seem to be exceedingly rare.. sigh!

Finally, apologies in advance if using an issue for general commenting was inappropriate (feel free to close/delete, of so) -- but just my 2c. I'll probably take this up myself when (if?) I find some time."

Harmonizeproject detailed coding directions

Originally reported by @restorept {Restoring old issues}

"Hello. I'm a beginner with Raspberry Pi. It is up and running properly. Wondering if there are specific step-by-step instructions for beginners. I have all the hardware necessary to complete this project but need specific step-by-step instructions on where to enter the coding within Raspberry Pi. Any help is most appreciated. Thank you!"

Finds bridge and then doesn't

I get this message after a few seconds:

I will use the bridge at  192.168.1.75
Hue bridge not found. Mission failed, better luck next time

After it finds the bridge it only gives a few seconds to push the button (it never asks me to though - not sure if it is supposed to), but then it just says the bridge isn't found.

Any help would be appreciated.

Lights Flickering

Hey not sure if this is an issue that can be resolved with the program or if it’s a HW issue but my Hue lights flicker even when the scene on the tv isn’t changing. Please see attached video.

Integration with HomeAssistant

Hello there. Yesterday I started setting up the harmonize project in my house. I bought everything I needed and after many hours of work I managed to make it work, I am very happy with the result. But the fact that I have to manually launch the harmonize.py file bothers me a lot as I have the whole house automated. So I installed supervised home assistant in a container on the raspberry itself and am trying in vain to integrate it. I tried with shell command but it constantly gives me error, probably because harmonize is in the root of the raspberry while home assistant is in the container. Is there any way to integrate and make these two software work together?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.