frigate icon indicating copy to clipboard operation
frigate copied to clipboard

[Config Support]: FFMPEG error for Reolink RLC-820A

Open Everett115 opened this issue 1 year ago • 8 comments

Describe the problem you are having

I am getting an FFMEG issue for the new Reolink camera i just added. I have 4 Amcrest cameras that have been working fine but I'm struggling to set this one up. I setup the config based on the recommended Reolink config in the docs. I removed the rest of my working cameras from the config so it is easier to read.

The issue appears to only be with the main stream giving the following FFMPEG error: Invalid data found when processing input.

I'm not sure if my config is setup wrong or if this is a Reolink issue. Any help would be appreciated!

Version

0.12.1-367D724

Frigate config file

mqtt:
  host: 192.168.1.68
  user: ***
  password: ***

ui:
  live_mode: mse

database:
  path: /db/frigate.db

logger:
  default: error

detectors:
  coral:
    type: edgetpu
    device: usb

#go2rtc
go2rtc:
  streams:
    Reolink2: 
      - "ffmpeg:http://192.168.1.15/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=***&password=***#video=copy#audio=copy#audio=opus"
    Reolink2_sub: 
      - "ffmpeg:http://192.168.1.15/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=***&password=***"


#Global Hardware Acceleration Arguments
ffmpeg:
  hwaccel_args: preset-vaapi


#Global Object Settings
objects:
  track:
    - person
    - dog
    - cat
    - bird
  filters:
    person:
      min_area: 2500
      max_area: 100000
      threshold: 0.8  

#Birdseye Settings
birdseye:
  enabled: True
  mode: continuous
  restream: true

#Camera Settings
cameras:
  Reolink2:
    ffmpeg:
      inputs:
        # Main Stream - High Res
        - path: rtsp://127.0.0.1:8554/Reolink2?video=copy&audio=aac
          input_args: preset-rtsp-restream
          roles:
            - record
            - rtmp
        # Sub Stream - Low Res      
        - path: rtsp://127.0.0.1:8554/Reolink2_sub?video=copy
          input_args: preset-rtsp-restream
          roles:
            - detect 
      output_args:
        record: preset-record-generic-audio-aac        
    detect:
      width: 640
      height: 360
      fps: 4
    record: 
      enabled: True
      retain:
        days: 5
      events:
        retain:
          default: 5
          objects:
            person: 15  
    snapshots: 
      enabled: True
      retain:
        default: 5
        objects:
          person: 15

Relevant log output

