# SRS configuration with Python addons # This demonstrates how to configure Python addons that start with SRS # and terminate when SRS gracefully quits. # The Python addons use SRS's built-in Python environment created during compilation. listen 1935; max_connections 1000; daemon off; srs_log_tank console; pid ./objs/srs.python.pid; # Python addon configuration python_addons { # Enable or disable Python addon management enabled on; # Python addon definitions # Each addon block defines a Python script to run addon { # Script path relative to SRS working directory script "./python/monitor.py"; # Command line arguments (optional) args "--config ./conf/python.conf --verbose"; # Working directory (optional, defaults to SRS working directory) work_dir "./"; } addon { script "./python/analytics.py"; args "--port 8888"; } addon { script "./python/http_addon.py"; args "--port 9999 --verbose"; } } http_api { enabled on; listen 1985; } http_server { enabled on; listen 8080; dir ./objs/nginx/html; } vhost __defaultVhost__ { enabled on; gop_cache on; hls { enabled on; hls_path ./objs/nginx/html; hls_fragment 5; hls_window 30; } http_hooks { enabled on; on_publish http://127.0.0.1:8085/api/v1/streams; on_unpublish http://127.0.0.1:8085/api/v1/streams; } }