blakeblackshear / frigate

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

[Camera Support]: Unable to read frames from ffmpeg process #3717

Closed sla004 closed 2 years ago

sla004 commented 2 years ago

Describe the problem you are having

When running sudo docker-compose up command I get ffmpeg error messages

Version

0.10.1-83481af

Frigate config file

mqtt:
  host: 192.168.68.154
  user: homeassistant
  password: mqtt-password
detectors:
  coral:
    type: edgetpu
    device: usb
cameras:
  etuovi:
    ffmpeg:
      input_args:
        - -avoid_negative_ts
        - make_zero
      inputs:
        - path: http://192.168.68.125/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=admin&password=password
          roles:
            - rtmp
        - path: http://192.168.68.125/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=password
          roles:
            - detect
    detect:
      width: 2560
      height: 1920
      fps: 10
    objects:
      track:
        - person
        - dog

Relevant log output

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  | [2022-08-27 11:25:43] frigate.app                    INFO    : Starting Frigate (0.10.1-83481af)
frigate  | Starting migrations
frigate  | [2022-08-27 11:25:43] peewee_migrate                 INFO    : Starting migrations
frigate  | There is nothing to migrate
frigate  | [2022-08-27 11:25:43] peewee_migrate                 INFO    : There is nothing to migrate
frigate  | [2022-08-27 11:25:43] frigate.app                    INFO    : Output process started: 213
frigate  | [2022-08-27 11:25:43] ws4py                          INFO    : Using epoll
frigate  | [2022-08-27 11:25:44] frigate.app                    INFO    : Camera processor started for etuovi: 219
frigate  | [2022-08-27 11:25:44] frigate.app                    INFO    : Capture process started for etuovi: 220
frigate  | [2022-08-27 11:25:44] ws4py                          INFO    : Using epoll
frigate  | [2022-08-27 11:25:44] frigate.video                  ERROR   : etuovi: Unable to read frames from ffmpeg process.
frigate  | [2022-08-27 11:25:44] frigate.video                  ERROR   : etuovi: ffmpeg process is not running. exiting capture thread...
frigate  | [2022-08-27 11:25:43] detector.coral                 INFO    : Starting detection process: 212
frigate  | [2022-08-27 11:25:44] frigate.edgetpu                INFO    : Attempting to load TPU as usb
frigate  | [2022-08-27 11:25:46] frigate.edgetpu                INFO    : TPU found
frigate  | [2022-08-27 11:26:04] watchdog.etuovi                ERROR   : Ffmpeg process crashed unexpectedly for etuovi.
frigate  | [2022-08-27 11:26:04] watchdog.etuovi                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
frigate  | [2022-08-27 11:26:04] ffmpeg.etuovi.detect           ERROR   : http://192.168.68.125/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=password: End of file
frigate  | [2022-08-27 11:26:04] ffmpeg.etuovi.rtmp             ERROR   : http://192.168.68.125/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=admin&password=password: End of file
frigate  | [2022-08-27 11:26:04] watchdog.etuovi                INFO    : Terminating the existing ffmpeg process...
frigate  | [2022-08-27 11:26:04] watchdog.etuovi                INFO    : Waiting for ffmpeg to exit gracefully...
frigate  | [2022-08-27 11:26:04] frigate.video                  ERROR   : etuovi: Unable to read frames from ffmpeg process.
frigate  | [2022-08-27 11:26:04] frigate.video                  ERROR   : etuovi: ffmpeg process is not running. exiting capture thread...
frigate  | [2022-08-27 11:26:14] watchdog.etuovi                ERROR   : Ffmpeg process crashed unexpectedly for etuovi.
frigate  | [2022-08-27 11:26:14] watchdog.etuovi                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
frigate  | [2022-08-27 11:26:14] ffmpeg.etuovi.detect           ERROR   : http://192.168.68.125/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=password: End of file
frigate  | [2022-08-27 11:26:14] ffmpeg.etuovi.rtmp             ERROR   : http://192.168.68.125/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=admin&password=password: End of file
frigate  | [2022-08-27 11:26:14] watchdog.etuovi                INFO    : Terminating the existing ffmpeg process...
frigate  | [2022-08-27 11:26:14] watchdog.etuovi                INFO    : Waiting for ffmpeg to exit gracefully...
frigate  | [2022-08-27 11:26:14] frigate.video                  ERROR   : etuovi: Unable to read frames from ffmpeg process.
frigate  | [2022-08-27 11:26:14] frigate.video                  ERROR   : etuovi: ffmpeg process is not running. exiting capture thread...

FFprobe output from your camera

[http @ 0x560f3a6c1b40] HTTP error 500 Internal Server Error
simo@Frigate-hp:~/docker-compose/frigate/config$ ned 5XX Server Error reply   ^C
[1]   Exit 1                  ffprobe http://192.168.68.125/flv?port=1935
[2]   Done                    app=bcs
[3]-  Done                    stream=channel0_main.bcs
[4]+  Done                    user=admin

Frigate stats

No response

Operating system

Other Linux

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

Reolink RLC-410W-5MP

Any other information that may be helpful

It worked already, but then I had to install ubuntu again (22.04) and now I get these error messages

sla004 commented 2 years ago

ffprobe comman with rtmp://192....

rtmp://192.168.68.125/flv?port=1935: Input/output error

[1] Exit 1 ffprobe rtmp://192.168.68.125/flv?port=1935 [2] Done app=bcs [3]- Done stream=channel0_ext.bcs [4]+ Done user=admin

NickM-27 commented 2 years ago

Please read the docs, you've overridden most the input args (which are needed) please update to use the RTMP args from the docs

https://docs.frigate.video/configuration/camera_specific#rtmp-cameras

sla004 commented 2 years ago

I tried with this setup, but same result:

mqtt: host: 192.168.68.154 user: homeassistant password: mqtt-password detectors: coral: type: edgetpu device: usb cameras: etuovi: ffmpeg: input_args:

NickM-27 commented 2 years ago
input_args:
- -avoid_negative_ts
- make_zero
- -fflags
- nobuffer+genpts+discardcorrupt
- -flags
- low_delay
- -strict
- experimental
- -analyzeduration
- 1000M
- -probesize
- 1000M
- -rw_timeout
- "5000000"

Those aren't the args I linked, I also noticed you are using a reolink camera which means you need to use the reolink specific args: https://docs.frigate.video/configuration/camera_specific/#reolink-410520-possibly-others

ffmpeg:
  input_args:
    - -avoid_negative_ts
    - make_zero
    - -fflags
    - nobuffer+genpts+discardcorrupt
    - -flags
    - low_delay
    - -strict
    - experimental
    - -analyzeduration
    - 1000M
    - -probesize
    - 1000M
    - -rw_timeout
    - "5000000"
NickM-27 commented 2 years ago

You also might want to make sure the firmware is up to date on your reolink cams, newer firmware works much better

sla004 commented 2 years ago

yes, I have all reolink arguments mentioned in that post. Also firmware is latest version.

NickM-27 commented 2 years ago

Do you have special characters in your password? I would try a very simple password just to see if that may be the issue.

sla004 commented 2 years ago

Thanks a lot! Problem solved, my last char in password was #. I took it away and now it works normally. Maybe this could be added to instructions?

NickM-27 commented 2 years ago

Glad it's working! I'm going to close this then, feel free to open a new issue if something else comes up.

Yeah that's a fair point, I'll make a PR for that