Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video stream not working with HWN-2408MH-8P NVR #246

Open
Alfystar opened this issue Nov 13, 2024 · 14 comments
Open

Video stream not working with HWN-2408MH-8P NVR #246

Alfystar opened this issue Nov 13, 2024 · 14 comments
Labels
help Troubleshooting

Comments

@Alfystar
Copy link

I have an NVR surveillance system with the model HWN-2408MH-8P. I managed to find the ISAPI access option from the configuration page, but I haven't found a way to access user permissions and haven't yet worked on events.

When integrating the plugin, it immediately identified my 5 cameras by entering the username, password, and URL, showing their names and some status. However, the video stream is "dead." When I try to start it, the screen is gray, and the following error appears in the system log:

Logger: root
Source: components/stream/worker.py:271
First occurred: 10:21:02 (2 occurrences)
Last logged: 10:21:18

Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/src/homeassistant/homeassistant/components/stream/__init__.py", line 438, in _run_worker
    stream_worker(
  File "/usr/src/homeassistant/homeassistant/components/stream/worker.py", line 618, in stream_worker
    muxer.mux_packet(first_keyframe)
  File "/usr/src/homeassistant/homeassistant/components/stream/worker.py", line 271, in mux_packet
    self._av_output.mux(packet)
  File "av/container/output.pyx", line 218, in av.container.output.OutputContainer.mux
  File "av/container/output.pyx", line 224, in av.container.output.OutputContainer.mux_one
  File "av/container/output.pyx", line 190, in av.container.output.OutputContainer.start_encoding
  File "av/container/core.pyx", line 290, in av.container.core.Container.err_check
  File "av/error.pyx", line 336, in av.error.err_check
av.error.ValueError: [Errno 22] Invalid argument: '<none>'; last error log: [mp4] dimensions not set

I couldn't find any similar errors among the issues, but if I missed something, I apologize. I would love to integrate this fantastic plugin into my setup.

System Information:

  • Home Assistant Core: 2024.10.4 (Docker installation)
  • Frontend: 20241002.4
  • hickvision_next: 1.0.19

I am available for any help and testing. Thanks in advance!

@maciej-or
Copy link
Owner

most likely you have set a codec other than H.264

@Alfystar
Copy link
Author

Do you mean at the OS, Home Assistant, NVR or Plugin level?

@maciej-or
Copy link
Owner

at NVR video settings for each cam

@Alfystar
Copy link
Author

Alfystar commented Nov 13, 2024

Perfect, as soon as I get home I'll test it and update you!
Thanks

However I remember having glimpsed as a codec h265, so even if it is not the problem it is part of the problem.
But if I wanted to use the most advanced codec, also to save bandwidth, is there some missing package at the OS level or is it impossible?

@maciej-or
Copy link
Owner

maciej-or commented Nov 13, 2024

it depends on browser, H.265 implementation is still in progress for most
https://caniuse.com/hevc
you have to wait a while

@maciej-or maciej-or added the help Troubleshooting label Nov 13, 2024
@Alfystar
Copy link
Author

Alfystar commented Nov 13, 2024

Mmm Ok, but I found same problem also in companion...

Anyway I change the codec for all camera end restart home assistant, now the error change to:

Registratore: homeassistant.components.stream.stream.camera.hwn_2108mh_8p0820210905ccrrg66709044wvu_101
Fonte: components/stream/__init__.py:448
Integrazione: Stream (documentazione, problemi)
Prima occorrenza: 19:57:34 (1 occorrenze)
Ultima registrazione: 19:57:34

Error from stream worker: No dts in 7 consecutive packets

Any other idea?

This is my current configuration:
image

@maciej-or
Copy link
Owner

check this issue, looks similar #209

@Alfystar
Copy link
Author

Alfystar commented Nov 14, 2024

Hi @maciej-or!
I wanted to let you know that disabling stream encryption worked!
Now by clicking on the video stream, after a few seconds you see what the camera sees.

However, the camera snapshots continue to not work and from the dashboard the camera is gray and in an "inactive" state

From the home assistant logs, however, I don't see any errors or warnings, any ideas?

Anyway we are very close to the Anyway we are very close to the solution! 😆

Current configuration:
20241114_004616.jpg

Home assistant dashboard:
Screenshot_20241114_084451_Home Assistant.png

Screenshot_20241114_084602_Home Assistant.png

@maciej-or
Copy link
Owner

check these settings

image image

@maciej-or maciej-or mentioned this issue Nov 14, 2024
@Alfystar
Copy link
Author

Alfystar commented Nov 14, 2024

Unfortunately my device does not allow you to choose the digest algorithm...

This is what I see:

Screenshot_20241114_222523_Chrome.png

Screenshot_20241114_222509_Chrome.png

Screenshot_20241114_222514_Chrome.png

I also try to edit video settings:
Screenshot_20241114_222701_Chrome.png

In particular enable the codec h264+

Still work on home assistant, but the preview and snapshot is dead 😭

@maciej-or
Copy link
Owner

ok, so catch the log, guide is here https://github.com/maciej-or/hikvision_next?tab=readme-ov-file#reporting-issues
and look for the urls with /picture

@Alfystar
Copy link
Author

Alfystar commented Nov 15, 2024

Hi @maciej-or , i'm here again
I log as you write in readme:
https://pastebin.com/znhZDc4g

But for what i see, no error come out, no warning, and no /picturereference inside this log...

actually reading online I also had the doubt that it is the fault of the nvr firmware since even from the hikconnect app I do not see the thrumbnails.

As soon as I have the chance I will try to update the firmware, which if I understood correctly should be in this folder for my model (HWN-2108MH-8P NVR):
Actualy version of Nvr: V4.30.300 build 210813
https://www.hikvisioneurope.com/eu/portal/?dir=portal/Technical%20Materials/20%20HiWatch%20%26%20HiLook/00%20Product%20Firmware/K20B2%28HWN-21XX%29

Is possible in your opinion?

@maciej-or
Copy link
Owner

I think you have to open dashboard with snapshot card, then request for the picture should appear in the log.
For security reasons it is always worth having the latest version of firmware.
If it is possible you must check yourself, if fw is not compatible with your device the upgrade will not start

@Alfystar
Copy link
Author

Hi @maciej-or
I do the firmware update, but log still not contain /picture ...
This the new logs: https://pastebin.com/Cpe8XsB9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help Troubleshooting
Projects
None yet
Development

No branches or pull requests

2 participants