2024-01-09 22:21:48.747028178  [2024-01-09 22:21:48] ffmpeg.Reolink2.record_rtmp    ERROR   : rtsp://127.0.0.1:8554/Reolink2?video=copy&audio=aac: Invalid data found when processing input
2024-01-09 22:21:50.864554764  192.168.1.68 - - [09/Jan/2024:22:21:50 -0600] "GET /api/stats HTTP/1.1" 200 3570 "-" "HomeAssistant/2024.1.2 aiohttp/3.9.1 Python/3.11" "-"
2024-01-09 22:21:58.754492933  [2024-01-09 22:21:58] ffmpeg.Reolink2.record_rtmp    ERROR   : rtsp://127.0.0.1:8554/Reolink2?video=copy&audio=aac: Invalid data found when processing input
2024-01-09 22:21:58.862174183  192.168.1.68 - - [09/Jan/2024:22:21:58 -0600] "GET /api/stats HTTP/1.1" 200 3600 "-" "HomeAssistant/2024.1.2 aiohttp/3.9.1 Python/3.11" "-"
2024-01-09 22:22:06.862205669  192.168.1.68 - - [09/Jan/2024:22:22:06 -0600] "GET /api/stats HTTP/1.1" 200 3505 "-" "HomeAssistant/2024.1.2 aiohttp/3.9.1 Python/3.11" "-"
2024-01-09 22:22:07.212854385  192.168.1.171 - - [09/Jan/2024:22:22:07 -0600] "GET /live/mse/api/ws?src=Reolink2 HTTP/1.1" 101 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" "-"
2024-01-09 22:22:08.761671312  [2024-01-09 22:22:08] ffmpeg.Reolink2.record_rtmp    ERROR   : rtsp://127.0.0.1:8554/Reolink2?video=copy&audio=aac: Invalid data found when processing input
2024-01-09 22:22:14.859305751  192.168.1.68 - - [09/Jan/2024:22:22:14 -0600] "GET /api/stats HTTP/1.1" 200 3472 "-" "HomeAssistant/2024.1.2 aiohttp/3.9.1 Python/3.11" "-"
2024-01-09 22:22:17.774664892  192.168.1.171 - - [09/Jan/2024:22:22:17 -0600] "GET /api/config HTTP/1.1" 200 22390 "http://192.168.1.68:5000/cameras/Reolink2" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" "-"
2024-01-09 22:22:18.769008798  [2024-01-09 22:22:18] ffmpeg.Reolink2.record_rtmp    ERROR   : rtsp://127.0.0.1:8554/Reolink2?video=copy&audio=aac: Invalid data found when processing input
2024-01-09 22:22:22.861750627  192.168.1.68 - - [09/Jan/2024:22:22:22 -0600] "GET /api/stats HTTP/1.1" 200 3472 "-" "HomeAssistant/2024.1.2 aiohttp/3.9.1 Python/3.11" "-"
2024-01-09 22:22:28.776800496  [2024-01-09 22:22:28] ffmpeg.Reolink2.record_rtmp    ERROR   : rtsp://127.0.0.1:8554/Reolink2?video=copy&audio=aac: Invalid data found when processing input
2024-01-09 22:22:30.858806904  192.168.1.68 - - [09/Jan/2024:22:22:30 -0600] "GET /api/stats HTTP/1.1" 200 3505 "-" "HomeAssistant/2024.1.2 aiohttp/3.9.1 Python/3.11" "-"
2024-01-09 22:22:38.783923879  [2024-01-09 22:22:38] ffmpeg.Reolink2.record_rtmp    ERROR   : rtsp://127.0.0.1:8554/Reolink2?video=copy&audio=aac: Invalid data found when processing input
2024-01-09 22:22:38.859172896  192.168.1.68 - - [09/Jan/2024:22:22:38 -0600] "GET /api/stats HTTP/1.1" 200 3505 "-" "HomeAssistant/2024.1.2 aiohttp/3.9.1 Python/3.11" "-"
2024-01-09 22:22:46.855287824  192.168.1.68 - - [09/Jan/2024:22:22:46 -0600] "GET /api/stats HTTP/1.1" 200 3504 "-" "HomeAssistant/2024.1.2 aiohttp/3.9.1 Python/3.11" "-"
2024-01-09 22:22:48.709410049  22:22:48.709 ERR [exec] timeout url="exec:ffmpeg -hide_banner -v error -fflags nobuffer -flags low_delay -i http://192.168.1.15/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=Evrito1998 -map 0:v:0? -c:v:0 copy -map 0:a:0? -c:a:0 copy -map 0:a:0? -c:a:1 libopus -application:a:1 lowdelay -min_comp 0 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output}"
2024-01-09 22:22:48.709577554  22:22:48.709 WRN [rtsp] error="streams: timeout" stream=Reolink2
2024-01-09 22:22:48.709659892  22:22:48.709 WRN github.com/AlexxIT/go2rtc/internal/rtsp/rtsp.go:225 > error="write tcp 127.0.0.1:8554->127.0.0.1:56072: write: broken pipe"
2024-01-09 22:22:48.791231781  [2024-01-09 22:22:48] ffmpeg.Reolink2.record_rtmp    ERROR   : rtsp://127.0.0.1:8554/Reolink2?video=copy&audio=aac: Invalid data found when processing input

Frigate stats

