blakeblackshear / frigate

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

[Support]: Connecting a subStream via Neolink to Frigate #3030

Closed Yashaa02 closed 2 years ago

Yashaa02 commented 2 years ago

Describe the problem you are having

I'm currently trying to connect my RTSP sub stream that is generated via Neolink from the Reolink Argus 3 Pro camera to Frigate. Currently running the most up to date Home Assistant on a Oracle VM VirtualBox.

I keep getting the error that it is "Unable to read frames from ffmpeg process."

Version

DEBUG 0.10.1-83481AF

Frigate config file

mqtt:
  host: 192.168.1.117
  port: 1883
  user: mqtt-user
  password: pw
cameras:
  OfficeCamera:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/Camera/subStream
          roles:
            - detect
            - rtmp
    detect:
      width: 896
      height: 504
      fps: 5

Relevant log output

[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-03-29 14:23:58] frigate.app                    INFO    : Starting Frigate (0.10.1-83481af)
[2022-03-29 14:23:58] frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
[2022-03-29 14:23:58] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-03-29 14:23:58] peewee_migrate                 INFO    : There is nothing to migrate
[2022-03-29 14:23:58] frigate.app                    INFO    : Output process started: 215
[2022-03-29 14:23:58] detector.cpu                   INFO    : Starting detection process: 214
[2022-03-29 14:23:58] frigate.edgetpu                WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
[2022-03-29 14:23:58] ws4py                          INFO    : Using epoll
[2022-03-29 14:23:58] frigate.app                    INFO    : Camera processor started for OfficeCamera: 218
[2022-03-29 14:23:58] frigate.app                    INFO    : Capture process started for OfficeCamera: 221
[2022-03-29 14:23:58] ws4py                          INFO    : Using epoll
[2022-03-29 14:23:58] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:23:58] frigate.video                  ERROR   : OfficeCamera: ffmpeg process is not running. exiting capture thread...
[2022-03-29 14:24:18] watchdog.OfficeCamera          ERROR   : Ffmpeg process crashed unexpectedly for OfficeCamera.
[2022-03-29 14:24:18] watchdog.OfficeCamera          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-03-29 14:24:18] ffmpeg.OfficeCamera.detect     ERROR   : [tcp @ 0x55d62ef67280] Connection to tcp://127.0.0.1:8554?timeout=5000000 failed: Connection refused
[2022-03-29 14:24:18] ffmpeg.OfficeCamera.detect     ERROR   : rtsp://127.0.0.1:8554/Camera/subStream: Connection refused
[2022-03-29 14:24:18] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:24:18] frigate.video                  ERROR   : OfficeCamera: ffmpeg process is not running. exiting capture thread...
[2022-03-29 14:24:28] watchdog.OfficeCamera          ERROR   : Ffmpeg process crashed unexpectedly for OfficeCamera.
[2022-03-29 14:24:28] watchdog.OfficeCamera          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-03-29 14:24:28] ffmpeg.OfficeCamera.detect     ERROR   : [tcp @ 0x5631289c7280] Connection to tcp://127.0.0.1:8554?timeout=5000000 failed: Connection refused
[2022-03-29 14:24:28] ffmpeg.OfficeCamera.detect     ERROR   : rtsp://127.0.0.1:8554/Camera/subStream: Connection refused
[2022-03-29 14:24:28] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:24:28] frigate.video                  ERROR   : OfficeCamera: ffmpeg process is not running. exiting capture thread...
[2022-03-29 14:24:38] watchdog.OfficeCamera          ERROR   : Ffmpeg process crashed unexpectedly for OfficeCamera.
[2022-03-29 14:24:38] watchdog.OfficeCamera          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-03-29 14:24:38] ffmpeg.OfficeCamera.detect     ERROR   : [tcp @ 0x55fc8ccb2280] Connection to tcp://127.0.0.1:8554?timeout=5000000 failed: Connection refused
[2022-03-29 14:24:38] ffmpeg.OfficeCamera.detect     ERROR   : rtsp://127.0.0.1:8554/Camera/subStream: Connection refused
[2022-03-29 14:24:38] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:24:38] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:24:38] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:24:38] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:24:38] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:24:38] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:24:38] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:24:38] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:24:38] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:24:38] frigate.video                  ERROR   : OfficeCamera: ffmpeg process is not running. exiting capture thread...
[2022-03-29 14:24:48] watchdog.OfficeCamera          ERROR   : Ffmpeg process crashed unexpectedly for OfficeCamera.
[2022-03-29 14:24:48] watchdog.OfficeCamera          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-03-29 14:24:48] ffmpeg.OfficeCamera.detect     ERROR   : [tcp @ 0x558662b61280] Connection to tcp://127.0.0.1:8554?timeout=5000000 failed: Connection refused
[2022-03-29 14:24:48] ffmpeg.OfficeCamera.detect     ERROR   : rtsp://127.0.0.1:8554/Camera/subStream: Connection refused
[2022-03-29 14:24:48] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:24:48] frigate.video                  ERROR   : OfficeCamera: ffmpeg process is not running. exiting capture thread...
[2022-03-29 14:24:58] watchdog.OfficeCamera          ERROR   : Ffmpeg process crashed unexpectedly for OfficeCamera.
[2022-03-29 14:24:58] watchdog.OfficeCamera          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-03-29 14:24:58] ffmpeg.OfficeCamera.detect     ERROR   : [tcp @ 0x559067663280] Connection to tcp://127.0.0.1:8554?timeout=5000000 failed: Connection refused
[2022-03-29 14:24:58] ffmpeg.OfficeCamera.detect     ERROR   : rtsp://127.0.0.1:8554/Camera/subStream: Connection refused
[2022-03-29 14:24:58] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:24:58] frigate.video                  ERROR   : OfficeCamera: ffmpeg process is not running. exiting capture thread...
[2022-03-29 14:25:08] watchdog.OfficeCamera          ERROR   : Ffmpeg process crashed unexpectedly for OfficeCamera.
[2022-03-29 14:25:08] watchdog.OfficeCamera          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-03-29 14:25:08] ffmpeg.OfficeCamera.detect     ERROR   : [tcp @ 0x55bab1ebe280] Connection to tcp://127.0.0.1:8554?timeout=5000000 failed: Connection refused
[2022-03-29 14:25:08] ffmpeg.OfficeCamera.detect     ERROR   : rtsp://127.0.0.1:8554/Camera/subStream: Connection refused
[2022-03-29 14:25:08] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:25:08] frigate.video                  ERROR   : OfficeCamera: ffmpeg process is not running. exiting capture thread...
[2022-03-29 14:25:18] watchdog.OfficeCamera          ERROR   : Ffmpeg process crashed unexpectedly for OfficeCamera.
[2022-03-29 14:25:18] watchdog.OfficeCamera          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-03-29 14:25:18] ffmpeg.OfficeCamera.detect     ERROR   : [tcp @ 0x55f266b4c280] Connection to tcp://127.0.0.1:8554?timeout=5000000 failed: Connection refused
[2022-03-29 14:25:18] ffmpeg.OfficeCamera.detect     ERROR   : rtsp://127.0.0.1:8554/Camera/subStream: Connection refused
[2022-03-29 14:25:18] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:25:18] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:25:18] frigate.video                  ERROR   : OfficeCamera: ffmpeg process is not running. exiting capture thread...
[2022-03-29 14:25:28] watchdog.OfficeCamera          ERROR   : Ffmpeg process crashed unexpectedly for OfficeCamera.
[2022-03-29 14:25:28] watchdog.OfficeCamera          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-03-29 14:25:28] ffmpeg.OfficeCamera.detect     ERROR   : [tcp @ 0x561524a1a280] Connection to tcp://127.0.0.1:8554?timeout=5000000 failed: Connection refused
[2022-03-29 14:25:28] ffmpeg.OfficeCamera.detect     ERROR   : rtsp://127.0.0.1:8554/Camera/subStream: Connection refused
[2022-03-29 14:25:28] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:25:28] frigate.video                  ERROR   : OfficeCamera: ffmpeg process is not running. exiting capture thread...
[2022-03-29 14:25:38] watchdog.OfficeCamera          ERROR   : Ffmpeg process crashed unexpectedly for OfficeCamera.
[2022-03-29 14:25:38] watchdog.OfficeCamera          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-03-29 14:25:38] ffmpeg.OfficeCamera.detect     ERROR   : [tcp @ 0x560c7521e280] Connection to tcp://127.0.0.1:8554?timeout=5000000 failed: Connection refused
[2022-03-29 14:25:38] ffmpeg.OfficeCamera.detect     ERROR   : rtsp://127.0.0.1:8554/Camera/subStream: Connection refused
[2022-03-29 14:25:38] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:25:38] frigate.video                  ERROR   : OfficeCamera: ffmpeg process is not running. exiting capture thread...
[2022-03-29 14:25:48] watchdog.OfficeCamera          ERROR   : Ffmpeg process crashed unexpectedly for OfficeCamera.
[2022-03-29 14:25:48] watchdog.OfficeCamera          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-03-29 14:25:48] ffmpeg.OfficeCamera.detect     ERROR   : [tcp @ 0x564c75b14280] Connection to tcp://127.0.0.1:8554?timeout=5000000 failed: Connection refused
[2022-03-29 14:25:48] ffmpeg.OfficeCamera.detect     ERROR   : rtsp://127.0.0.1:8554/Camera/subStream: Connection refused
[2022-03-29 14:25:48] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:25:48] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:25:48] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:25:48] frigate.video                  ERROR   : OfficeCamera: ffmpeg process is not running. exiting capture thread...
[2022-03-29 14:25:58] watchdog.OfficeCamera          ERROR   : Ffmpeg process crashed unexpectedly for OfficeCamera.
[2022-03-29 14:25:58] watchdog.OfficeCamera          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-03-29 14:25:58] ffmpeg.OfficeCamera.detect     ERROR   : [tcp @ 0x55812a296280] Connection to tcp://127.0.0.1:8554?timeout=5000000 failed: Connection refused
[2022-03-29 14:25:58] ffmpeg.OfficeCamera.detect     ERROR   : rtsp://127.0.0.1:8554/Camera/subStream: Connection refused
[2022-03-29 14:25:58] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:25:58] frigate.video                  ERROR   : OfficeCamera: Unable to read frames from ffmpeg process.
[2022-03-29 14:25:58] frigate.video                  ERROR   : OfficeCamera: ffmpeg process is not running. exiting capture thread...

