blakeblackshear / frigate

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

[Support]: You may have invalid args defined for this camera. Server returned 400 Bad Request #2366

Closed the-bort-the closed 2 years ago

the-bort-the commented 2 years ago

Describe the problem you are having

I currently have the everything running through Docker on a Raspberry pi4 8gb model. I installed home assistant and supervisor through docker-compose and then used HACS to install frigate and then added as an integtation. I installed mosquitto through the integrations within configuration.

I have the camera set up and can log in using the local IP it was assigned through Chrome/IE. From there I can change all the camera settings, and see the current feed of the camera. I have provided some of the config of the camera; ports and resolution.

ports camera mqtt

I set up mqtt and used the IP of the running container for the frigate.yml. Unsure if that's correct. User and password were set up in home assistant as a person.

I think I'm mostly lost on how to derive the path for the camera and the ffmpeg settings. I assume that's first to fix given the 400 return in the logs.

here are my relevant running docker containers:

homeassistant/armv7-hassio-supervisor:2021.10.8 homeassistant/aarch64-addon-mosquitto:6.0.1 home-assistant/raspberrypi4-64-homeassistant:2021.11.5 ccab4aaf/aarch64-addon-frigate:2.3

Version

0.9.4-26AE608

Frigate config file

mqtt:
  host: 172.30.33.2 #this is the IP I received by exec-into the mosquitto 
  user: mqtt_user
  password: **************
  port: 1883
  topic_prefix: frigate
  client_id: frigate
cameras:
  camera:
    ffmpeg:
      inputs:
        - path: rtsp://********:************@192.168.0.13:554
          roles:
            - detect
            - rtmp
    detect:
      width: 1920
      height: 1080
      fps: 5

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.
[2021-12-02 15:47:37] frigate.app                    INFO    : Starting Frigate (0.9.4-26ae608)
[2021-12-02 15:47:37] frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
[2021-12-02 15:47:37] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2021-12-02 15:47:38] peewee_migrate                 INFO    : There is nothing to migrate
[2021-12-02 15:47:38] frigate.app                    INFO    : Output process started: 218
[2021-12-02 15:47:38] frigate.mqtt                   INFO    : MQTT connected
[2021-12-02 15:47:38] detector.cpu                   INFO    : Starting detection process: 217
[2021-12-02 15:47:38] frigate.edgetpu                WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
[2021-12-02 15:47:38] frigate.app                    INFO    : Camera processor started for camera: 221
[2021-12-02 15:47:38] frigate.app                    INFO    : Capture process started for camera: 223
[2021-12-02 15:47:38] ws4py                          INFO    : Using epoll
[2021-12-02 15:47:38] ws4py                          INFO    : Using epoll
[2021-12-02 15:47:38] frigate.video                  INFO    : camera: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-12-02 15:47:38] frigate.video                  INFO    : camera: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-12-02 15:47:38] frigate.video                  INFO    : camera: ffmpeg process is not running. exiting capture thread...
[2021-12-02 15:47:58] watchdog.camera                ERROR   : FFMPEG process crashed unexpectedly for camera.
[2021-12-02 15:47:58] watchdog.camera                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-12-02 15:47:58] watchdog.camera                ERROR   : You may have invalid args defined for this camera.
[2021-12-02 15:47:58] ffmpeg.camera.detect           ERROR   : rtsp://********:************@192.168.0.13:554: Server returned 400 Bad Request
[2021-12-02 15:47:58] frigate.video                  INFO    : camera: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures

FFprobe output from your camera

root@ccab4aaf-frigate:/opt/frigate# ffprobe http://ccab4aaf-frigate:5000
ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-rkmpp --enable-libdrm --enable-v4l2_m2m --enable-neon --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
http://ccab4aaf-frigate:5000: Invalid data found when processing input

Frigate stats

Not sure how I get this or if this is relevant to my issue.

Operating system

Debian

Install method

HassOS Addon

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

Topodome TD-J10A

Any other information that may be helpful

Here are some additional logs: This error originated from a custom integration.

Logger: custom_components.frigate.api Source: custom_components/frigate/api.py:172 Integration: Frigate (documentation, issues) First occurred: 10:52:41 AM (29 occurrences) Last logged: 3:47:40 PM

