home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.19k stars 30.57k forks source link

Opening ONVIF camera stream does not work #40361

Closed philskents closed 4 years ago

philskents commented 4 years ago

The problem

Opening up the stream view on any of my Amcrest cameras generates an error and does not work

Environment

Problem-relevant configuration.yaml

Traceback/Error logs

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/src/homeassistant/homeassistant/components/stream/worker.py", line 48, in stream_worker
    _stream_worker_internal(hass, stream, quit_event)
  File "/usr/src/homeassistant/homeassistant/components/stream/worker.py", line 194, in _stream_worker_internal
    if not peek_first_pts():
  File "/usr/src/homeassistant/homeassistant/components/stream/worker.py", line 133, in peek_first_pts
    first_pts[packet.stream] = packet.dts - packet.duration
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

Additional information

probot-home-assistant[bot] commented 4 years ago

onvif documentation onvif source (message by IssueLinks)

probot-home-assistant[bot] commented 4 years ago

Hey there @hunterjm, mind taking a look at this issue as its been labeled with an integration (onvif) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

philskents commented 4 years ago

Interestingly I get the same error when using the Amcrest integration so it may be something outside ONVIF

philskents commented 4 years ago

Update: Functionality confirmed working in 0.114.4. Issue is almost certainly in the Stream component NOT ONVIF

hunterjm commented 4 years ago

Since probot didn't update the tags, I'll add @uvjustin. It looks like the peek_first_pts doesn't handle packets without dts possibly?

probot-home-assistant[bot] commented 4 years ago

Hey there @uvjustin, mind taking a look at this issue as its been labeled with an integration (stream) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

uvjustin commented 4 years ago

@hunterjm I have a PR for this already https://github.com/home-assistant/core/pull/40299

philskents commented 4 years ago

I will watch for the merge, thanks!