2019-03-12 02:57:10 +00:00
|
|
|
"""Constants for Stream component."""
|
2019-07-31 19:25:30 +00:00
|
|
|
DOMAIN = "stream"
|
2019-03-12 02:57:10 +00:00
|
|
|
|
2021-02-20 14:49:39 +00:00
|
|
|
ATTR_ENDPOINTS = "endpoints"
|
2021-08-29 01:53:41 +00:00
|
|
|
ATTR_SETTINGS = "settings"
|
2019-07-31 19:25:30 +00:00
|
|
|
ATTR_STREAMS = "streams"
|
2019-03-28 04:47:07 +00:00
|
|
|
|
2021-05-27 03:22:31 +00:00
|
|
|
HLS_PROVIDER = "hls"
|
|
|
|
RECORDER_PROVIDER = "recorder"
|
|
|
|
|
|
|
|
OUTPUT_FORMATS = [HLS_PROVIDER]
|
2019-03-12 02:57:10 +00:00
|
|
|
|
2021-02-23 02:37:19 +00:00
|
|
|
SEGMENT_CONTAINER_FORMAT = "mp4" # format for segments
|
|
|
|
RECORDER_CONTAINER_FORMAT = "mp4" # format for recorder output
|
|
|
|
AUDIO_CODECS = {"aac", "mp3"}
|
|
|
|
|
2021-05-27 03:22:31 +00:00
|
|
|
FORMAT_CONTENT_TYPE = {HLS_PROVIDER: "application/vnd.apple.mpegurl"}
|
2019-03-12 02:57:10 +00:00
|
|
|
|
2021-02-08 15:19:41 +00:00
|
|
|
OUTPUT_IDLE_TIMEOUT = 300 # Idle timeout due to inactivity
|
|
|
|
|
2021-02-10 20:51:16 +00:00
|
|
|
NUM_PLAYLIST_SEGMENTS = 3 # Number of segments to use in HLS playlist
|
2021-06-13 16:41:21 +00:00
|
|
|
MAX_SEGMENTS = 5 # Max number of segments to keep around
|
2021-08-29 01:53:41 +00:00
|
|
|
TARGET_SEGMENT_DURATION_NON_LL_HLS = 2.0 # Each segment is about this many seconds
|
2021-05-28 05:36:41 +00:00
|
|
|
SEGMENT_DURATION_ADJUSTER = 0.1 # Used to avoid missing keyframe boundaries
|
2021-05-30 03:41:23 +00:00
|
|
|
# Number of target durations to start before the end of the playlist.
|
|
|
|
# 1.5 should put us in the middle of the second to last segment even with
|
|
|
|
# variable keyframe intervals.
|
2021-08-29 01:53:41 +00:00
|
|
|
EXT_X_START_NON_LL_HLS = 1.5
|
|
|
|
# Number of part durations to start before the end of the playlist with LL-HLS
|
|
|
|
EXT_X_START_LL_HLS = 2
|
|
|
|
|
2020-08-20 03:18:54 +00:00
|
|
|
|
|
|
|
PACKETS_TO_WAIT_FOR_AUDIO = 20 # Some streams have an audio stream with no audio
|
2020-09-30 15:45:59 +00:00
|
|
|
MAX_TIMESTAMP_GAP = 10000 # seconds - anything from 10 to 50000 is probably reasonable
|
2020-10-25 02:55:12 +00:00
|
|
|
|
|
|
|
MAX_MISSING_DTS = 6 # Number of packets missing DTS to allow
|
2021-05-30 03:41:23 +00:00
|
|
|
SOURCE_TIMEOUT = 30 # Timeout for reading stream source
|
2020-11-11 17:32:56 +00:00
|
|
|
|
|
|
|
STREAM_RESTART_INCREMENT = 10 # Increase wait_timeout by this amount each retry
|
|
|
|
STREAM_RESTART_RESET_TIME = 300 # Reset wait_timeout after this many seconds
|
2021-08-29 01:53:41 +00:00
|
|
|
|
|
|
|
CONF_LL_HLS = "ll_hls"
|
|
|
|
CONF_PART_DURATION = "part_duration"
|
|
|
|
CONF_SEGMENT_DURATION = "segment_duration"
|
2022-05-15 06:31:18 +00:00
|
|
|
|
|
|
|
CONF_PREFER_TCP = "prefer_tcp"
|
|
|
|
CONF_RTSP_TRANSPORT = "rtsp_transport"
|
|
|
|
# The first dict entry below may be used as the default when populating options
|
|
|
|
RTSP_TRANSPORTS = {
|
|
|
|
"tcp": "TCP",
|
|
|
|
"udp": "UDP",
|
|
|
|
"udp_multicast": "UDP Multicast",
|
|
|
|
"http": "HTTP",
|
|
|
|
}
|
|
|
|
CONF_USE_WALLCLOCK_AS_TIMESTAMPS = "use_wallclock_as_timestamps"
|
2022-06-16 15:48:52 +00:00
|
|
|
CONF_EXTRA_PART_WAIT_TIME = "extra_part_wait_time"
|