frigate icon indicating copy to clipboard operation
frigate copied to clipboard

[Config Support]: Capturing a stream from motion (motioneye)

Open Hoerli1337 opened this issue 2 years ago • 7 comments

Describe the problem you are having

I have already installed motioneye. Now I have installed frigate as docker. Unfortunately, I can't get it to include the HTTP stream. I also can't manage to include the USB camera directly in frigate.

Version

Frigate (0.10.1-83481af)

Frigate config file

mqtt:
  host: 192.168.178.110
  user: blaaaaaaaaah
  password: blaaaaaaaaaaaah
  topic_prefix: frigate
  
cameras:
  back:
    ffmpeg:
      inputs:
        - path: http://192.168.178.200:8091
          roles:
            - detect
            - http
    detect:
      width: 1280
      height: 720

Relevant log output

frigate  | [2022-08-20 18:28:35] ffmpeg.back.detect             ERROR   : Option stimeout not found.
frigate  | [2022-08-20 18:28:36] frigate.video                  ERROR   : back: Unable to read frames from ffmpeg process.
frigate  | [2022-08-20 18:28:36] frigate.video                  ERROR   : back: ffmpeg process is not running. exiting capture thread...

Frigate stats

No response

Operating system

Debian

Install method

Docker Compose

Coral version

CPU (no coral)

Any other information that may be helpful

I have a Microsoft LifeCam Cinema as webcam. I running it on a Pine ROCK64 with 4GB RAM.

Hoerli1337 avatar Aug 20 '22 16:08 Hoerli1337

Check out the docs, the default input args won't work for http camera

You didn't include ffprobe output for the stream so I'm unsure what type of screen is, but here's one to try by default:

https://docs.frigate.video/configuration/camera_specific#blue-iris-rtsp-cameras

NickM-27 avatar Aug 20 '22 23:08 NickM-27

The documentation for this is unfortunately not informative enough. I have read it, but the examples are so far only valid for rtsp-cameras. For HTTP streams I've only seen some examples on the internet - mostly in YouTube videos. Supposedly this should work, but I can't get it to work. I tried it with various flags, but that seems to have absolutely no effect.

To test the general function, I installed an RTSP server app on my smartphone. So far it has worked. Unfortunately, no app allows to turn off the screen to abuse an old smartphone as a surveillance camera.

If an http stream is absolutely not supported, Frigate is currently probably not a solution for me.

Hoerli1337 avatar Aug 21 '22 08:08 Hoerli1337

Frigate uses ffmpeg to capture streams, ffmpeg of course supports http streams so http streams are supported. I also use http stream from a camera in my setup and it works as expected.

Like I said, you have provided no information on what type of http stream is being supplied (jsmpeg, mjpeg, h264, etc) so it's difficult to suggest anything.

NickM-27 avatar Aug 21 '22 11:08 NickM-27

Also, did you try the input args that I linked? What were the logs for that?

NickM-27 avatar Aug 21 '22 12:08 NickM-27

It is a MJPEG-Stream.

I try the args, but did not work.

frigate  | [2022-08-21 18:42:16] ffmpeg.hinten.detect           ERROR   : Error splitting the argument list: Option not found
frigate  | [2022-08-21 18:42:16] frigate.video                  ERROR   : back: Unable to read frames from ffmpeg process.
frigate  | [2022-08-21 18:42:16] frigate.video                  ERROR   : back: Unable to read frames from ffmpeg process.

Hoerli1337 avatar Aug 21 '22 16:08 Hoerli1337

It is a MJPEG-Stream.

I try the args, but did not work.

frigate  | [2022-08-21 18:42:16] ffmpeg.hinten.detect           ERROR   : Error splitting the argument list: Option not found
frigate  | [2022-08-21 18:42:16] frigate.video                  ERROR   : back: Unable to read frames from ffmpeg process.
frigate  | [2022-08-21 18:42:16] frigate.video                  ERROR   : back: Unable to read frames from ffmpeg process.

Okay, then you'll need to use the specific args for mjpeg streams

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

If it doesn't work then please include your logs and updated config

NickM-27 avatar Aug 21 '22 17:08 NickM-27

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.

github-actions[bot] avatar Sep 21 '22 00:09 github-actions[bot]

For what it's worth, I am running motion eye on a Raspberry Pi and was able to get the http stream to work with frigate

cameras:
  picam:
    ffmpeg:
      input_args: -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts+discardcorrupt -use_wallclock_as_timestamps 1 -c:v mjpeg
      output_args:
        record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v libx264 -an
        rtmp: -c:v libx264 -an -f flv
      inputs:
        - path: http://xxxxx
          roles:
            - detect
            - rtmp
            - record
    detect:
      width: 1920
      height: 1080
      fps: 5

Hope that helps someone!

frakman1 avatar Feb 06 '23 21:02 frakman1

Hi @frakman1 !

I am running into the same issue here. Running frigate and want to incluse the motion stream i have running but without succes...

Which of the three links did you use and with or without authentication?

Thanks in advance!!

wouterverduin avatar Oct 01 '23 13:10 wouterverduin

In my case, the Pi running motioneye is in a separate physical location/network so I use ngrok to access it from frigate. The stream I'm using from motioneye however, is the one the UI provides via the 8081 port. I map that to an ngrok URL and use that in frigate.

frakman1 avatar Oct 01 '23 15:10 frakman1

For what it's worth, I am running motion eye on a Raspberry Pi and was able to get the http stream to work with frigate

cameras:
  picam:
    ffmpeg:
      input_args: -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts+discardcorrupt -use_wallclock_as_timestamps 1 -c:v mjpeg
      output_args:
        record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v libx264 -an
        rtmp: -c:v libx264 -an -f flv
      inputs:
        - path: http://xxxxx
          roles:
            - detect
            - rtmp
            - record
    detect:
      width: 1920
      height: 1080
      fps: 5

Hope that helps someone!

Thanks for this -- This is great and works well, excluding the performance hits.

FYI for others: I'm on a new pi5 w/NVME ssd and all 4 CPU cores max out doing the ffmpeg conversion (+ frigate). Previously, I was doing this http/mjpeg transcoding on an external pi4 and serving rtsp/h264 streams to frigate. This way I lose frames sometimes, but frigate is always responsive. Eventually I plan to move the motioneye http devices over to rtsp native, but I've yet to get the rtsp streaming server to perform very well on a pi zero.

jshep321 avatar May 11 '24 16:05 jshep321