Stream Videos Through HomeKit

Last Updated on : 2024-06-25 03:43:18download

TuyaOS have adapted to the HomeKit Platform Abstraction Layer (PAL). Therefore, if your device has adequate resources, you can achieve rapid and seamless integration with HomeKit and Tuya simply on top of TuyaOS-compatible hardware platforms.

IP cameras (IPCs) and video doorbells differ from other HomeKit devices primarily in terms of live video and audio services. These services are implemented over the standard protocols including Secure Real-time Transport Protocol (SRTP) and H.264. These protocols are distinct and independent from HomeKit. HomeKit certification has strict requirements for the specifications of audio and videos.

Integrate with HomeKit

Overview

Apple HomeKit Accessory Development Kit (ADK) is a software development kit provided by Apple and it is supplied with a collection of APIs and tools. HomeKit ADK is used to develop HomeKit-compatible smart home devices. Thus, users can use Apple’s Home app or Siri to control devices.

HomeKit ADK involves the following terms and definitions:

  • HomeKit Accessory Protocol (HAP): a protocol that enables communication with the HomeKit platform.
  • Platform Abstraction Layer (PAL): the abstraction layer of the ADK platform. Integration with the PAL enables access to the hardware platform. In most cases, you must adapt to the PAL before the integration with HomeKit ADK.

Generic integration

In most cases, to integrate with HomeKit, perform the following steps:

  1. Register as s HomeKit developer: Go to the Apple Developer website, register as a HomeKit developer, and then get the required developer certificates and access permissions.
  2. Develop a HomeKit-compatible device: Use Apple HomeKit ADK to adapt to the PAL. Then, develop a smart device in line with HomeKit speciations and make the device communicate with HomeKit as normal.
  3. Pass the HomeKit certification test: Follow the instructions in the document HomeKit Certification Test Cases, and use Apple’s test kits including HomeKit Certification Assistant (HCA), HomeKit Accessory Tester (HAT), and Bonjour Conformance Test (BCT) to test the device. Make sure the device meets the HomeKit specifications and Apple’s quality requirements.
  4. Submit a request for certification: After the test is passed, submit a request for certification to Apple and provide the required device information and test result.
  5. Finish the certification: After the request passes the review, Apple replies to you with the required certification file and identifier, so you can add the device to the HomeKit platform.

Integrate with HomeKit based on TuyaOS

Integration method

You can submit a ticket to request support for integration with HomeKit.

Advantages

Stream Videos Through HomeKit

Architecture of Tuya-based HomeKit platform

Stream Videos Through HomeKit

Adapt TuyaOS to ADK

Stream Videos Through HomeKit

How it works to stream audio and videos through HomeKit

To integrate with the HomeKit-compatible IPCs, the key step is to implement the modules cameraInput, microphone, and speaker at the PAL. TuyaOS IPC SDK has adapted to the audio and video API of the ADK dependency, you do not need to adapt it additionally.

  • Dependency on audio and video architecture

    Stream Videos Through HomeKit
  • Internal data flow of audio and videos

    Stream Videos Through HomeKit
  • Implementation of data pipelines

    Stream Videos Through HomeKit

Requirements for devices

Video

  • Codec: H.264 Main Profile at Level 4
  • Support at least two simultaneous streams: one stream with a resolution of at least 1,920x1,080@24fps, and the other stream with a resolution of at least 1,280x720@24fps (or 1,600x1,200@24fps[4:3] + 1,280x960@24fps[4:3]).
  • The following resolutions must be supported: 640x360, 480x270, and 320x240.
  • The mainstream must support a bit rate of up to 2 Mbit/s.
  • Support dynamic adjustments to video streams in terms of resolution and bit rate.

Audio

  • Codec: AAC-ELD and Opus, working at a variable bit rate.
  • Sampling rate: 16,000 or 24,000 samples per second.
  • The Real-time Transport Protocol (RTP) timestamp clock rate must be equal to the sampling rate.

Image capture

  • Support JPEG-encoded images.
  • Support dynamic adjustments to the resolution.
  • Cover videos with resolutions for all sizes.

Others

  • RAM: 1,178.3 KB or more.
    Flash: 135.8 KB or more.
  • One red LED and one blue LED.
  • Mains-powered devices support a buffer of at least four seconds for mainstream video recording.