FFprobe output from your camera

NA

Frigate stats

No response

Operating system

HassOS

Install method

HassOS Addon

Coral version

CPU (no coral)

Network connection

Wireless

Camera make and model

Reolink Argus 3 Pro

Any other information that may be helpful

Since Reolink does not provide native RTSP... used Neolink to setup a RTSP. I'm able to view the stream on VLC and got the codec info from there and input that into the code.

NickM-27 commented 2 years ago

Are you using VLC on the same device that Neolink is running? Is neolink running inside the HA VM?

I see the MQTT IP is 192.168.1.117 and neolink seems to be running rtsp://127.0.0.1:8554/Camera/subStream which is usually a localhost IP, so if neolink is running outside the HA VM then that IP wouldn't work

Yashaa02 commented 2 years ago

Are you using VLC on the same device that Neolink is running? Is neolink running inside the HA VM?

I see the MQTT IP is 192.168.1.117 and neolink seems to be running rtsp://127.0.0.1:8554/Camera/subStream which is usually a localhost IP, so if neolink is running outside the HA VM then that IP wouldn't work

Yes, I'm using VLC on the same device that I have setup neolink on, which is my PC, and then running a VM on that PC which has HA setup on.

NickM-27 commented 2 years ago

Yes, I'm using VLC on the same device that I have setup neolink on, which is my PC, and then running a VM on that PC which has HA setup on.

