frigate icon indicating copy to clipboard operation
frigate copied to clipboard

[Camera Support]: Having trouble getting my Tapo C200 to work with Frigate

Open DChiuch opened this issue 1 year ago • 8 comments

Describe the problem you are having

I'm setting up Frigate for the first time, and I've been unable to get my Tapo C200 camera to work inside Frigate. The camera works in VLC if I access it through rtsp://synology:[email protected]:554/stream1

Version

0.13.1-34FB1C2

Frigate config file

mqtt:
  enabled: False

cameras:
  tapo:
    ffmpeg:
      inputs:
        - path: rtsp://synology:[email protected]:554/stream1 # <--- the name here must match the name of the camera in restream
          roles:
            - detect
    detect:
      enabled: False # <---- disable detection until you have a working camera feed
      width: 640 # <---- update for your camera's resolution
      height: 480 # <---- update for your camera's resolution

Relevant log output

2024-02-14 18:37:44.757998970  [INFO] Preparing Frigate...
2024-02-14 18:37:44.789891565  [INFO] Starting Frigate...
2024-02-14 18:37:47.497861370  [2024-02-14 18:37:47] frigate.app                    INFO    : Starting Frigate (0.13.1-34fb1c2)
2024-02-14 18:37:47.533374386  [2024-02-14 18:37:47] peewee_migrate.logs            INFO    : Starting migrations
2024-02-14 18:37:47.540224937  [2024-02-14 18:37:47] peewee_migrate.logs            INFO    : There is nothing to migrate
2024-02-14 18:37:47.545927696  [2024-02-14 18:37:47] frigate.app                    INFO    : Recording process started: 299
2024-02-14 18:37:47.549502556  [2024-02-14 18:37:47] frigate.app                    INFO    : go2rtc process pid: 89
2024-02-14 18:37:47.569616823  [2024-02-14 18:37:47] detector.cpu                   INFO    : Starting detection process: 308
2024-02-14 18:37:47.572942452  [2024-02-14 18:37:47] frigate.app                    INFO    : Output process started: 310
2024-02-14 18:37:47.575817476  [2024-02-14 18:37:47] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2024-02-14 18:37:47.588976899  [2024-02-14 18:37:47] frigate.app                    INFO    : Camera processor started for tapo: 315
2024-02-14 18:37:47.595078338  [2024-02-14 18:37:47] frigate.app                    INFO    : Capture process started for tapo: 316
2024-02-14 18:38:07.626884444  [2024-02-14 18:38:07] watchdog.tapo                  INFO    : No frames received from tapo in 20 seconds. Exiting ffmpeg...
2024-02-14 18:38:07.627011207  [2024-02-14 18:38:07] watchdog.tapo                  INFO    : Waiting for ffmpeg to exit gracefully...
2024-02-14 18:38:12.737101884  [2024-02-14 18:38:12] frigate.video                  ERROR   : tapo: Unable to read frames from ffmpeg process.
2024-02-14 18:38:12.737211393  [2024-02-14 18:38:12] frigate.video                  ERROR   : tapo: ffmpeg process is not running. exiting capture thread...
2024-02-14 18:38:22.743988013  [2024-02-14 18:38:22] watchdog.tapo                  ERROR   : Ffmpeg process crashed unexpectedly for tapo.
2024-02-14 18:38:22.743994918  [2024-02-14 18:38:22] watchdog.tapo                  ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2024-02-14 18:38:22.744001461  [2024-02-14 18:38:22] ffmpeg.tapo.detect             ERROR   : [h264 @ 0x55fef2c88200] error while decoding MB 53 0, bytestream -7
2024-02-14 18:38:22.744005090  [2024-02-14 18:38:22] ffmpeg.tapo.detect             ERROR   : [h264 @ 0x55fef2c9d440] error while decoding MB 53 0, bytestream -7
2024-02-14 18:38:22.744018693  [2024-02-14 18:38:22] ffmpeg.tapo.detect             ERROR   : rtsp://*:*@192.168.50.213:554/stream1: Connection timed out
2024-02-14 18:38:22.744021728  [2024-02-14 18:38:22] ffmpeg.tapo.detect             ERROR   : rtsp://*:*@192.168.50.213:554/stream1: corrupt decoded frame in stream 0
2024-02-14 18:38:22.744043853  [2024-02-14 18:38:22] ffmpeg.tapo.detect             ERROR   : rtsp://*:*@192.168.50.213:554/stream1: Connection timed out
2024-02-14 18:38:22.744046755  [2024-02-14 18:38:22] ffmpeg.tapo.detect             ERROR   : Finishing stream 0:0 without any data written to it.
2024-02-14 18:38:22.744056115  [2024-02-14 18:38:22] ffmpeg.tapo.detect             ERROR   : Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
2024-02-14 18:38:42.751156198  [2024-02-14 18:38:42] watchdog.tapo                  INFO    : No frames received from tapo in 20 seconds. Exiting ffmpeg...
2024-02-14 18:38:42.751324156  [2024-02-14 18:38:42] watchdog.tapo                  INFO    : Waiting for ffmpeg to exit gracefully...
2024-02-14 18:38:47.860838337  [2024-02-14 18:38:47] frigate.video                  ERROR   : tapo: Unable to read frames from ffmpeg process.
2024-02-14 18:38:47.860963459  [2024-02-14 18:38:47] frigate.video                  ERROR   : tapo: ffmpeg process is not running. exiting capture thread...
2024-02-14 18:38:57.863243995  [2024-02-14 18:38:57] watchdog.tapo                  ERROR   : Ffmpeg process crashed unexpectedly for tapo.
2024-02-14 18:38:57.863250975  [2024-02-14 18:38:57] watchdog.tapo                  ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2024-02-14 18:38:57.863253584  [2024-02-14 18:38:57] ffmpeg.tapo.detect             ERROR   : [h264 @ 0x559b72492200] missing picture in access unit with size 44
2024-02-14 18:38:57.863255631  [2024-02-14 18:38:57] ffmpeg.tapo.detect             ERROR   : [h264 @ 0x559b72492200] no frame!
2024-02-14 18:38:57.863258272  [2024-02-14 18:38:57] ffmpeg.tapo.detect             ERROR   : [rtsp @ 0x559b7248ce00] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
2024-02-14 18:38:57.863260734  [2024-02-14 18:38:57] ffmpeg.tapo.detect             ERROR   : Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2024-02-14 18:38:57.863262768  [2024-02-14 18:38:57] ffmpeg.tapo.detect             ERROR   : [h264 @ 0x559b724a8380] no frame!
2024-02-14 18:38:57.863264994  [2024-02-14 18:38:57] ffmpeg.tapo.detect             ERROR   : rtsp://*:*@192.168.50.213:554/stream1: Connection timed out
2024-02-14 18:38:57.863267262  [2024-02-14 18:38:57] ffmpeg.tapo.detect             ERROR   : Error while decoding stream #0:0: Invalid data found when processing input
2024-02-14 18:38:57.863269404  [2024-02-14 18:38:57] ffmpeg.tapo.detect             ERROR   : rtsp://*:*@192.168.50.213:554/stream1: Connection timed out
2024-02-14 18:38:57.863367825  [2024-02-14 18:38:57] ffmpeg.tapo.detect             ERROR   : Cannot determine format of input stream 0:0 after EOF
2024-02-14 18:38:57.863445771  [2024-02-14 18:38:57] ffmpeg.tapo.detect             ERROR   : Error marking filters as finished

