bropat / eufy-security-ws

Small server wrapper around eufy-security-client library to access it via a WebSocket.
MIT License
184 stars 29 forks source link

[Question]: Broadcast video/audio directly from socket or to mediamtx #271

Closed Subcode closed 2 months ago

Subcode commented 1 year ago

Ask your question

Hi, i want to use the library to receive a p2p stream, and present it as rtsp on a socket. I had a look at the eufy-security hass addon to see how they use simple_rtsp_server and i cant seem to reproduce their work.

Is there a way to read out the video/audio events and just present them straight from python onto a socket and open that with vlc or something? If not, is it possible to push the data to mediamtx or something similar so i can use vlc from there? I've tried using cv2.VideoWriter but i cant seem to get it to work. I'm not sure how to use the video / audio chunks that come from the events correctly.

lxrootard commented 1 year ago

+1 I'm interested by this answer as well to add P2P video streaming for the Jeedom plugin. @bropat could you please explain how this is supposed to work?

bropat commented 2 months ago

You can pass the data as a buffer to e.g. go2rtc as in this project:

https://github.com/bropat/ioBroker.eusec/blob/3fa381bf8ccb5eda3d13d201490ee4ee0207c1b0/src/lib/video.ts#L307-L351