sahilchaddha / homebridge-dafang

Homebridge Plugin for Xiaomi Dafang / Wyze Cam IP Camera => Hey Siri, Start Video Recording
MIT License
204 stars 34 forks source link

Audio delay/lag #8

Open sedony23 opened 5 years ago

sedony23 commented 5 years ago

I have the problem of significant audio delay. It probably is a general Dafang hacks issue, but I wanted to ask here, because I use it mainly with homebridge/homekit. Are there any suggestions for the optimal setup of video/audio parameters? Here is my current setup:

Video: h265, 1280x720, VBR, Bitrate 1024kbps, 25fps Audio: MP3, 16000 in and out, NS filter moderate, high pass filter on, AEC filter on

Homebridge is running on a raspberry pi 3 b+

I also get the delay in VLC though...

sahilchaddha commented 5 years ago

Hey @sedony23 , I have 7 connected Xiaomi Cameras to the plugin and i am using a mac mini for homebridge instead of Raspberry Pi (RPi isnt powerful enough for streaming high quality video). And i can reproduce your issue with 2 of my cameras with HomeKit as well as VLC. It seems to be an issue from RTSP stream or the audio driver of Xiaomi Camera.

https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/764

I am currently looking into audio protocol on the camera for Two-way audio, will look over audio lag as well. I am looking into approach inspired by :

https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/323 https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/pull/354

sedony23 commented 5 years ago

Great. Thanks for the info! Looking forward to two-way audio and a solution for the lagging audio issue!

netRunner0 commented 5 years ago

{ "platform":"Camera-ffmpeg", "cameras":[ { "name":"Camera 1", "videoConfig":{ "source":" -i rtsp://ip-address/unicast", "stillImageSource":"-rtsp_transport tcp -i rtsp://ip-address/unicast -vframes 1 -r 1", "maxStreams":5, "maxWidth":1280, "maxHeight":720, "maxFPS":25, "vcodec":"h264_omx" } } ] }