Is anyone else having problems with the RTSP camera stream playback?
I have a Hikvision camera, added with the ONVIF integration.
Playback works for a few seconds, then the spinning loading icon and the timeline appear, but the playback doesn’t continue, even though the total time continues to increase.
I’ve tried with both the camera mainstream and substream.
The substream plays a few seconds longer, but then it stops as well.
This is with h.264 in Chrome, running HA docker on an RPi4.
I don’t believe it’s the RPi4 stalling, as cpu barely raises when watching the stream.
The rtsp stream plays without issues in vlc player.
It works perfectly with the rtsp stream of my Amcrest doorbell, but not the Hikvision rtsp stream.
Again, in HA frontend, vlc has no issues.
I found this bug report, which sounds like exactly what I’m experiencing:
opened 02:57PM - 15 Oct 20 UTC
closed 09:48PM - 28 Oct 20 UTC
integration: stream
<!-- READ THIS FIRST:
- If you need additional help with this template, pleas… e refer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/core/releases
- Do not report issues for integrations if you are using custom components or integrations.
- Provide as many details as possible. Paste logs, configuration samples and code into the backticks.
DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed without comment.
-->
## The problem
<!--
Describe the issue you are experiencing here to communicate to the
maintainers. Tell us what you were trying to do and what happened.
-->
RTSP stream stops working after around 30 seconds in the frontend.
The stream works perfectly fine in VLC outside of homeassistant
## Environment
arch | x86_64
chassis | desktop
dev | false
docker | true
docker_version | 19.03.13
hassio | true
host_os | Debian GNU/Linux 10 (buster)
installation_type | Home Assistant Supervised
os_name | Linux
os_version | 5.7.0-0.bpo.2-amd64
python_version | 3.8.5
supervisor | 247
version | 0.116.3
virtualenv | false
The device is an Amcrest AD110 doorbell camera
I know that this was working fine in 0.115.x, no errors, working very well.
Something changed in 0.116.x and this issue manifested itself.
- Home Assistant Core release with the issue: 0.116.x
- Last working Home Assistant Core release (if known): 0.115.6
- Operating environment (OS/Container/Supervised/Core): Supervised
- Integration causing this issue: Stream
- Link to integration documentation on our website:
https://www.home-assistant.io/integrations/stream/
## Problem-relevant `configuration.yaml`
<!--
An example configuration that caused the problem for you. Fill this out even
if it seems unimportant to you. Please be sure to remove personal information
like passwords, private URLs and other credentials.
-->
```
stream:
amcrest:
- host: 192.168.86.209
name: Doorbell Camera
username: !secret amcrest_username
password: !secret amcrest_pw
stream_source: rtsp
binary_sensors:
- motion_detected
- online
```
## Traceback/Error logs
<!--
If you come across any trace or error logs, please provide them.
-->
```
2020-10-15 15:56:11 WARNING (stream_worker) [homeassistant.components.stream.worker] Timestamp overflow detected: dts = 632496, resetting stream
2020-10-15 15:56:13 WARNING (stream_worker) [homeassistant.components.stream.worker] Dropping out of order packet: 24300 <= 24300
```
## Additional information
Only, I don’t have any error messages in the log, even after setting homeassistant.components.stream.worker
log level to debug.
I checked Chrome network performance.
The issues start when it can’t load init.mp4 anymore:
Same issue exists with rtsp stream playback stopping in v 2022.11. To keep a rtsp session alive a periodic request needs to be sent before the timeout parameter in setup.
See:
rtsp, rtp, rtsp-client