FFprobe output from your camera

ffprobe version 6.1.1 Copyright (c) 2007-2023 the FFmpeg developers
  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.1.1_2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopenvino --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
  libpostproc    57.  3.100 / 57.  3.100
Input #0, rtsp, from 'rtsp://synology:[email protected]:554/stream1':
  Metadata:
    title           : Session streamed by "TP-LINK RTSP Server"
    comment         : stream2
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709, progressive), 1280x720, 15 fps, 16.67 tbr, 90k tbn
  Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s

Frigate stats

No response

Operating system

Other Linux

Install method

Docker CLI

Coral version

CPU (no coral)

Network connection

Wireless

Camera make and model

Tapo C200

Any other information that may be helpful

No response

DChiuch avatar Feb 14 '24 07:02 DChiuch

Hi. My Tapo 200 config is this: (using latest fregate version) it uses restream, low stream for detection and high stream for recording.

go2rtc:
  log:
    exec: trace
  webrtc:
  streams:
    cam_360_tapo_sub: 
      - rtsp://localcamerauser:[email protected]:554/stream2   
      - ffmpeg:cam_360_tapo_sub     
    cam_360_tapo: 
      - tapo://admin:[email protected]  

cameras:
  cam_360_tapo:
    ui:
      order: 1
    ffmpeg:
      hwaccel_args: preset-intel-qsv-h264
      inputs:
        - path:  rtsp://127.0.0.1:8554/cam_360_tapo_sub
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://127.0.0.1:8554/cam_360_tapo
          input_args: preset-rtsp-restream
          roles:
            - record
    objects:
      track:
        - person
        - cat            
    detect:
      width: 640
      height: 360           
      fps: 4
  your config could be different as there could be different hwaccel_args needed.

