[SOLVED] 2-way audio with Frigate & Tapo Cameras (C320ws)

Hello everyone,

I ve been searching around for a while to find a solution for this, and last night i finally got it after combining several github and community posts, so here is my final setup for anyone that’s interested

This config enables the mic and speaker icon in the frigate ui and when pressing it i have super snappy 2-way audio.
(the “…” in the code are indicative as i have other chunks between and should be omitted)

Frigate configuration:

...
go2rtc:
  streams:
    dn_lr_1_cam:  
      - ffmpeg:rtsp://rtspUN:rtsp:PW@cameraIP:554/stream1#audio=aac#video=copy
      - tapo://appPW@cameraIP
    dn_lr_1_cam_sub:
      - rtsp://rtspUN:rtsp:PW@cameraIP:554/stream2
...

Where rtspUN and rtspPW are the ones you set for extra control in the tapo app in the camera settings
and app PW is the tapo app password, tested with simple characters (no special chars). Ive read it also works if you provide the MD5 hash of your pw but have not tested it.

Nothing special in the code below (it’s pretty default), just pasting it for completeness:

...
cameras:
...
    dn_lr_1_cam:
    ui:
      order: 3 # to rearrange the cameras in my ui
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/dn_lr_1_cam # <--- the name here must match the name of the camera in restream
          input_args: preset-rtsp-restream
          roles:
            - record
            # - detect
        - path: rtsp://127.0.0.1:8554/dn_lr_1_cam_sub # <--- the name here must match the name of the camera_sub in restream
          input_args: preset-rtsp-restream
          roles:
            - detect
    live:
      stream_name: dn_lr_1_cam  #set to main or sub stream depending on the camera 
    motion:
      mask: 0,0.048,0.355,0.048,0.352,0,0,0
...

The following setup also allows me to talk from the HA ui, using the frigate card integration from HACS:

HA card config:

type: custom:frigate-card
cameras:
  - camera_entity: camera.dn_lr_1_cam
    go2rtc:
      modes:
        - webrtc
    live_provider: go2rtc
menu:
  buttons:
    microphone:
      enabled: true
    mute:
      enabled: true

The only issue I have now is that once I press the mic icon to enable the 2-way audio from the android app, it works ok, but i can’t mute the feed by pressing the mic icon again… but that’s fixed by closing the app or switching to another dashboard.
I wont bother about it now but if any1 has a solution to that, very welcome!

Hope it helps someone :slight_smile:

5 Likes

Thank you very much.
I have 4 cameras of that type and I am using it with frigate too.
I’ll try this, it will be great if will work.

Best regards,

Wow! Works with C120 Topa from Costco. Frigate is powerfull, but the doc and setup is counterintuitive. Thank you very much. Just like that, do you have any idea how to use GPU rather than CPU?

is it still working , i can’t seem to figure it out

streams:
camera_tapo:
- rtsp://user:[email protected]:554/stream1
- “ffmpeg:camera_tapo#audio=aac”
- tapo://[email protected]
the webrtc link ask for mic permission but nothing is being send.

firmware 1.3.1

latest everything

Try using the camera code as i have it in the OP.

go2rtc:
  streams:
    dn_lr_1_cam:  
      - ffmpeg:rtsp://rtspUN:rtsp:PW@cameraIP:554/stream1#audio=aac#video=copy
      - tapo://appPW@cameraIP
    dn_lr_1_cam_sub:
      - rtsp://rtspUN:rtsp:PW@cameraIP:554/stream2

(sub link is not required initially - it’s only used for frigate detection)

Also make sure you add

    live:
      stream_name: dn_lr_1_cam 

in the second part where you set the camera details, so the main stream is used in a frigate card

Hope I’m not hijacking, I have Tapo cameras C110 and TC60 but I can’t get the audio to work. Video works fine.

Here is the relevant config pieces:

go2rtc:
streams:
office:
- rtsp://user:[email protected]/stream1
- “ffmpeg:office#audio=aac”

cameras:
Office:
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/office
input_args: preset-rtsp-restream
roles:
- detect
- record
detect:
enabled: false

I don’t get the “speaker” icon in my browser like other camera models.

2-way audio works fine for my C220 but only if the mic device is not in the same wifi. I can only use my phone if it’s using mobile data not the same wifi. Is there a fix for that?

I have no idea but it sounds like some network issue and not tapo/frigate config.

What if you use your duckdns (external) url to access HA locally?

Is your local mic device connected via http? Many browsers only allow mic with https connection.

Thank you very much for these instructions.
What is the tapo app password? Is it the password associated to my tapo account ?

In each camera settings there’s a camera account option, where you set a username and password (different from your Tapo account)

Thank you krash, but actually my question was the other way around. I have created the username/pass per camera for the rtsp streams, but the code above also need a “tapo app password”. I think that s the password used by my tapo account, as things seem to work now like that, but just wanted to make sure

Ah yes, you are right, it refers to your apps pw

1 Like