Specify rtsp_transport for Onvif Camera (#31918)
* specify rtsp_transport for onvif camera * remove used variable * Update homeassistant/components/stream/__init__.py Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io> * change options to stream_options Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
ac945242dc
commit
e1cc2acdf9
3 changed files with 33 additions and 11 deletions
|
@ -50,13 +50,12 @@ def request_stream(hass, stream_source, *, fmt="hls", keepalive=False, options=N
|
|||
options = {}
|
||||
|
||||
# For RTSP streams, prefer TCP
|
||||
if (
|
||||
isinstance(stream_source, str)
|
||||
and stream_source[:7] == "rtsp://"
|
||||
and not options
|
||||
):
|
||||
options["rtsp_flags"] = "prefer_tcp"
|
||||
options["stimeout"] = "5000000"
|
||||
if isinstance(stream_source, str) and stream_source[:7] == "rtsp://":
|
||||
options = {
|
||||
"rtsp_flags": "prefer_tcp",
|
||||
"stimeout": "5000000",
|
||||
**options,
|
||||
}
|
||||
|
||||
try:
|
||||
streams = hass.data[DOMAIN][ATTR_STREAMS]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue