Add support for streaming to ffmpeg ()

This commit is contained in:
Paulus Schoutsen 2019-03-29 17:03:02 -07:00 committed by GitHub
parent fbb9097f6c
commit c05bff7d17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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