Add support for streaming to ffmpeg (#22549)
This commit is contained in:
parent
fbb9097f6c
commit
c05bff7d17
1 changed files with 12 additions and 1 deletions
|
@ -9,7 +9,8 @@ import logging
|
|||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
|
||||
from homeassistant.components.camera import (
|
||||
PLATFORM_SCHEMA, Camera, SUPPORT_STREAM)
|
||||
from homeassistant.const import CONF_NAME
|
||||
from homeassistant.helpers.aiohttp_client import async_aiohttp_proxy_stream
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
@ -46,6 +47,16 @@ class FFmpegCamera(Camera):
|
|||
self._input = config.get(CONF_INPUT)
|
||||
self._extra_arguments = config.get(CONF_EXTRA_ARGUMENTS)
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Return supported features."""
|
||||
return SUPPORT_STREAM
|
||||
|
||||
@property
|
||||
def stream_source(self):
|
||||
"""Return the stream source."""
|
||||
return self._input.split(' ')[-1]
|
||||
|
||||
async def async_camera_image(self):
|
||||
"""Return a still image response from the camera."""
|
||||
from haffmpeg.tools import ImageFrame, IMAGE_JPEG
|
||||
|
|
Loading…
Add table
Reference in a new issue