Add use_wallclock_as_timestamps option to generic (#71245)

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
uvjustin
2022-05-13 07:43:24 +08:00
committed by GitHub
parent a746d7c1d7
commit 7e49ae6410
6 changed files with 67 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ from .const import (
CONF_RTSP_TRANSPORT,
CONF_STILL_IMAGE_URL,
CONF_STREAM_SOURCE,
CONF_USE_WALLCLOCK_AS_TIMESTAMPS,
DEFAULT_NAME,
FFMPEG_OPTION_MAP,
GET_IMAGE_TIMEOUT,
@@ -160,6 +161,10 @@ class GenericCamera(Camera):
CONF_RTSP_TRANSPORT
]
self._auth = generate_auth(device_info)
if device_info.get(CONF_USE_WALLCLOCK_AS_TIMESTAMPS):
self.stream_options[
FFMPEG_OPTION_MAP[CONF_USE_WALLCLOCK_AS_TIMESTAMPS]
] = "1"
self._last_url = None
self._last_image = None