AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
3.84k stars 314 forks source link

Sending audio to camera - connection not closed after sending #1132

Open drosien opened 1 month ago

drosien commented 1 month ago

Hello,

first of all thanks for the great application.

I am sending audio to a Tapo C320WS like in the example via POST request: ffmpeg:https://example.com/song.mp3#audio=pcma#input=file

Result: audio is playing fine on the camera.

Issue: A constant noise comes out of the camera speakers after playing. Furthermore the Tapo app itself can't access the camera speakers anymore, with an error, that the camera is occupied. Sending another audio via POST request is possible, but the noise is always there afterwards. Restart of the camera helps - but is there a better solution to fully close the connection after sending audio?

AlexxIT commented 1 month ago

Check stream info after playing

drosien commented 1 month ago

for producer "type": "Tapo active producer" the additional "senders": ["8 PCMA/8000, bytes=21696, receivers=1"]

is returned on stream info. Shouldn't this be removed automatically after sending?

The PATCH from the API just updates the stream source - so I don't see how to delete these senders with a request!?

AlexxIT commented 1 month ago

Are bytes changing when you refresh info?

drosien commented 1 month ago

The bytes in the senders array not, no. The bytes in the receivers array are increasing of course.

I found out now, that after ~20min the senders got removed - but would be great if there was an option to remove instantly after the 3 second audio file. It's not usable for me like this - I would need to disable.

"producers": [{ "url": "ffmpeg:rtsp://xxx@yyy/stream1#video=h264#hardware#audio=pcma" }, { "type": "Tapo active producer", "medias": ["video, recvonly, H264", "audio, recvonly, PCMA/8000", "audio, sendonly, PCMA/8000"], "receivers": ["255 H264, bytes=4542341, senders=1", "8 PCMA/8000, bytes=2320384, senders=1"], "senders": ["8 PCMA/8000, bytes=21696, receivers=1"], "recv": 7902992 }, {}, {}, {}, {} ],

AlexxIT commented 1 month ago

You keep showing little pieces of info. This makes it hard to analyze the problem

drosien commented 1 month ago

Sorry - I have no clue what information is missing.