Add a TCP timeout of 5 seconds to ffmpeg (#23617)

Add a TCP timeout of 5 seconds to ffmpeg to fix stream getting stuck when network connectivity is lost
https://github.com/home-assistant/home-assistant/issues/22741
This commit is contained in:
droopanu 2019-05-06 12:59:56 +12:00 committed by Jason Hunter
parent 3e59e7f347
commit f87209605b

View File

@ -53,6 +53,7 @@ def request_stream(hass, stream_source, *, fmt='hls',
if isinstance(stream_source, str) \ if isinstance(stream_source, str) \
and stream_source[:7] == 'rtsp://' and not options: and stream_source[:7] == 'rtsp://' and not options:
options['rtsp_flags'] = 'prefer_tcp' options['rtsp_flags'] = 'prefer_tcp'
options['stimeout'] = '5000000'
try: try:
streams = hass.data[DOMAIN][ATTR_STREAMS] streams = hass.data[DOMAIN][ATTR_STREAMS]