blakeblackshear / frigate

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

[Config Support]: docker compose ffmpeg/rtsp problem #5399

Closed yngveskog closed 1 year ago

yngveskog commented 1 year ago

Describe the problem you are having

I'm trying to install Frigate in Docker (and using Docker for the very first time). My object is to have it connected to my Home Assistant server in the end, but first get it running on a separate RPi4. My Mqtt broker is in Home Assistant

Version

stable version

Frigate config file

mqtt:
  host: 192.168.1.104
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: *******
  password: ********
  stats_interval: 60

detectors:
  coral:
    type: edgetpu
    device: usb

cameras:
  innkjoring:
    ffmpeg:
      inputs:
        - path: rtsp://*****:*******@192.168.1.144:88/videoSub
          roles:
            - detect
            - rtmp

    rtmp:
      enabled: True

    detect:
      width: 640
      height: 480

Relevant log output

pi@raspberrypi:~/frigate $ sudo docker compose up
[+] Running 1/0
 ⠿ Container frigate  Created                                                                                                                           0.0s
Attaching to frigate
frigate  | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
frigate  | [s6-init] ensuring user provided files have correct perms...exited 0.
frigate  | [fix-attrs.d] applying ownership & permissions fixes...
frigate  | [fix-attrs.d] done.
frigate  | [cont-init.d] executing container initialization scripts...
frigate  | [cont-init.d] done.
frigate  | [services.d] starting services
frigate  | [services.d] done.
frigate  | [2023-02-06 14:06:13] frigate.app                    INFO    : Starting Frigate (0.11.1-2eada21)
frigate  | Starting migrations
frigate  | [2023-02-06 14:06:13] peewee_migrate                 INFO    : Starting migrations
frigate  | There is nothing to migrate
frigate  | [2023-02-06 14:06:13] peewee_migrate                 INFO    : There is nothing to migrate
frigate  | [2023-02-06 14:06:13] frigate.app                    INFO    : Output process started: 211
frigate  | [2023-02-06 14:06:13] frigate.app                    INFO    : Camera processor started for innkjoring: 214
frigate  | [2023-02-06 14:06:13] ws4py                          INFO    : Using epoll
frigate  | [2023-02-06 14:06:13] frigate.app                    INFO    : Capture process started for innkjoring: 218
frigate  | [2023-02-06 14:06:13] frigate.video                  ERROR   : innkjoring: Unable to read frames from ffmpeg process.
frigate  | [2023-02-06 14:06:14] frigate.video                  ERROR   : innkjoring: ffmpeg process is not running. exiting capture thread...
frigate  | [2023-02-06 14:06:14] ws4py                          INFO    : Using epoll
frigate  | [2023-02-06 14:06:13] detector.coral                 INFO    : Starting detection process: 210
frigate  | [2023-02-06 14:06:13] frigate.edgetpu                INFO    : Attempting to load TPU as usb
frigate  | [2023-02-06 14:06:16] frigate.edgetpu                INFO    : TPU found
frigate  | [2023-02-06 14:06:33] watchdog.innkjoring            ERROR   : Ffmpeg process crashed unexpectedly for innkjoring.
frigate  | [2023-02-06 14:06:33] watchdog.innkjoring            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
frigate  | [2023-02-06 14:06:33] ffmpeg.innkjoring.detect       ERROR   : [rtsp @ 0xa13f00] Unable to open RTSP for listening
frigate  | [2023-02-06 14:06:33] ffmpeg.innkjoring.detect       ERROR   : rtsp://*****:******@192.168.1.144:88/videoSub: Cannot assign requested address
frigate  | [2023-02-06 14:06:34] frigate.video                  ERROR   : innkjoring: Unable to read frames from ffmpeg process.
frigate  | [2023-02-06 14:06:34] frigate.video                  ERROR   : innkjoring: ffmpeg process is not running. exiting capture thread...
frigate  | [2023-02-06 14:06:43] watchdog.innkjoring            ERROR   : Ffmpeg process crashed unexpectedly for innkjoring.

Frigate stats

No response

Operating system

Debian

Install method

Docker Compose

Coral version

USB

Any other information that may be helpful

Foscam H.264 wired camera Rpi4 Coral TPU My passwords and usernames on my cameras and Mqtt are simple letters and numbers

docker-compose.yaml version: "3.9" services: frigate: container_name: frigate privileged: true # this may not be necessary for all setups restart: unless-stopped image: blakeblackshear/frigate:stable shm_size: "64mb" # update for your cameras based on calculation above devices:

NickM-27 commented 1 year ago

is this running on a 32bit rpi?

yngveskog commented 1 year ago

32bit

NickM-27 commented 1 year ago

32bit

it is highly recommended to run 64 bit as it will lead to better performance and more compatibility. If that is not possible, you will need to change your config to have

ffmpeg:
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1

which will get this working

yngveskog commented 1 year ago

Yes! absolutely fantastic!