Error fetching information from http://ccab4aaf-frigate:5000/api/stats: Cannot connect to host ccab4aaf-frigate:5000 ssl:default [Try again] Error fetching information from http://ccab4aaf-frigate:5000/api/stats: 502, message='Bad Gateway', url=URL('http://ccab4aaf-frigate:5000/api/stats') Error fetching information from http://ccab4aaf-frigate:5000/api/stats: Cannot connect to host ccab4aaf-frigate:5000 ssl:default [Connect call failed ('172.30.33.3', 5000)]

blakeblackshear commented 2 years ago

See if a simpler password works.

the-bort-the commented 2 years ago

Changed the camera and mqtt password to a 5 character password, restarted all containers, home-assistant.

mqtt logs:

[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] mosquitto.sh: executing... 
[17:53:52] INFO: SSL is not enabled
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[17:53:52] INFO: Starting NGINX for authentication handling...
[17:53:52] INFO: Starting mosquitto MQTT broker...
1638489232: Loading config file /share/mosquitto/acl.conf
1638489232: mosquitto version 1.6.12 starting
1638489232: |-- *** auth-plug: startup
[17:53:53] INFO: Successfully send discovery information to Home Assistant.
[17:53:53] INFO: Successfully send service information to the Supervisor.
1638489232: Config loaded from /etc/mosquitto/mosquitto.conf.
1638489232: Loading plugin: /usr/share/mosquitto/auth-plug.so
1638489232:  ├── Username/password checking enabled.
1638489232:  ├── TLS-PSK checking enabled.
1638489232:  └── Extended authentication not enabled.
1638489232: Opening ipv4 listen socket on port 1883.
1638489232: Opening ipv6 listen socket on port 1883.
1638489232: Opening websockets listen socket on port 1884.
1638489232: Warning: Mosquitto should not be run as root/administrator.
1638489232: mosquitto version 1.6.12 running
1638489232: New connection from 127.0.0.1 on port 1883.
1638489232: Socket error on client <unknown>, disconnecting.
1638489234: New connection from 172.30.33.3 on port 1883.
1638489234: New connection from 172.30.32.1 on port 1883.
{"result": "ok", "data": {}}1638489234: New client connected from 172.30.33.3 as frigate (p2, c1, k60, u'mqtt_user').

frigate logs

[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.
[2021-12-02 17:54:51] frigate.app                    INFO    : Starting Frigate (0.9.4-26ae608)
[2021-12-02 17:54:51] frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
[2021-12-02 17:54:51] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2021-12-02 17:54:51] peewee_migrate                 INFO    : There is nothing to migrate
[2021-12-02 17:54:51] frigate.mqtt                   INFO    : MQTT connected
[2021-12-02 17:54:51] frigate.app                    INFO    : Output process started: 220
[2021-12-02 17:54:51] frigate.app                    INFO    : Camera processor started for camera: 222
[2021-12-02 17:54:51] frigate.app                    INFO    : Capture process started for camera: 223
[2021-12-02 17:54:51] detector.cpu                   INFO    : Starting detection process: 218
[2021-12-02 17:54:51] frigate.edgetpu                WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
[2021-12-02 17:54:51] ws4py                          INFO    : Using epoll
[2021-12-02 17:54:51] ws4py                          INFO    : Using epoll
[2021-12-02 17:54:51] frigate.video                  INFO    : camera: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-12-02 17:54:51] frigate.video                  INFO    : camera: ffmpeg process is not running. exiting capture thread...
[2021-12-02 17:55:11] watchdog.camera                ERROR   : FFMPEG process crashed unexpectedly for camera.
[2021-12-02 17:55:11] watchdog.camera                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-12-02 17:55:11] watchdog.camera                ERROR   : You may have invalid args defined for this camera.
[2021-12-02 17:55:11] ffmpeg.camera.detect           ERROR   : rtsp://admin:*****@192.168.0.13:554: Server returned 400 Bad Request
[2021-12-02 17:55:11] frigate.video                  INFO    : camera: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
blakeblackshear commented 2 years ago

The path you have configured for your camera is returning a 400 error. Are you sure that exact path works in VLC?

the-bort-the commented 2 years ago

I'm sure it's not correct sadly. I'm most confused about how to derive the path. Based on your docs and other user examples, it appears to be something along these lines rtsp://user:password@IP:554

vlc_2 vlc_1 .

blakeblackshear commented 2 years ago

I would suggest searching Google for the rtsp url of your camera mldel

the-bort-the commented 2 years ago

http://www.ispyconnect.com/camera/topodome how easy! :) Thanks for all the help!

- path: rtsp://admin:admin@192.168.0.13:554/11