frigate icon indicating copy to clipboard operation
frigate copied to clipboard

[Support]: Restream does not work with second camera (0.12.0-beta2)

Open mr-manuel opened this issue 2 years ago • 7 comments

Describe the problem you are having

The restream for the second camera does not work, for the first one it works without problems. The RTSP stream directly from the camera has no password. If I move the detect and record role directly to the camera path it works as normal, so it has to be the restream function.

Works:

  Stairs:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://192.168.0.81:554/stream0
          roles:
            - detect
            - record

Does not work (see error below):

  Stairs:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://192.168.0.81:554/stream0
          roles:
            - restream
        - path: rtsp://localhost:8554/Stairs
          roles:
            - detect
            - record

Version

0.12.0-beta2

Frigate config file

mqtt:
  host: mosquitto
  port: 1883
  stats_interval: 60

detectors:
  cpu1:
    type: cpu
  cpu2:
    type: cpu

detect:
  fps: 8
  enabled: true
  max_disappeared: 25
  stationary:
    interval: 0
    threshold: 50
    max_frames:
      default: 3000
      objects:
        person: 1000

objects:
  filters:
    person:
      min_area: 0
      max_area: 24000000
      min_score: 0.5
      threshold: 0.7

motion:
  threshold: 25
  contour_area: 30
  delta_alpha: 0.2
  frame_alpha: 0.2
  frame_height: 50
  improve_contrast: false
  mqtt_off_delay: 30

record:
  enabled: true
  expire_interval: 60
  retain:
    days: 2
    mode: all
  events:
    pre_capture: 5
    post_capture: 5

snapshots:
  enabled: true
  timestamp: false
  bounding_box: false
  crop: true

rtmp:
  enabled: false

restream:
  enabled: true
  force_audio: false
  video_encoding: "copy"
  birdseye: false
  jsmpeg:
    height: 1120
    quality: 8

cameras:
  Porch:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://192.168.0.80:554/11
          roles:
            - restream
        - path: rtsp://localhost:8554/Porch
          roles:
            - detect
            - record
    detect:
      width: 2560
      height: 1920
    best_image_timeout: 60
    record:
      enabled: true
    mqtt:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: true
      quality: 70

  Stairs:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://192.168.0.81:554/stream0
          roles:
            - restream
        - path: rtsp://localhost:8554/Stairs
          roles:
            - detect
            - record
    detect:
      width: 3840
      height: 2144
    best_image_timeout: 60
    record:
      enabled: true
    mqtt:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: true
      quality: 70

Relevant log output

2023-01-11 15:06:43.737848196  14:06:43.737 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:51 > error="user/pass not provided"
2023-01-11 15:06:43.944620074  14:06:43.944 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:51 > error="user/pass not provided"
2023-01-11 15:06:43.944625479  14:06:43.944 WRN [rtsp] error="sources unavailable: 1" stream=Stairs
2023-01-11 15:06:49.628316680  14:06:49.628 WRN github.com/AlexxIT/go2rtc/cmd/rtsp/rtsp.go:202 > error=EOF


