ddetommaso / TobiiGlassesPyController

Tobii Pro Glasses 2 Python controller
GNU General Public License v3.0
56 stars 28 forks source link

IPV6 Video Support #25

Closed AmyPhung closed 3 years ago

AmyPhung commented 3 years ago

Hello, thank you for sharing the code in this repo! I'm trying to run the live_scene.py example, but since my hardware doesn't support WLAN I've needed to use the IPV6 address instead of the IPV4 one. I edited the script to include these lines:

address = "fe80::..." # I put my actual ipv6 address here
cap = cv2.VideoCapture("rtsp://[%s]:8554/live/scene" % address)

Which results in the following error at the cap = cv2.VideoCapture... line: (I omitted my address here but it does show up in the original error message)

[ERROR:0] global /home/amy/opencv-master/modules/videoio/src/cap.cpp (142) open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.5.0-dev) /home/amy/opencv-master/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): rtsp://[fe80:...]:8554/live/scene in function 'icvExtractPattern'

Error opening video stream or file

Do you know how to fix this? Thanks in advance!

ddetommaso commented 3 years ago

Hi @AmyPhung

as far as I know for video streaming the only way of using LAN is with IPv4 protocol. So, you need to configure a DHCP server in your host machine and the eyetracker at the bootstrap will get the assigned IPv4 address. Then, you will be able to use video and data streaming.

If you are familiar with docker I recently created a docker container that include the DHCP server as well. Please check out https://github.com/ddetommaso/TobiiGlassesPyController/tree/master/docker

AmyPhung commented 3 years ago

Putting this here in case others find it helpful - I ended up getting this to work by connecting both my PC and the glasses to a router, then using the IP address the router assigned to the glasses.