diff --git a/build_deb.sh b/build_deb.sh index 9326730..2daeffb 100644 --- a/build_deb.sh +++ b/build_deb.sh @@ -34,7 +34,7 @@ fpm -s python --python-bin python3 --python-pip pip3 --python-package-name-prefi -d "python3-pigpio" \ -d "python3-numpy" \ -d "ffmpeg" \ - -v 0.0.4-16 -t deb setup.py + -v 0.0.4-17 -t deb setup.py # --deb-changelog changelog \ # --deb-upstream-changelog changelog \ diff --git a/compLib/Vision.py b/compLib/Vision.py index 88937bf..5693198 100644 --- a/compLib/Vision.py +++ b/compLib/Vision.py @@ -47,8 +47,9 @@ class __Streaming: This is done implicitly when importing the vision module and will only fail if you would create an object of this class. (There can (SHOULD!) only be one VideCapture) """ - self.__camera_stream = cv2.VideoCapture(RTMP_SERVER) - # self.__camera_stream = cv2.VideoCapture(0) + Logging.get_logger().info("capturing rtmp stream is disabled in this version") + #self.__camera_stream = cv2.VideoCapture(RTMP_SERVER) + self.__camera_stream = cv2.VideoCapture(0) self.__newest_frame = None self.__lock = threading.Lock() Logging.get_logger().info("Initialized vision") diff --git a/compLib/VisionDaemon.py b/compLib/VisionDaemon.py index 880ecad..f46bf78 100644 --- a/compLib/VisionDaemon.py +++ b/compLib/VisionDaemon.py @@ -16,6 +16,8 @@ except Exception as e: __run = """raspivid -t 0 -b 5000000 -w 1280 -h 720 -fps 30 -n -o - | gst-launch-1.0 fdsrc ! video/x-h264,width=1280,height=720,framerate=30/1,noise-reduction=1,profile=high,stream-format=byte-stream ! h264parse ! queue ! flvmux streamable=true ! rtmpsink location=\"rtmp://localhost/live/stream\"""" +STREAM_RASPI = False if os.getenv("STREAM_RASPI", "false") == "false" else True + def check_battery(): while True: @@ -40,6 +42,7 @@ if __name__ == '__main__': systemd.daemon.notify('READY=1') logstash_logger.info("starting battery checker") + battery_checker = None try: battery_checker = threading.Thread(target=check_battery) battery_checker.start() @@ -47,6 +50,14 @@ if __name__ == '__main__': except Exception as e: logstash_logger.error(f"could not start battery checker -> {str(e)}") - logstash_logger.info("starting gstreamer background process") - os.system(__run) - logstash_logger.error("gstreamer stopped...") + if STREAM_RASPI: + logstash_logger.info("starting gstreamer background process") + os.system(__run) + logstash_logger.error("gstreamer stopped...") + else: + logstash_logger.info("not starting gstreamer background process and only checking for battery") + if battery_checker is not None: + battery_checker.join() + else: + logstash_logger.info("battery checker failed to initialize.. sleeping for a day") + time.sleep(60*60*24) diff --git a/compLib/__init__.py b/compLib/__init__.py index 93dfcc1..8a479bd 100644 --- a/compLib/__init__.py +++ b/compLib/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.0.4-16" +__version__ = "0.0.4-17" import compLib.LogstashLogging import logging diff --git a/setup.py b/setup.py index b78ea6a..34585a6 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ else: setuptools.setup( name="complib", - version="0.0.4-16", + version="0.0.4-17", author="F-WuTs", author_email="--", description="",