blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
18.81k stars 1.71k forks source link

[Camera Support]: Cannot connect Hilook camera, works fine with HA ONVIF integration or VLC #3191

Closed acseven closed 2 years ago

acseven commented 2 years ago

Describe the problem you are having

Green screen, no video feed at all. Running on a Raspberry Pi400.

Version

0.10.1-83481AF

Frigate config file

mqtt:
  host: 192.168.1.10
  user: mymqttuser
  password: mymqttpassword

cameras:
  cctv-1:
    ffmpeg:
      inputs:
        - path: rtsp://myuser:mypw@mylocalip:myport/Streaming/Channels/101/?transportmode=unicast
          roles:
            - record
            #- detect
            - rtmp
        #- path: rtsp://myuser:mypw@mylocalip:myport/Streaming/Channels/102/?transportmode=unicast
        #  roles:
        #    - detect
      hwaccel_args: -c:v h264_v4l2m2m
    rtmp:
      enabled: True # <-- RTMP should be disabled if your stream is not H264
    #detect:
      #enabled: True
      #width: 1280 # <---- update for your camera's resolution
      #height: 720 # <---- update for your camera's resolution
      #width: 2560
      #height: 1440
    snapshots: # <----- Enable snapshots
      enabled: False
    record: # <----- Enable recording
      enabled: False

Relevant log output

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2022-05-04 14:55:32] frigate.app                    INFO    : Starting Frigate (0.10.1-83481af)
[2022-05-04 14:55:32] frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
[2022-05-04 14:55:32] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-05-04 14:55:32] peewee_migrate                 INFO    : There is nothing to migrate
[2022-05-04 14:55:32] frigate.app                    INFO    : Output process started: 219
[2022-05-04 14:55:32] detector.cpu                   INFO    : Starting detection process: 217
[2022-05-04 14:55:32] frigate.edgetpu                WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
[2022-05-04 14:55:32] ws4py                          INFO    : Using epoll
[2022-05-04 14:55:32] frigate.app                    INFO    : Camera processor started for cctv-1: 224
[2022-05-04 14:55:32] frigate.app                    INFO    : Capture process started for cctv-1: 225
[2022-05-04 14:55:32] ws4py                          INFO    : Using epoll
[2022-05-04 14:55:32] frigate.video                  ERROR   : cctv-1: Unable to read frames from ffmpeg process.
[2022-05-04 14:55:32] frigate.video                  ERROR   : cctv-1: ffmpeg process is not running. exiting capture thread...
[2022-05-04 14:55:52] watchdog.cctv-1       ERROR   : Ffmpeg process crashed unexpectedly for cctv-1.
[2022-05-04 14:55:52] watchdog.cctv-1       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-05-04 14:55:52] ffmpeg.cctv-1.detect  ERROR   : [rtsp @ 0x559ef54750] method DESCRIBE failed: 401 Unauthorized
[2022-05-04 14:55:52] ffmpeg.cctv-1.detect  ERROR   : rtsp://myuser:mypw@mylocalip:myport/Streaming/Channels/101/?transportmode=unicast: Server returned 401 Unauthorized (authorization failed)
[2022-05-04 14:55:52] frigate.video                  ERROR   : cctv-1: Unable to read frames from ffmpeg process.
[2022-05-04 14:55:52] frigate.video                  ERROR   : cctv-1: ffmpeg process is not running. exiting capture thread...

FFprobe output from your camera

Input #0, rtsp, from 'myrtsp stream':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.500667, bitrate: N/A
  Stream #0:0: Video: h264 (Baseline), yuvj420p(pc, bt709, progressive), 2560x1440, 12 fps, 12 tbr, 90k tbn, 24 tbc

Frigate stats

{"detection_fps":0.0,"detectors":{"cpu":{"detection_start":0.0,"inference_speed":10.0,"pid":217}},"cctv-1":{"camera_fps":0.0,"capture_pid":224,"detection_fps":0.0,"pid":223,"process_fps":0.0,"skipped_fps":0.0},"service":{"storage":{"/dev/shm":{"free":1988.7,"mount_type":"tmpfs","total":1988.9,"used":0.3},"/media/frigate/clips":{"free":40362.8,"mount_type":"ext4","total":63075.1,"used":20148.7},"/media/frigate/recordings":{"free":40362.8,"mount_type":"ext4","total":63075.1,"used":20148.7},"/tmp/cache":{"free":1988.9,"mount_type":"tmpfs","total":1988.9,"used":0.0}},"temperatures":{},"uptime":86,"version":"0.10.1-83481af"}}

Operating system

HassOS

Install method

HassOS Addon

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

Hilook (Hikvision based) IPC-T240H

Any other information that may be helpful

RTSP url streams have been checked (working in VLC and direct integrations in HA).

I've tried enabling / disabling many of the config options, but none helped.

The issue appears to be centered on the "401 unauthorized" error but the rtsp credentials are 100% correct.

