Skip to content

Commit 7a9c442

Browse files
authored
Merge pull request home-assistant#939 from home-assistant/ffmpeg_update
Ffmpeg component
2 parents 129003d + b16ee58 commit 7a9c442

File tree

3 files changed

+47
-25
lines changed

3 files changed

+47
-25
lines changed

source/_components/binary_sensor.ffmpeg.markdown

+1-7
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ ha_iot_class: "Local Polling"
1616

1717
The `ffmpeg` platform allows you to use every video or audio feed with [FFmpeg](http://www.ffmpeg.org/) for various sensors in Home Assistant. Available are: **noise**, **motion**. If the `ffmpeg` process is broken, the sensor will be unavailable. To restart the instance, use the service *binary_sensor.ffmpeg_restart*.
1818

19-
<p class='note'>
20-
You need the `ffmpeg` binary in your system path. On Debain 8 you can install it from backports. If you want Hardware support on a Raspberry Pi you need to build it from source. Windows binary are avilable on [FFmpeg](http://www.ffmpeg.org/) homepage.
21-
</p>
22-
2319
### {% linkable_title Noise %}
2420

2521
To enable your FFmpeg with noise detection in your installation, add the following to your `configuration.yaml` file:
@@ -31,7 +27,6 @@ camera:
3127
tool: noise
3228
input: FFMPEG_SUPPORTED_INPUT
3329
name: FFmpeg Noise
34-
ffmpeg_bin: /usr/bin/ffmpeg
3530
peak: -30
3631
duration: 1
3732
reset: 20
@@ -68,7 +63,6 @@ camera:
6863
tool: motion
6964
input: FFMPEG_SUPPORTED_INPUT
7065
name: FFmpeg Motion
71-
ffmpeg_bin: /usr/bin/ffmpeg
7266
changes: 10
7367
reset: 20
7468
# group feature / default not in use
@@ -95,4 +89,4 @@ For playing with values (changes/100 is the scene value on ffmpeg):
9589
$ ffmpeg -i YOUR_INPUT -an -filter:v select=gt(scene\,0.1) -f framemd5 -
9690
```
9791

98-
If you are running into trouble with this sensor, please refer to this [Troubleshooting section](/components/camera.ffmpeg/#troubleshooting).
92+
If you are running into trouble with this sensor, please refer to this [Troubleshooting section](/components/ffmpeg/#troubleshooting).

source/_components/camera.ffmpeg.markdown

+1-18
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ ha_release: 0.26
1515

1616
The `ffmpeg` platform allows you to use every video feed with [FFmpeg](http://www.ffmpeg.org/) as camera in Home Assistant. The input for ffmpeg need to support that could have multiple connection to source (input) in same time. For every user in UI and all 10 seconds (snapshot image) it make a new connection/reading to source. Normally that should never be a trouble only in strange selfmade constructs can be make mistakes.
1717

18-
<p class='note'>
19-
You need a `ffmpeg` binary in your system path. On Debain 8 you can install it from backports. If you want Hardware support on a Raspberry Pi you need tobuild from source by yourself. Windows binary are avilable on the [FFmpeg](http://www.ffmpeg.org/) website.
20-
</p>
21-
2218
To enable your FFmpeg feed in your installation, add the following to your `configuration.yaml` file:
2319

2420
```yaml
@@ -27,7 +23,6 @@ camera:
2723
- platform: ffmpeg
2824
input: FFMPEG_SUPPORTED_INPUT
2925
name: FFmpeg
30-
ffmpeg_bin: /usr/bin/ffmpeg
3126
extra_arguments: -q:v 2
3227
```
3328
@@ -42,18 +37,6 @@ Configuration variables:
4237

4338
You can control the `image quality` with [`extra_arguments`](https://www.ffmpeg.org/ffmpeg-codecs.html#jpeg2000) `-q:v 2-32` or with lossless option `-pred 1`.
4439

45-
### {% linkable_title Troubleshooting %}
46-
47-
In most of case, `ffmpeg` autodetect all needed options to read a video/audio stream or file. But it is possible in rare cases that's needed to set a option to help `ffmpeg`. Per default `ffmpeg` use 5 seconds to detect all options or abort.
48-
49-
First check, if your stream playable by `ffmpeg` with (use option `-an` or `-vn` to disable video or audio stream):
50-
51-
```
52-
$ ffmpeg -i INPUT -an -f null -
53-
```
54-
55-
Now you can see what going wrong. Following list could be help to solve your trouble:
5640

57-
- `[rtsp @ ...] UDP timeout, retrying with TCP`: You need to set RTSP transport in the configuration with: `input: -rtsp_transport tcp -i INPUT`
58-
- `[rtsp @ ...] Could not find codec parameters for stream 0 (Video: ..., none): unspecified size`: FFmpeg need more data or time for autodetect. You can set the `analyzeduration` and/or `probesize` option, play with this value. If you know the needed value you can set it with: `input: -analyzeduration xy -probesize xy -i INPUT`. More information about that can be found on [FFmpeg](https://www.ffmpeg.org/ffmpeg-formats.html#Description).
41+
If you are running into trouble with this sensor, please refer to this [Troubleshooting section](/components/ffmpeg/#troubleshooting).
5942

source/_components/ffmpeg.markdown

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
layout: page
3+
title: "FFmpeg"
4+
description: "Instructions for how to integrate FFmpeg within Home Assistant."
5+
date: 2016-09-14 00:00
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
logo: ffmpeg.png
11+
ha_category: Hub
12+
featured: true
13+
---
14+
15+
<p class='note'>
16+
You need a `ffmpeg` binary in your system path. On Debain 8 or Raspbian (Jessie) you can install it from backports. If you want Hardware support on a Raspberry Pi you need to build from source by yourself. Windows binary are avilable on the [FFmpeg](http://www.ffmpeg.org/) website.
17+
</p>
18+
19+
To set it up, add the following information to your `configuration.yaml` file:
20+
21+
```yaml
22+
ffmpeg:
23+
ffmpeg_bin: /usr/bin/ffmpeg
24+
run_test: True
25+
```
26+
27+
Configuration variables:
28+
29+
- **ffmpeg_bin** (*Optional*): Default 'ffmpeg'. Set the ffmpeg binary.
30+
- **run_test** (*Optional*): Default True. Check if `input` is usable by ffmpeg.
31+
32+
### {% linkable_title Troubleshooting %}
33+
34+
In most of case, `ffmpeg` autodetect all needed options to read a video/audio stream or file. But it is possible in rare cases that's needed to set a option to help `ffmpeg`. Per default `ffmpeg` use 5 seconds to detect all options or abort.
35+
36+
First check, if your stream playable by `ffmpeg` with (use option `-an` or `-vn` to disable video or audio stream):
37+
38+
```
39+
$ ffmpeg -i INPUT -an -f null -
40+
```
41+
42+
Now you can see what going wrong. Following list could be help to solve your trouble:
43+
44+
- `[rtsp @ ...] UDP timeout, retrying with TCP`: You need to set RTSP transport in the configuration with: `input: -rtsp_transport tcp -i INPUT`
45+
- `[rtsp @ ...] Could not find codec parameters for stream 0 (Video: ..., none): unspecified size`: FFmpeg need more data or time for autodetect. You can set the `analyzeduration` and/or `probesize` option, play with this value. If you know the needed value you can set it with: `input: -analyzeduration xy -probesize xy -i INPUT`. More information about that can be found on [FFmpeg](https://www.ffmpeg.org/ffmpeg-formats.html#Description).

0 commit comments

Comments
 (0)