kpcz avatar Feb 14 '24 09:02 kpcz

Thanks @kpcz, I tried your config but I'm still having trouble unfortunately.

2024-02-15 13:06:59.570997931  [INFO] Starting Frigate...
2024-02-15 13:07:02.927227973  [2024-02-15 13:07:02] frigate.app                    INFO    : Starting Frigate (0.13.1-34fb1c2)
2024-02-15 13:07:02.969472644  [2024-02-15 13:07:02] peewee_migrate.logs            INFO    : Starting migrations
2024-02-15 13:07:02.977363624  [2024-02-15 13:07:02] peewee_migrate.logs            INFO    : There is nothing to migrate
2024-02-15 13:07:02.983204242  [2024-02-15 13:07:02] frigate.app                    INFO    : Recording process started: 297
2024-02-15 13:07:02.987315966  [2024-02-15 13:07:02] frigate.app                    INFO    : go2rtc process pid: 91
2024-02-15 13:07:03.009109210  [2024-02-15 13:07:03] detector.cpu                   INFO    : Starting detection process: 306
2024-02-15 13:07:03.010538496  [2024-02-15 13:07:03] frigate.app                    INFO    : Output process started: 308
2024-02-15 13:07:03.015075835  [2024-02-15 13:07:03] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2024-02-15 13:07:03.034769072  [2024-02-15 13:07:03] frigate.app                    INFO    : Camera processor started for cam_360_tapo: 314
2024-02-15 13:07:03.040698839  [2024-02-15 13:07:03] frigate.app                    INFO    : Capture process started for cam_360_tapo: 315
2024-02-15 13:07:08.177650306  [2024-02-15 13:07:08] frigate.video                  ERROR   : cam_360_tapo: Unable to read frames from ffmpeg process.
2024-02-15 13:07:08.178390331  [2024-02-15 13:07:08] frigate.video                  ERROR   : cam_360_tapo: ffmpeg process is not running. exiting capture thread...
2024-02-15 13:07:23.075738891  [2024-02-15 13:07:23] watchdog.cam_360_tapo          ERROR   : Ffmpeg process crashed unexpectedly for cam_360_tapo.
2024-02-15 13:07:23.080178723  [2024-02-15 13:07:23] watchdog.cam_360_tapo          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2024-02-15 13:07:23.080517799  [2024-02-15 13:07:23] ffmpeg.cam_360_tapo.detect     ERROR   : rtsp://127.0.0.1:8554/cam_360_tapo_sub: Invalid data found when processing input
2024-02-15 13:06:59.718151312  [INFO] Starting go2rtc...
2024-02-15 13:06:59.852165106  13:06:59.852 INF go2rtc version 1.8.4 linux/amd64
2024-02-15 13:06:59.852856733  13:06:59.852 INF [rtsp] listen addr=:8554
2024-02-15 13:06:59.853096095  13:06:59.853 INF [webrtc] listen addr=:8555
2024-02-15 13:06:59.853249948  13:06:59.852 INF [api] listen addr=:1984
2024-02-15 13:07:03.479961836  13:07:03.479 DBG [exec] run url="exec:ffmpeg -hide_banner -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_flags prefer_tcp -i rtsp://127.0.0.1:8554/cam_360_tapo_sub?video&audio -c copy -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output}"
2024-02-15 13:07:08.788680829  [rtsp @ 0x563399a8dd80] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
2024-02-15 13:07:08.788688500  Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2024-02-15 13:07:08.789282898  Input #0, rtsp, from 'rtsp://127.0.0.1:8554/cam_360_tapo_sub?video&audio':
2024-02-15 13:07:08.789288715    Metadata:
2024-02-15 13:07:08.789290551      title           : go2rtc/1.8.4
2024-02-15 13:07:08.789372921    Duration: N/A, bitrate: 64 kb/s
2024-02-15 13:07:08.789375515    Stream #0:0: Video: h264, none, 90k tbr, 90k tbn
2024-02-15 13:07:08.789377236    Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
2024-02-15 13:07:08.829835665  Output #0, rtsp, to 'rtsp://127.0.0.1:8554/94750d946da6cafb4e370b650d43a08d':
2024-02-15 13:07:08.829842082    Metadata:
2024-02-15 13:07:08.829843805      title           : go2rtc/1.8.4
2024-02-15 13:07:08.829940768      encoder         : Lavf59.27.10013:07:08.829 DBG [exec] run launch=5.349830453s
2024-02-15 13:07:08.829942847  
2024-02-15 13:07:08.829944659    Stream #0:0: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
2024-02-15 13:07:08.829946113  Stream mapping:
2024-02-15 13:07:08.829947583    Stream #0:1 -> #0:0 (copy)
2024-02-15 13:07:08.829949097  Press [q] to stop, [?] for help
2024-02-15 13:07:08.880347314  13:07:08.880 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:171 > error="read tcp 172.17.0.2:46556->192.168.50.213:554: i/o timeout" url=rtsp://synology:[email protected]:554/stream2
2024-02-15 13:07:09.153625702  [INFO] Starting go2rtc healthcheck service...
2024-02-15 13:07:09.776558066  av_interleaved_write_frame(): Broken pipe
2024-02-15 13:07:09.776646457  size=N/A time=00:00:00.06 bitrate=N/A speed=N/A    
size=N/A time=00:00:00.06 bitrate=N/A speed=0.0634x    
2024-02-15 13:07:09.776949585  video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
2024-02-15 13:07:09.776952584  Conversion failed!```

DChiuch avatar Feb 15 '24 02:02 DChiuch

here is my config for my C200 (Raspberry Pi 4)


go2rtc:
  streams:
    tapo_cam_c200: 
      - rtsp://username:[email protected]/stream1 # <- stream which supports video & aac audio. This is only supported for rtsp streams, http must use ffmpeg
      - "ffmpeg:tapo_cam#audio=opus" # <- copy of the stream which transcodes audio to opus
    tapo_cam_c200_sub:
      - rtsp://username:[email protected]/stream2 # <- stream which supports video & aac audio. This is only supported for rtsp streams, http must use ffmpeg
    

cameras:
  tapo_cam_c200:
    onvif:
      host: 192.168.1.165
      port: 2020
      user: username
      password: password
    ffmpeg:
      output_args:
        record: preset-record-generic
      inputs:
        - path: rtsp://127.0.0.1:8554/tapo_cam_c200 # <--- the name here must match the name of the camera in restream
          input_args: preset-rtsp-restream
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/tapo_cam_c200_sub # <--- the name here must match the name of the camera_sub in restream
          input_args: preset-rtsp-restream
          roles:
            - detect
    live:
      stream_name: tapo_cam_c200_sub
    record:
      enabled: True
      events:
        retain:
          default: 1
    objects:
      track:
        # - person
        - dog
    detect:
      stationary:
        interval: 50
        threshold: 50
    snapshots:
      enabled: True
      timestamp: False
      bounding_box: True
      retain:
        default: 1

Just a side note, you can't have two connections to the camera at the same time, so if you have VLC streaming rtsp://synology:[email protected]:554/stream1 then Frigate might be rejected when it tried to connect at the same time.

digiltd avatar Feb 15 '24 09:02 digiltd

my Tapo C320WS works well.

changtimwu avatar Feb 22 '24 05:02 changtimwu

I have three C200 and they're all falling out and refuse to reconnect without pulling the plug. I have 9 other Taco cameras around, which work perfectly (I had to return one C100). The C200 is not the easiest cam in my experience. Just letting you know :)

kongjudas avatar Mar 21 '24 09:03 kongjudas

The C200 is not the easiest cam in my experience. Just letting you know :)

but they are super cheap :)

digiltd avatar Mar 23 '24 22:03 digiltd

Remove :554 from your rtsp stream and it should work. I was having the same issue until I did this. So try

rtsp://synology:[email protected]/stream1

jonwitnoh avatar Apr 06 '24 20:04 jonwitnoh

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 May 07 '24 00:05 github-actions[bot]