* Change the API boundary between stream and camera Shift more of the stream lifecycle management to the camera. The motivation is to support stream urls that expire giving the camera the ability to change the stream once it is created. * Document stream lifecycle and simplify stream/camera interaction * Reorder create_stream function to reduce diffs * Increase test coverage for camera_sdm.py * Fix ffmpeg typo. * Add a stream identifier for each stream, managed by camera * Remove stream record service * Update homeassistant/components/stream/__init__.py Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io> * Unroll changes to Stream interface back into camera component * Fix preload stream to actually start the background worker * Reduce unncessary diffs for readability * Remove redundant camera stream start code Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
24 lines
838 B
Python
24 lines
838 B
Python
"""Constants for Stream component."""
|
|
DOMAIN = "stream"
|
|
|
|
ATTR_ENDPOINTS = "endpoints"
|
|
ATTR_STREAMS = "streams"
|
|
|
|
OUTPUT_FORMATS = ["hls"]
|
|
|
|
FORMAT_CONTENT_TYPE = {"hls": "application/vnd.apple.mpegurl"}
|
|
|
|
OUTPUT_IDLE_TIMEOUT = 300 # Idle timeout due to inactivity
|
|
|
|
MAX_SEGMENTS = 3 # Max number of segments to keep around
|
|
MIN_SEGMENT_DURATION = 1.5 # Each segment is at least this many seconds
|
|
|
|
PACKETS_TO_WAIT_FOR_AUDIO = 20 # Some streams have an audio stream with no audio
|
|
MAX_TIMESTAMP_GAP = 10000 # seconds - anything from 10 to 50000 is probably reasonable
|
|
|
|
MAX_MISSING_DTS = 6 # Number of packets missing DTS to allow
|
|
STREAM_TIMEOUT = 30 # Timeout for reading stream
|
|
|
|
STREAM_RESTART_INCREMENT = 10 # Increase wait_timeout by this amount each retry
|
|
STREAM_RESTART_RESET_TIME = 300 # Reset wait_timeout after this many seconds
|