Does the VM have access to network devices outside of the VM? The PCs network will need to be passed / available to the VM.

Also just as a general ifno, from the docs these are the recommended reolink settings (using http mjpeg): https://docs.frigate.video/configuration/camera_specific#reolink-410520-possibly-others

Yashaa02 commented 2 years ago

Yes, I'm using VLC on the same device that I have setup neolink on, which is my PC, and then running a VM on that PC which has HA setup on.

Does the VM have access to network devices outside of the VM? The PCs network will need to be passed / available to the VM.

Also just as a general ifno, from the docs these are the recommended reolink settings (using http mjpeg): https://docs.frigate.video/configuration/camera_specific#reolink-410520-possibly-others

Oh okay. Sorry new to all this to be honest. How would I go about passing outside networks on the VM that is running Home Assistant. I used a Bridged Adapter for the Network options when setting up the VM for HA.

As per the Reolink camera setup, the Argus 3 Pros dont generate native RTSP, so how would you go about linking them to frigate?

NickM-27 commented 2 years ago

Oh okay. Sorry new to all this to be honest. How would I go about passing outside networks on the VM that is running Home Assistant. I used a Bridged Adapter for the Network options when setting up the VM for HA.

It's been a long time since I've used virtualbox so I am not 100% sure but there should definitely be guides out there for it. I think bridged would be correct you'll just need to figure out how to connect to your computer through your computers IP address and have a port accessible.

Neolink seems to support docker as well so might be easier to just get neolink up and running inside of the VM through a docker container

As per the Reolink camera setup, the Argus 3 Pros dont generate native RTSP, so how would you go about linking them to frigate?

The link I put would not use RTSP but would use the http mjpeg url, which is supported according to this: https://www.ispyconnect.com/camera/argus. I do think neolink would be the preferred solution though.

blakeblackshear commented 2 years ago

The issue here is that rtsp://127.0.0.1:8554 is not the right ip address for your neolink feed. I would try using the local IP address for the host machine. Localhost inside the VM is not the same thing as localhost on the host.

Yashaa02 commented 2 years ago

The issue here is that rtsp://127.0.0.1:8554 is not the right ip address for your neolink feed. I would try using the local IP address for the host machine. Localhost inside the VM is not the same thing as localhost on the host.

I tried to use the IP address from the Host-Only Network at 192.168.56.1. RTSP stream worked with VLC on the computer when I used the link address rtsp://192.168.56.1:8554/Camera/subStream. I'm still getting the same error when it is run on Frigate.

NickM-27 commented 2 years ago

From inside of the VM you should be able to use commandline tools like ping, ipconfig, etc. to find available network and test if the VM can communicate with the neolink instance.

Yashaa02 commented 2 years ago

Since Home Assistant is setup on VirtualBox using VMDK, there is no OS where I can prompt command line tools. I didn't have any luck in allowing firewall permission to the VM so that it can access the local RTSP stream. Any recommendations for allowing firewall permissions for the ports would be appreciated! (not sure which inbound or outbound rules to change) Once again, new to all this kind of setup, thank you so much again for all the help so far!

NickM-27 commented 2 years ago

You'll most likely find better help than I can give in a virtual box forum or subreddit asking more generally "how to let VM access services running on host device". That or Blake may be able to help further.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.