2 Way Audio Frigate Hikvision AcuSence cam

cliver

Young grasshopper
Sep 24, 2021
32
5
UK
Can anyone point me in the right direction on getting 2 way audio running on Frigate with a Hikvision DS-2CD2386G2 camera please?
It's driving me nuts. I've read the Frigate docs and other resources but it refuse to work.
I get sound from the camera but not 2 it.
I'm doing everything in the Frigate web UI but plan on getting into Home Assistant eventually (I'm assuming going on step at a time is sensible?)
It's running in Docker on a Beelink AMD Ryzen7 5800H with a google usb TPU.

Below is my frigate config:

Cam01 is the camera in question.

With the "ffmpeg:Cam01#audio=aac" line in the go2rtc section I don't get the mic option in live view.
With it commented out I do get the mic option in live view but it doesn't work. In fact when selected it turns audio off both ways.

I have tried other options in place of aac.

Am I missing something obvious here?

Any help greatly appreciated.

YAML:
mqtt:
  enabled: true
  host: http://10.101.202.247:1883

ffmpeg:
  hwaccel_args: auto

detectors:
  coral:
    type: edgetpu
    device: usb

record:
  enabled: true
  retain:
    days: 3
    mode: all
  alerts:
    retain:
      days: 10
      mode: motion
  detections:
    retain:
      days: 10
      mode: motion

go2rtc:
  streams:
    Cam01:
      - rtsp:/admin:*******@10.101.***.***:554/streaming/channels/101
      - "ffmpeg:Cam01#audio=aac"

    Cam02:
      - rtsp:/admin:*******@10.101.***.***/stream0

    Cam03:
      - rtsp:/admin:*******@10.101.***.***/stream0

  webrtc:
    candidates:
      - 10.101.***.***:8555
      - stun:8555

cameras:
  Cam01:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp:/admin:*******@10.101.202.232:554/streamimg/channels/101
          roles:
            - record
        - path: rtsp:/admin:*******@10.101.202.232:554/streamimg/channels/103
          roles:
            - detect

    detect:
      enabled: true
      width: 640
      height: 480

    objects:
      track:
        - person
        - car
        - dog
        - cat

  Cam02:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp:/admin:*******@10.101.202.233/stream0
          roles:
            - record
        - path: rtsp:/admin:*******@10.101.202.233/stream1
          roles:
            - detect

    detect:
      enabled: true
      width: 640
      height: 480

    objects:
      track:
        - person
        - car
        - dog
        - cat

  Cam03:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp:/admin:*******@10.101.202.234/stream0
          roles:
            - record
        - path: rtsp:/admin:*******@10.101.202.234/stream1
          roles:
            - detect

    detect:
      enabled: true
      width: 640
      height: 480

    objects:
      track:
        - person
        - car
        - dog
        - cat



version: 0.16-0
camera_groups: {}
 
You need to ensure you're accessing frigate via https, either using your own reverse proxy or via port 8971 with tls enabled TLS | Frigate, this is a browser requirement for 2-way talk.

Hikvision cameras might not support rtsp backchannel audio, they also have their own api that allows two-way talk GitHub - AlexxIT/go2rtc: Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
This might just require adding an extra line - isapi:/admin:password@10.101..:80/. underneath Cam01.
Check your camera settings web interface to make sure isapi is enabled (it might be called api access or something similar).
You might also need to change the audio codec in the camera to pcma/pcmu (g.711alaw/g.711ulaw) to work with go2rtc two way talk.

To help with this you can forward the frigate container port 1984 to access the go2rtc config page, for the camera, click "probe" to get more debug information.
 
You need to ensure you're accessing frigate via https, either using your own reverse proxy or via port 8971 with tls enabled TLS | Frigate, this is a browser requirement for 2-way talk.

Hikvision cameras might not support rtsp backchannel audio, they also have their own api that allows two-way talk GitHub - AlexxIT/go2rtc: Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
This might just require adding an extra line - isapi:/admin:password@10.101..:80/. underneath Cam01.
Check your camera settings web interface to make sure isapi is enabled (it might be called api access or something similar).
You might also need to change the audio codec in the camera to pcma/pcmu (g.711alaw/g.711ulaw) to work with go2rtc two way talk.

To help with this you can forward the frigate container port 1984 to access the go2rtc config page, for the camera, click "probe" to get more debug information.
Thanks for the pointers. I have changed the camera audio to ulaw abs it seems to be working now.
The next problem I have is that I set it up in the office connected to one aimesh node. I've just moved it to another node where I intend to install it and frigate can't see it for some reason. But that's for another topic