ewilken / hap-rs

Rust implementation of the Apple HomeKit Accessory Protocol (HAP)
Apache License 2.0
196 stars 33 forks source link

IP Camera Support #47

Open ewilken opened 3 years ago

thinkier commented 2 years ago

I've played with splicing H.264 streams but Apple's specs demand RTP and SRTP. At a glance, it appears that there's a rust implementation of RTP. Unfortunately, SRTP doesn't appear to be a "wrap it in TLS" kind of protocol. So a pure-rust stack where the handler accepts an H.264 stream appears to be a dead end.

(Correction on the above, there is an SRTP library)

Thus far, I've piggybacked my camera-related makes on homebridge-camera-ffmpeg, and they solved this problem by offloading the SRTP server to ffmpeg. So this functionality must be feature-gated and it's likely that it will not be available on any environment that doesn't support a full OS stack (eg. an RPi Pico with a camera)

ewilken commented 2 years ago

Oh wow! Thanks a lot for the effort so far! 🙂 Using FFmpeg and feature-gating video-related functionality sounds like a very good start to me. As of right now, none of this crate is no_std compatible anyway.

soundprojects commented 2 years ago

https://github.com/brutella/hkcam

So I guess this is possible, also for RPI I'll look into if there may be some porting possible on this