{"Back_Door":{"camera_fps":5.1,"capture_pid":304,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":311,"pid":296,"process_fps":5.1,"skipped_fps":0.0},"Back_Yard":{"camera_fps":5.0,"capture_pid":305,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":321,"pid":298,"process_fps":5.0,"skipped_fps":0.0},"Driveway":{"camera_fps":5.1,"capture_pid":313,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":322,"pid":301,"process_fps":5.1,"skipped_fps":0.0},"Reolink2":{"camera_fps":4.0,"capture_pid":315,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":330,"pid":302,"process_fps":4.0,"skipped_fps":0.0},"Side_Gate":{"camera_fps":5.0,"capture_pid":309,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":334,"pid":299,"process_fps":5.0,"skipped_fps":0.0},"cpu_usages":{"%Cpu(s):":{"cpu":"id,","mem":"7.0"},"1":{"cpu":"0.0","mem":"0.0"},"100":{"cpu":"2.0","mem":"3.0"},"110":{"cpu":"0.0","mem":"0.0"},"117":{"cpu":"0.0","mem":"0.2"},"134":{"cpu":"0.0","mem":"0.1"},"135":{"cpu":"0.0","mem":"0.1"},"1352":{"cpu":"0.0","mem":"0.2"},"136":{"cpu":"0.0","mem":"0.1"},"1369":{"cpu":"0.0","mem":"0.0"},"137":{"cpu":"0.0","mem":"0.1"},"1395":{"cpu":"0.0","mem":"0.2"},"1398":{"cpu":"0.0","mem":"0.0"},"1404":{"cpu":"0.3","mem":"0.0"},"15":{"cpu":"0.0","mem":"0.0"},"16":{"cpu":"0.0","mem":"0.0"},"24":{"cpu":"0.0","mem":"0.0"},"25":{"cpu":"0.0","mem":"0.0"},"26":{"cpu":"0.0","mem":"0.0"},"27":{"cpu":"0.0","mem":"0.0"},"28":{"cpu":"0.0","mem":"0.0"},"282":{"cpu":"0.0","mem":"1.0"},"288":{"cpu":"0.0","mem":"0.1"},"289":{"cpu":"0.0","mem":"1.3"},"29":{"cpu":"0.0","mem":"0.0"},"290":{"cpu":"4.7","mem":"1.2"},"296":{"cpu":"0.3","mem":"1.1"},"297":{"cpu":"0.0","mem":"0.2"},"298":{"cpu":"0.3","mem":"1.1"},"299":{"cpu":"0.3","mem":"1.1"},"30":{"cpu":"0.0","mem":"0.0"},"300":{"cpu":"0.0","mem":"0.2"},"301":{"cpu":"0.3","mem":"1.2"},"302":{"cpu":"0.3","mem":"1.2"},"303":{"cpu":"0.0","mem":"0.2"},"304":{"cpu":"0.7","mem":"1.1"},"305":{"cpu":"0.3","mem":"1.1"},"307":{"cpu":"0.0","mem":"0.2"},"309":{"cpu":"0.7","mem":"1.1"},"31":{"cpu":"0.0","mem":"0.0"},"311":{"cpu":"1.3","mem":"0.6"},"313":{"cpu":"1.0","mem":"1.1"},"315":{"cpu":"0.7","mem":"1.1"},"318":{"cpu":"0.0","mem":"0.2"},"32":{"cpu":"0.0","mem":"0.0"},"321":{"cpu":"1.3","mem":"0.6"},"322":{"cpu":"1.7","mem":"0.7"},"329":{"cpu":"3.7","mem":"0.6"},"330":{"cpu":"1.3","mem":"0.6"},"332":{"cpu":"2.0","mem":"0.3"},"334":{"cpu":"2.0","mem":"0.6"},"335":{"cpu":"2.0","mem":"0.3"},"343":{"cpu":"2.0","mem":"0.3"},"349":{"cpu":"0.3","mem":"0.3"},"350":{"cpu":"1.7","mem":"0.3"},"41":{"cpu":"0.0","mem":"0.0"},"42":{"cpu":"0.0","mem":"0.0"},"80":{"cpu":"0.0","mem":"0.0"},"81":{"cpu":"0.0","mem":"0.0"},"82":{"cpu":"0.0","mem":"0.0"},"89":{"cpu":"10.3","mem":"0.6"},"MiB":{"cpu":"5081.8","mem":"avail"},"PID":{"cpu":"%CPU","mem":"%MEM"},"Tasks:":{"cpu":"stopped,","mem":"0"},"top":{"cpu":"users,","mem":"load"}},"detection_fps":0.0,"detectors":{"coral":{"detection_start":0.0,"inference_speed":8.26,"pid":289}},"gpu_usages":{"intel-vaapi":{"gpu":"1.64 %","mem":"- %"}},"service":{"last_updated":1704860892,"latest_version":"0.12.1","storage":{"/dev/shm":{"free":622.9,"mount_type":"tmpfs","total":629.1,"used":6.2},"/media/frigate/clips":{"free":387465.2,"mount_type":"ext4","total":1967846.1,"used":1480344.2},"/media/frigate/recordings":{"free":387465.2,"mount_type":"ext4","total":1967846.1,"used":1480344.2},"/tmp/cache":{"free":955.0,"mount_type":"tmpfs","total":1000.0,"used":45.0}},"temperatures":{},"uptime":444,"version":"0.12.1-367d724"}}

Operating system

Other Linux

Install method

Docker Compose

Coral version

USB

Any other information that may be helpful

go2rtc logs:

1/9/2024, 10:20:47 PM info go2rtc version 1.8.5 linux/amd64 1/9/2024, 10:20:47 PM info [api] listen addr=:1984 1/9/2024, 10:20:47 PM info [rtsp] listen addr=:8554 1/9/2024, 10:20:47 PM info [webrtc] listen addr=:8555 1/9/2024, 10:21:48 PM error [exec] timeout url=exec:ffmpeg -hide_banner -v error -fflags nobuffer -flags low_delay -i http://192.168.1.15/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=Evrito1998 -map 0:v:0? -c:v:0 copy -map 0:a:0? -c:a:0 copy -map 0:a:0? -c:a:1 libopus -application:a:1 lowdelay -min_comp 0 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output} 1/9/2024, 10:22:48 PM error [exec] timeout url=exec:ffmpeg -hide_banner -v error -fflags nobuffer -flags low_delay -i http://192.168.1.15/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=Evrito1998 -map 0:v:0? -c:v:0 copy -map 0:a:0? -c:a:0 copy -map 0:a:0? -c:a:1 libopus -application:a:1 lowdelay -min_comp 0 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output} 1/9/2024, 10:22:48 PM warn [rtsp] error=streams: timeout stream=Reolink2 1/9/2024, 10:22:48 PM warn undefined error=write tcp 127.0.0.1:8554->127.0.0.1:56072: write: broken pipe caller=github.com/AlexxIT/go2rtc/internal/rtsp/rtsp.go:225 1/9/2024, 10:23:48 PM error [exec] timeout url=exec:ffmpeg -hide_banner -v error -fflags nobuffer -flags low_delay -i http://192.168.1.15/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=Evrito1998 -map 0:v:0? -c:v:0 copy -map 0:a:0? -c:a:0 copy -map 0:a:0? -c:a:1 libopus -application:a:1 lowdelay -min_comp 0 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output} 1/9/2024, 10:24:48 PM error [exec] timeout url=exec:ffmpeg -hide_banner -v error -fflags nobuffer -flags low_delay -i http://192.168.1.15/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=Evrito1998 -map 0:v:0? -c:v:0 copy -map 0:a:0? -c:a:0 copy -map 0:a:0? -c:a:1 libopus -application:a:1 lowdelay -min_comp 0 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output} 1/9/2024, 10:25:48 PM error [exec] timeout url=exec:ffmpeg -hide_banner -v error -fflags nobuffer -flags low_delay -i http://192.168.1.15/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=Evrito1998 -map 0:v:0? -c:v:0 copy -map 0:a:0? -c:a:0 copy -map 0:a:0? -c:a:1 libopus -application:a:1 lowdelay -min_comp 0 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output} 1/9/2024, 10:26:48 PM error [exec] timeout url=exec:ffmpeg -hide_banner -v error -fflags nobuffer -flags low_delay -i http://192.168.1.15/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=Evrito1998 -map 0:v:0? -c:v:0 copy -map 0:a:0? -c:a:0 copy -map 0:a:0? -c:a:1 libopus -application:a:1 lowdelay -min_comp 0 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output} 1/9/2024, 10:27:48 PM error [exec] timeout url=exec:ffmpeg -hide_banner -v error -fflags nobuffer -flags low_delay -i http://192.168.1.15/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=Evrito1998 -map 0:v:0? -c:v:0 copy -map 0:a:0? -c:a:0 copy -map 0:a:0? -c:a:1 libopus -application:a:1 lowdelay -min_comp 0 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output} 1/9/2024, 10:28:48 PM error [exec] timeout url=exec:ffmpeg -hide_banner -v error -fflags nobuffer -flags low_delay -i http://192.168.1.15/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=Evrito1998 -map 0:v:0? -c:v:0 copy -map 0:a:0? -c:a:0 copy -map 0:a:0? -c:a:1 libopus -application:a:1 lowdelay -min_comp 0 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output}

Everett115 avatar Jan 10 '24 04:01 Everett115

that config does not work with high resolution streams on reolink, you either need to lower the resolution or use rtsp

NickM-27 avatar Jan 10 '24 13:01 NickM-27

Okay I changed the main stream to RSTP and its partially working but I am still getting errors and the live view seems to freeze alot.

go2rtc:
  streams:
    Reolink2: 
      - rtsp://admin:***@192.168.1.15:554/h264Preview_01_main
      - ffmpeg:Reolink2#audio=opus
    Reolink2_sub: 
      - "ffmpeg:http://192.168.1.15/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=***"
 Reolink2:
    ffmpeg:
      inputs:
        # Main Stream - High Res
        - path: rtsp://127.0.0.1:8554/Reolink2
          input_args: preset-rtsp-restream
          roles:
            - record
            - rtmp
        # Sub Stream - Low Res      
        - path: rtsp://127.0.0.1:8554/Reolink2_sub?video=copy
          input_args: preset-rtsp-restream
          roles:
            - detect 
      output_args:
        record: preset-record-generic-audio-aac        
    detect:
      width: 640
      height: 360
      fps: 4
    record: 
      enabled: True
      retain:
        days: 5
      events:
        retain:
          default: 5
          objects:
            person: 15  
    snapshots: 
      enabled: True
      retain:
        default: 5
        objects:
          person: 15  
2024-01-11 15:52:40.552233506  [2024-01-11 15:52:40] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2024-01-11 15:55:20.757920054  [2024-01-11 15:55:20] ffmpeg.Reolink2.record_rtmp    ERROR   : [segment @ 0x556ca874b040] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
2024-01-11 15:55:20.758533797  [2024-01-11 15:55:20] ffmpeg.Reolink2.record_rtmp    ERROR   : [aac @ 0x556ca874d500] Input buffer exhausted before END element found
2024-01-11 15:55:20.758687200  [2024-01-11 15:55:20] ffmpeg.Reolink2.record_rtmp    ERROR   : Error while decoding stream #0:1: Invalid data found when processing input
2024-01-11 15:55:20.758775085  [2024-01-11 15:55:20] ffmpeg.Reolink2.record_rtmp    ERROR   : [aac @ 0x556ca874d500] channel element 1.9 is not allocated
2024-01-11 15:55:20.758874093  [2024-01-11 15:55:20] ffmpeg.Reolink2.record_rtmp    ERROR   : Error while decoding stream #0:1: Invalid data found when processing input
2024-01-11 15:55:20.758952161  [2024-01-11 15:55:20] ffmpeg.Reolink2.record_rtmp    ERROR   : [aac @ 0x556ca874d500] channel element 0.0 is not allocated
2024-01-11 15:55:20.759186812  [2024-01-11 15:55:20] ffmpeg.Reolink2.record_rtmp    ERROR   : Error while decoding stream #0:1: Invalid data found when processing input
2024-01-11 15:55:20.759190071  [2024-01-11 15:55:20] ffmpeg.Reolink2.record_rtmp    ERROR   : [rtsp @ 0x556ca8732f00] RTP: PT=61: bad cseq fa8c expected=56e3
2024-01-11 15:55:20.759476683  [2024-01-11 15:55:20] ffmpeg.Reolink2.record_rtmp    ERROR   : [rtsp @ 0x556ca8732f00] RTP: PT=60: bad cseq b9fa expected=8e39
2024-01-11 15:55:20.759479451  [2024-01-11 15:55:20] ffmpeg.Reolink2.record_rtmp    ERROR   : rtsp://127.0.0.1:8554/Reolink2: Connection timed out

Everett115 avatar Jan 11 '24 21:01 Everett115

Yes unfortunately rtsp in reolinks is not good. You could try using ffmpeg on the stream in go2rtc and see if it works better

NickM-27 avatar Jan 12 '24 00:01 NickM-27

Sorry could you explain how to do that? I am actually getting crashes on the machine now. I tried doing it like this but I'm not sure if that's what you meant.

Reolink2: 
   - "ffmpeg:rtsp://admin:***@192.168.1.15:554/h264Preview_01_main"
   - ffmpeg:Reolink2#audio=opus

Everett115 avatar Jan 12 '24 02:01 Everett115

that is what I meant

NickM-27 avatar Jan 12 '24 03:01 NickM-27

What model is the Reolink? This sounds like a potential H265 incompatibility issue? Try adding

  • "ffmpeg:driveway#video=h264#hardware"

BallistikG avatar Jan 12 '24 17:01 BallistikG

Just try it without transcoding. I use various Reolink cameras and they work wonderfully with them in full resolution.

Look here or here.

Bettman66 avatar Jan 18 '24 02:01 Bettman66

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 18 '24 00:02 github-actions[bot]