mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Clarify stream documentation (#17506)
Co-authored-by: Franck Nijhof <git@frenck.dev> Co-authored-by: uvjustin <46082645+uvjustin@users.noreply.github.com>
This commit is contained in:
parent
bd0622d331
commit
ef4f13ae06
@ -13,52 +13,20 @@ ha_codeowners:
|
||||
ha_domain: stream
|
||||
---
|
||||
|
||||
The `stream` integration provides a way to proxy live streams through Home Assistant. The integration currently only supports proxying H.264 source streams to the HLS format and requires at least FFmpeg >= 4.
|
||||
The stream integration provides a way to proxy live streams through Home Assistant. Most users should not need to configure anything or interface with the component directly since it is an internal component used by the [camera integration](/integrations/camera).
|
||||
|
||||
## Configuration
|
||||
|
||||
To enable this component, add the following lines to your `configuration.yaml` file:
|
||||
The `stream` integration is automatically loaded by `default_config` and enabled by the `camera` platforms that support it. If `default_config` is used, no separate `configuration.yaml` entry is necessary. If `default_config` is not used, the `stream` integration can be activated with the entry below:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
# Example configuration.yaml entry. There are no additional options.
|
||||
stream:
|
||||
```
|
||||
|
||||
### Services
|
||||
## Technical Details
|
||||
|
||||
Once loaded, the `stream` platform will expose services that can be called to perform various actions.
|
||||
|
||||
#### Service `record`
|
||||
|
||||
Make a `.mp4` recording from a provided stream. While this service can be called directly, it is used internally by the [`camera.record`](/integrations/camera#service-record) service.
|
||||
|
||||
Both `duration` and `lookback` options are suggestions, but should be consistent per stream. The actual length of the recording may vary. It is suggested that you tweak these settings to fit your needs.
|
||||
|
||||
| Service data attribute | Optional | Description |
|
||||
| ---------------------- | -------- | ----------- |
|
||||
| `stream_source` | no | The input source for the stream, e.g., `rtsp://my.stream.feed:554`. |
|
||||
| `filename` | no | The file name string. e.g., `/tmp/my_stream.mp4`. |
|
||||
| `duration` | yes | Target recording length (in seconds). Default: 30 |
|
||||
| `lookback` | yes | Target lookback period (in seconds) to include in addition to duration. Only available if there is currently an active HLS stream for `stream_source`. Default: 0 |
|
||||
|
||||
The path part of `filename` must be an entry in the `allowlist_external_dirs` in your [`homeassistant:`](/docs/configuration/basic/) section of your `configuration.yaml` file.
|
||||
|
||||
For example, the following action in an automation would take a recording from `rtsp://my.stream.feed:554` and save it to `/config/www`.
|
||||
|
||||
```yaml
|
||||
action:
|
||||
service: camera.record
|
||||
target:
|
||||
entity_id: camera.quintal
|
||||
data:
|
||||
filename: "/config/www/my_stream.mp4"
|
||||
duration: 30
|
||||
```
|
||||
|
||||
## Streaming in Lovelace
|
||||
|
||||
As of Home Assistant version 0.92 you can now live-stream a camera feed directly in lovelace.
|
||||
To do this add either [picture-entity](/lovelace/picture-entity/), [picture-glance](/lovelace/picture-glance/) or [picture-elements](/lovelace/picture-elements/), set `camera_image` to a stream-ready camera entity and set `camera_view` to `live` in one of your Lovelace views.
|
||||
The integration currently supports proxying H.264 and H.265 source streams to the HLS protocol and requires at least FFmpeg >= 4. Note that H.265 support is limited to Safari, iOS, and Android. The `stream` integration also provides limited support for audio. PCM codecs (e.g. G.711/G.723/G.726/G.729) are not supported. ADTS AAC audio is also currently not supported. Most other AAC and MP3 encoded audio should work.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user