This repository has been archived on 2025-06-01. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
compLIB/compLib/VisionDaemon.py
2021-01-23 02:41:19 +01:00

20 lines
776 B
Python

import os
import systemd.daemon
import LogstashLogging
from LogstashLogging import logstash_logger
import logging
__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\""""
if __name__ == '__main__':
try:
systemd.daemon.notify(systemd.daemon.Notification.READY)
except:
logstash_logger.warning("Warning, old systemd version detected")
systemd.daemon.notify('READY=1')
logging.info("starting gstreamer background process")
os.system(__run)
logstash_logger.error("gstreamer stopped...")