Integration: Frigate - themactep/thingino-firmware GitHub Wiki

Integration Guide: Configuring Thingino Camera with Frigate and go2rtc

This guide explains how to set up the Thingino open-source camera firmware to work with Frigate and go2rtc.

Prerequisites

  1. Thingino Camera Firmware: Ensure the latest firmware is flashed.
  2. Frigate: Latest version installed and operational.
  3. go2rtc: Installed as part of the Frigate setup (or as a standalone service).
  4. Network access to your Thingino camera. (Replace IP addresses and credentials as necessary.)

You'll find two supported audio configurations below. Choose one that best fits your setup.

Available Configurations


OPUS / WebRTC Live View (Recommended)

This configuration provides the best experience for live view with WebRTC, especially for users with modern browsers who want advanced features like two-way audio.

Configure go2rtc

go2rtc:
  streams:
    cam1:
      - rtsp://thingino:thingino@[CAMERA_IP]/ch0#timeout=30
    cam1_sub:
      - rtsp://thingino:thingino@[CAMERA_IP]/ch1#timeout=30
  webrtc:
    candidates:
      - [GO2RTC_IP]:8555
      - stun:8555
  • cam1: Points to the primary RTSP stream (ch0) using OPUS (the Thingino default audio codec).
  • cam1_sub: Points to the substream (ch1).
  • timeout=30 helps prevent disconnections on slower networks.

Configure Frigate

cameras:
  cam1:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-aac
      inputs:
        - path: rtsp://127.0.0.1:8554/cam1?timeout=30
          input_args: preset-rtsp-restream-low-latency
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/cam1_sub?timeout=30
          input_args: preset-rtsp-restream-low-latency
          roles:
            - detect
            - audio
    onvif:
      host: [CAMERA_IP]
      port: 80
      user: thingino
      password: thingino
    live: 
      stream_name: cam1
  • Use preset-record-generic-audio-aac to transcode audio to AAC for recordings to work.
  • Assign appropriate roles for each stream: record, detect, and audio.
  • ONVIF config is optional but allows PTZ control

Test and Verify

  1. Restart the go2rtc and Frigate services.
  2. Open the Frigate Web UI and verify:
    • Both streams are displayed correctly.
    • Audio is functioning in the live view and recordings if desired.
  3. Use logs to check for errors like timeouts or audio codec mismatches.

If it is working, then Skip to Next Steps.


AAC / MSE Live View (Most Compatible)

This option provides the most compatible audio codec with all Live view technologies and browsers that support audio. Two-way audio works as well but activating the microphone deactivates the speaker temporarily.

Configure Thingino

Navigate to Thingino's WebUI:

  • Go to Settings > Streamer > Audio
  • Change the audio codec to AAC

You can verify the change using:

ffplay -rtsp_transport tcp rtsp://thingino:thingino@[CAMERA_IP]/ch0

Ensure that AAC is displayed in the stream metadata.

Configure go2rtc

go2rtc:
  streams:
    cam1:
      - rtsp://thingino:thingino@[CAMERA_IP]/ch0#timeout=30
    cam1_sub:
      - rtsp://thingino:thingino@[CAMERA_IP]/ch1#timeout=30
  • cam1: Points to the primary RTSP stream (ch0) using AAC audio codec from the previous step.
  • cam1_sub: Points to the substream (ch1).
  • timeout=30 helps prevent disconnections on slower networks.

Configure Frigate

cameras:
  cam1:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/cam1?timeout=30
          input_args: preset-rtsp-restream-low-latency
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/cam1_sub?timeout=30
          input_args: preset-rtsp-restream-low-latency
          roles:
            - detect
            - audio
    onvif:
      host: [CAMERA_IP]
      port: 80
      user: thingino
      password: thingino
  • Use preset-record-generic-audio-copy to copy audio without transcoding for recordings.
  • Assign appropriate roles for each stream: record, detect, and audio.
  • ONVIF config is optional but allows PTZ control

Test and Verify

  1. Restart the go2rtc and Frigate services.
  2. Open the Frigate Web UI and verify:
    • Both streams are displayed correctly.
    • Audio is functioning in the live view and recordings if desired.
  3. Use logs to check for errors like timeouts or audio codec mismatches.

If it is working, then Skip to Next Steps.


Next Steps

Enable Two-Way Audio

  • Go to Settings > Streamer > Audio
  • Ensure that Output Enabled is turned on.
  • Restart the camera.

You'll also need to make sure your Frigate is being served via HTTPS. The easiest way to do this is by following Frigate's TLS documentation.

Optimize Connectivity

  • Increase timeout values if you encounter connectivity issues.
  • Use wired Ethernet where possible.
  • Switch preset-rtsp-restream-low-latency to preset-rtsp-restream if low latency is unstable.

Integrate with Scrypted (Optional)

  • Use Scrypted to bridge Frigate feeds to HomeKit Secure Video (HKSV).
    • Register go2rtc streams in Scrypted using the RTSP Camera Plugin:
      • Main stream: rtsp://[GO2RTC_IP]:8554/cam1
      • Substream: rtsp://[GO2RTC_IP]:8554/cam1_sub
  • Optional: Configure MQTT switches in Scrypted to follow Frigate motion events.
  • Tune FPS and bitrate for HKSV compatibility:
    • Suggested: ch0 at 2000 kbps, ch1 at 500 kbps, both at 24 FPS.

Enable autotracking (for PTZ capable cameras)

If you are only following the instructions in the Frigate documentation, you'll get the following error: "ONVIF MoveStatus not supported". This is caused by an omission of the command to check the status in the ONVIF configuration file /etc/onvif.conf on your Thingino camera. To fix this, login with SSH and add is_moving=motors -b in the PTZ section of the file and restart the onvif process with /etc/init.d/S96onvif_discovery restart.

To complete the configuration, Frigate also needs a preset to have the camera return to its original position when it stops tracking. The command for this is: ptz_presets -a 0 preset_name <x> <y>. The x and y coordinates can be found by moving the camera to the intended position and executing the command motors -p. You can now use return_preset: preset_name in the Frigate configuration file.

For further reference:

⚠️ **GitHub.com Fallback** ⚠️