2023-01-11 15:24:07.028347468  [90m14:24:07.028[0m [32mINF[0m go2rtc version 0.1-rc.5 linux/amd64
2023-01-11 15:24:07.028480779  [90m14:24:07.028[0m [32mINF[0m [api] listen [36maddr=[0m:1984
2023-01-11 15:24:07.028522893  [90m14:24:07.028[0m [32mINF[0m [rtsp] listen [36maddr=[0m:8554
2023-01-11 15:24:07.028641957  [90m14:24:07.028[0m [32mINF[0m [webrtc] listen [36maddr=[0m:8555
2023-01-11 15:24:07.028702437  [90m14:24:07.028[0m [32mINF[0m [srtp] listen [36maddr=[0m:8443
2023-01-11 15:24:08.040468235  [90m14:24:08.040[0m [1m[31mERR[0m[0m [1mgithub.com/AlexxIT/go2rtc/cmd/streams/producer.go:51[0m[36m >[0m [36merror=[0m[31m"user/pass not provided"[0m
2023-01-11 15:24:08.249071599  [90m14:24:08.248[0m [1m[31mERR[0m[0m [1mgithub.com/AlexxIT/go2rtc/cmd/streams/producer.go:51[0m[36m >[0m [36merror=[0m[31m"user/pass not provided"[0m
2023-01-11 15:24:08.249317750  [90m14:24:08.249[0m [31mWRN[0m [rtsp] [36merror=[0m[31m"sources unavailable: 1"[0m [36mstream=[0mStairs
2023-01-11 15:24:27.976164130  [90m14:24:27.976[0m [1m[31mERR[0m[0m [1mgithub.com/AlexxIT/go2rtc/cmd/streams/producer.go:51[0m[36m >[0m [36merror=[0m[31m"user/pass not provided"[0m
2023-01-11 15:24:28.179074703  [90m14:24:28.178[0m [1m[31mERR[0m[0m [1mgithub.com/AlexxIT/go2rtc/cmd/streams/producer.go:51[0m[36m >[0m [36merror=[0m[31m"user/pass not provided"[0m
2023-01-11 15:24:28.179080233  [90m14:24:28.179[0m [31mWRN[0m [rtsp] [36merror=[0m[31m"sources unavailable: 1"[0m [36mstream=[0mStairs

FFprobe output from your camera

Input #0, rtsp, from 'rtsp://192.168.0.81:554/stream0':
  Metadata:
    title           : RTSP/RTP stream from anjvision ipcamera
  Duration: N/A, start: 0.448000, bitrate: N/A
    Stream #0:0: Video: h264, yuv420p(progressive), 3840x2144, 20 fps, 20 tbr, 90k tbn, 40 tbc

Frigate stats

No response

Operating system

Debian

Install method

Docker Compose

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

Any other information that may be helpful

No response

mr-manuel avatar Jan 11 '23 14:01 mr-manuel

What if you use force_audio for that camera specifically?

NickM-27 avatar Jan 11 '23 14:01 NickM-27

If I change to

  Stairs:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://192.168.0.81:554/stream0
          roles:
            - restream
        - path: rtsp://localhost:8554/Stairs
          roles:
            - detect
            - record
    restream:
      enabled: true
      force_audio: false

I have the same error.

mr-manuel avatar Jan 11 '23 14:01 mr-manuel

Right, I said what happens if you do

  Stairs:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://192.168.0.81:554/stream0
          roles:
            - restream
        - path: rtsp://localhost:8554/Stairs
          roles:
            - detect
            - record
    restream:
      enabled: true
      force_audio: true

NickM-27 avatar Jan 11 '23 14:01 NickM-27

Now I set it to true and the error slightly changed:

2023-01-11 16:02:06.687334006  15:02:06.687 WRN github.com/AlexxIT/go2rtc/cmd/rtsp/rtsp.go:202 > error=EOF
2023-01-11 16:02:10.686219221  15:02:10.686 WRN github.com/AlexxIT/go2rtc/cmd/rtsp/rtsp.go:202 > error=EOF
2023-01-11 16:02:16.688812842  15:02:16.688 WRN github.com/AlexxIT/go2rtc/cmd/rtsp/rtsp.go:202 > error=EOF
2023-01-11 16:01:11.843163566  [90m15:01:11.843[0m [32mINF[0m go2rtc version 0.1-rc.6 linux/amd64
2023-01-11 16:01:11.843360421  [90m15:01:11.843[0m [32mINF[0m [api] listen [36maddr=[0m:1984
2023-01-11 16:01:11.843448625  [90m15:01:11.843[0m [32mINF[0m [rtsp] listen [36maddr=[0m:8554
2023-01-11 16:01:11.843609775  [90m15:01:11.843[0m [32mINF[0m [webrtc] listen [36maddr=[0m:8555
2023-01-11 16:01:11.843732927  [90m15:01:11.843[0m [32mINF[0m [srtp] listen [36maddr=[0m:8443
2023-01-11 16:02:06.687334006  [90m15:02:06.687[0m [31mWRN[0m [1mgithub.com/AlexxIT/go2rtc/cmd/rtsp/rtsp.go:202[0m[36m >[0m [36merror=[0m[31mEOF[0m
2023-01-11 16:02:10.686219221  [90m15:02:10.686[0m [31mWRN[0m [1mgithub.com/AlexxIT/go2rtc/cmd/rtsp/rtsp.go:202[0m[36m >[0m [36merror=[0m[31mEOF[0m
2023-01-11 16:02:16.688812842  [90m15:02:16.688[0m [31mWRN[0m [1mgithub.com/AlexxIT/go2rtc/cmd/rtsp/rtsp.go:202[0m[36m >[0m [36merror=[0m[31mEOF[0m

mr-manuel avatar Jan 11 '23 15:01 mr-manuel

Does the other camera also not have a user/pass? Seems the camera is giving some kind of problem because using force_audio = true uses ffmpeg the same as frigate itself so they should either both work or both not work.

NickM-27 avatar Jan 11 '23 15:01 NickM-27

Both cameras doesn't have username and password. I can also open both in VLC without credentials. Also only the restream does not work.

mr-manuel avatar Jan 11 '23 15:01 mr-manuel

I would suggest making an issue on go2rtc for this camera https://github.com/AlexxIT/go2rtc and the logs when using force_audio = false

NickM-27 avatar Jan 11 '23 15:01 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 Feb 11 '23 00:02 github-actions[bot]

This issue was solved with https://github.com/AlexxIT/go2rtc/issues/235

mr-manuel avatar Feb 11 '23 08:02 mr-manuel