question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Support]: Trying rtmp causes issue

See original GitHub issue

Describe the problem you are having

I have frigate running on docker on a pi4/4GB/SSD with coral. Camera is Reolink RLC-820a. Frigate is up and recognizing objects and saving images with events. Recordings are not playable and there are errors logged. Disabling rtmp changes the error but doesn’t fix anything. I’m using the h264 640x360 stream for detections and trying to record using the h265 3840x2160. (help much appreciated)

Version

0.9.2-25BB515

Frigate config file

mqtt:
  host: homeassistant
  user: nvrmqtt
  password: djf98435sUYa

detectors:
  coral:
    type: edgetpu
    device: usb

objects:
# Optional: list of objects to track from labelmap.txt (default: shown below)
  track:
    - person
    - squirrel
    - car
    - bicycle
    - bird
    - dog
    - cat
    - orange
birdseye:
  # Optional: Enable birdseye view (default: shown below)
  enabled: true
  # width: 1280
  # height: 720
  # 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
  quality: 8
  #   objects - cameras are included if they have had a tracked object within the last 30 seconds
  #   motion - cameras are included if motion was detected in the last 30 seconds
  #   continuous - all cameras are included always
  mode: motion
cameras:
  garageEast:
    ffmpeg:
      inputs:
        - path: rtsp://HAaccess:Ca0l1nn111@cam_gareast:554/h264Preview_01_sub
          roles:
            - detect
        - path: rtsp://HAaccess:Ca0l1nn111@cam_gareast:554/h265Preview_01_main
          roles:
            - rtmp
            - record
      #output_args:
      #  rtmp: -c:a copy -c:v libx264 
    motion:
      threshold: 25
      contour_area: 100
      mask: 
        -  0,32,200,32,200,0,0,0
    detect:
      fps: 5
#      width: 3840
#      height: 2160
      width: 640
      height: 360
      enabled: true
    record:
      enabled: True
      retain_days: 0
      events:
        max_seconds: 300
        retain:
          default: 1
        pre_capture: 2
        post_capture: 5
    # motion: 
      # mask: 2560,220,2196,220,2196,475,2560,475
    zones:
      alley_detect: # detect zone
        coordinates: 757,2160, 757,921, 3840,921 ,3840,2160
        coordinates: 640,360,242,360,242,149,640,149
        objects:
          - person
          - car 
      lot_ignore: #ignore zone due to parking lot
        objects:
          - car 
        coordinates: 482,140,482,101,568,107,568,140

    # Optional: Configuration for the jpg snapshots written to the clips directory for each event
    snapshots:
      # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
      enabled: true
      timestamp: true
      bounding_box: false
      crop: False
        # Optional: height to resize the snapshot to (default: original size)
      # height: 500
      # Optional: Camera override for retention settings (default: global values)

      retain:
        # Required: Default retention days (default: shown below)
        default: 7
        # Optional: Per object retention days
        # objects:
          # person: 14
    rtmp:
      enabled: true

Relevant log output

playback error:
Error: The media could not be loaded, either because the server or network failed or because the format is not supported

frigate log error (repeats):

ffmpeg.garageEast.record_rtmp ERROR :
watchdog.garageEast INFO : Terminating the existing ffmpeg process…
watchdog.garageEast INFO : Waiting for ffmpeg to exit gracefully…
frigate.record WARNING : Discarding a corrupt recording segment: garageEast-20211022171904.ts
ffmpeg.garageEast.record_rtmp ERROR : [flv @ 0x1cac7c0] Video codec hevc not compatible with flv
ffmpeg.garageEast.record_rtmp ERROR : Could not write header for output file #1 (incorrect codec parameters ?): Function not implemented


With rtmp set to enabled: false, this is the error:

frigate.http ERROR : ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)

configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-omx --enable-omx-rpi --enable-mmal --enable-v4l2_m2m --enable-neon --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib

libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
pipe:: Invalid data found when processing input

FFprobe output from your camera

h264 URL:
Input #0, rtsp, from ‘rtsp://HAaccess:Ca0l1nn111@cam_gareast:554/h264Preview_01_sub’:
Metadata:
title : Session streamed by “preview”
comment : h264Preview_01_sub
Duration: N/A, start: 0.000188, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(progressive), 640x360, 24.92 tbr, 90k tbn, 180k tbc

H265 URL:
Input #0, rtsp, from ‘rtsp://HAaccess:Ca0l1nn111@cam_gareast:554/h265Preview_01_main’:
Metadata:
title : Session streamed by “preview”
comment : h265Preview_01_main
Duration: N/A, start: 0.000250, bitrate: N/A
Stream #0:0: Video: hevc (Main), yuv420p(tv), 3840x2160, 24.92 tbr, 90k tbn, 90k tbc
Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp

Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp

Frigate stats

{"detection_fps":0.0,"detectors":{"coral":{"detection_start":0.0,"inference_speed":14.97,"pid":214}},"garageEast":{"camera_fps":5.0,"capture_pid":219,"detection_fps":0.0,"pid":218,"process_fps":5.0,"skipped_fps":0.0},"service":{"storage":{"/dev/shm":{"free":66.2,"mount_type":"tmpfs","total":67.1,"used":0.9},"/media/frigate/clips":{"free":230753.3,"mount_type":"ext4","total":245821.4,"used":5026.4},"/media/frigate/recordings":{"free":230753.3,"mount_type":"ext4","total":245821.4,"used":5026.4},"/tmp/cache":{"free":1000.0,"mount_type":"tmpfs","total":1000.0,"used":0.0}},"uptime":149262,"version":"0.9.2-25bb515"}}

Operating system

Debian

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

Reolink RLC-820a

Any other information that may be helpful

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
uSlackrcommented, Oct 25, 2021

OK, I changed the config to this and it appears to work OK. Recording is done with the high res stream and detection with the low.
Odd that the event video stream is visible on my iphone but not on the Win 11 (with edge 95). That gives me the “playback cannot continue…” error. I’m going to play around with the different res streams for h264. I have to figure out why edge isn’t supporting it.

Is anyone collecting working configs for various camera in one place?

Thank you for this great piece of software!

cameras:
  garageEast:
    # Reolink RLC-820a
    ffmpeg:
      inputs:
        - path: rtsp://HAaccess:Ca0l1nn111@cam_gareast:554/h264Preview_01_sub
          roles:
            - detect
        - path: rtsp://HAaccess:Ca0l1nn111@cam_gareast:554/h265Preview_01_main
          roles:
          #  - rtmp
            - record

1reaction
blakeblackshearcommented, Oct 24, 2021

You will definitely need to disable rtmp or assign it to the H264 role instead. I am guessing the event you are trying to view didn’t have any recorded footage because of the RTMP related error. What were you doing when you saw the second error message?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is RTMP (Why Shouldn't I Use It)? - Resi
RTMP lacks support for high-resolution video and next-gen compression methods like H. 265/HEVC, VP9, AV1, etc. RTMP is also highly vulnerable to audio/video ......
Read more >
How to Troubleshoot Live Streaming Issues with Broadcasting
Live streaming has a lot of moving parts. If things go wrong, here are ten ways for troubleshooting streaming issues right away.
Read more >
Delay in RTMP stream · Issue #2367 · blakeblackshear/frigate
WebRTC does not work because RTMP is not supported and I cannot create another stream to camera. Home Assistant stream has a big...
Read more >
"Streaming Server Bad Response" | Switcher Studio Help Center
There are a few possible causes: There is an error in the Custom RTMP setup (this is the most common cause)
Read more >
Troubleshooting Video Input Issues with BoxCaster ...
This article covers how BoxCast encoders behave when encountering various video input issues, as well as some common troubleshooting tips.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found