Add H.265 support to stream component (#38125)

* Add H.265 support to stream component

* Change find_box to generator

* Move fmp4 utilities to fmp4utils.py

* Add minimum segments and segment durations

* Remove MIN_SEGMENTS

* Fix when container_options is None

* Fix missing num_segments and update tests

* Remove unnecessary mock attribute

* Fix Segment construction in test_recorder_save

* fix recorder with lookback

Co-authored-by: Jason Hunter <hunterjm@gmail.com>
This commit is contained in:
uvjustinandJason Hunter authored and GitHub committed 2020-08-11 17:12:41 -04:00
1 parent d0a59e28ac
commit 5355fcaba8
11 files changed
+169 -51

No files matched your search

+2 -1
View File
@@ -18,6 +18,7 @@ from .const import (
CONF_LOOKBACK,
CONF_STREAM_SOURCE,
DOMAIN,
MAX_SEGMENTS,
SERVICE_RECORD,
)
from .core import PROVIDERS
@@ -225,7 +226,7 @@ async def async_handle_record_service(hass, call):
# Take advantage of lookback
hls = stream.outputs.get("hls")
if lookback > 0 and hls:
num_segments = min(int(lookback // hls.target_duration), hls.num_segments)
num_segments = min(int(lookback // hls.target_duration), MAX_SEGMENTS)
# Wait for latest segment, then add the lookback
await hls.recv()
recorder.prepend(list(hls.get_segment())[-num_segments:])