HASSOS, Supervisor and Core are all up to date.

NickM-27 commented 2 years ago

We've seen it before where complex credentials with special characters or long passwords can throw things off, I'd recommend trying a super short / simple password just to see if it fixes the issue.

acseven commented 2 years ago

Thanks for the input. I've reduced the number of characters and apparently the 401 error isn't present anymore. However, I still have a green screen:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2022-05-04 15:59:45] frigate.app                    INFO    : Starting Frigate (0.10.1-83481af)
[2022-05-04 15:59:45] frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
[2022-05-04 15:59:45] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-05-04 15:59:45] peewee_migrate                 INFO    : There is nothing to migrate
[2022-05-04 15:59:45] frigate.app                    INFO    : Output process started: 218
[2022-05-04 15:59:45] detector.cpu                   INFO    : Starting detection process: 217
[2022-05-04 15:59:45] frigate.edgetpu                WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
[2022-05-04 15:59:46] frigate.app                    INFO    : Camera processor started for cctv-1: 221
[2022-05-04 15:59:46] frigate.app                    INFO    : Capture process started for cctv-1: 224
[2022-05-04 15:59:46] ws4py                          INFO    : Using epoll
[2022-05-04 15:59:46] ws4py                          INFO    : Using epoll
[2022-05-04 16:00:06] watchdog.cctv-1       INFO    : No frames received from cctv-1 in 20 seconds. Exiting ffmpeg...
[2022-05-04 16:00:06] watchdog.cctv-1       INFO    : Waiting for ffmpeg to exit gracefully...
[2022-05-04 16:00:36] watchdog.cctv-1       INFO    : FFmpeg didnt exit. Force killing...
[2022-05-04 16:00:36] frigate.video                  ERROR   : cctv-1: Unable to read frames from ffmpeg process.
[2022-05-04 16:00:36] frigate.video                  ERROR   : cctv-1: ffmpeg process is not running. exiting capture thread...
[2022-05-04 16:00:46] watchdog.cctv-1       ERROR   : Ffmpeg process crashed unexpectedly for cctv-1.
[2022-05-04 16:00:46] watchdog.cctv-1       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
NickM-27 commented 2 years ago

That's progress, can you try it without transportmode=unicast. I searched other users with this camera in previous issues and they had the same stream url but without that bit.

acseven commented 2 years ago

Still no go:

[2022-05-04 16:11:58] frigate.app                    INFO    : Camera processor started for cctv-1: 222
[2022-05-04 16:11:58] ws4py                          INFO    : Using epoll
[2022-05-04 16:11:58] frigate.app                    INFO    : Capture process started for cctv-1: 223
[2022-05-04 16:11:58] ws4py                          INFO    : Using epoll
[2022-05-04 16:12:18] watchdog.cctv-1       INFO    : No frames received from cctv-1 in 20 seconds. Exiting ffmpeg...
[2022-05-04 16:12:18] watchdog.cctv-1       INFO    : Waiting for ffmpeg to exit gracefully...
[2022-05-04 16:12:41] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:51916]
[2022-05-04 16:12:48] watchdog.cctv-1       INFO    : FFmpeg didnt exit. Force killing...
[2022-05-04 16:12:48] frigate.video                  ERROR   : cctv-1: Unable to read frames from ffmpeg process.
[2022-05-04 16:12:48] frigate.video                  ERROR   : cctv-1: Unable to read frames from ffmpeg process.
[2022-05-04 16:12:48] frigate.video                  ERROR   : cctv-1: Unable to read frames from ffmpeg process.
[2022-05-04 16:12:48] frigate.video                  ERROR   : cctv-1: ffmpeg process is not running. exiting capture thread...
[2022-05-04 16:12:58] watchdog.cctv-1       ERROR   : Ffmpeg process crashed unexpectedly for cctv-1.
[2022-05-04 16:12:58] watchdog.cctv-1       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-05-04 16:13:18] watchdog.cctv-1       INFO    : No frames received from cctv-1 in 20 seconds. Exiting ffmpeg...
[2022-05-04 16:13:18] watchdog.cctv-1       INFO    : Waiting for ffmpeg to exit gracefully...
NickM-27 commented 2 years ago

Can you try it without hwaccel args included? I am starting to think this may not be related to the camera now after getting the unauthorized fixed

acseven commented 2 years ago

Yup, that did the trick, thank you very much for your help. I was using that considering the info on the documentation regarding Raspberry Pi 4 64-bit (I have the addon's protection mode Off as suggested), but apparently it's not working.

NickM-27 commented 2 years ago

Yup, that did the trick, thank you very much for your help. I was using that considering the info on the documentation regarding Raspberry Pi 4 64-bit (I have the addon's protection mode Off as suggested), but apparently it's not working.

Yeah, see https://github.com/blakeblackshear/frigate/issues/2030 for more info on that

acseven commented 2 years ago

Thanks! Will do