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.93k stars 318 forks source link

go2rtc media player not working with Reolink camera #562

Open ebroder opened 11 months ago

ebroder commented 11 months ago

I have a Reolink Doorbell and am trying to setup a media player entity through go2rtc so that I can send messages from the TTS service.

Currently, if I open the "video+audio+microphone" stream, I'm able to trigger talkback to the camera. However, I haven't been able to get the media player entity to work.

I've uploaded my go2rtc.yaml, the stream info from when I'm successfully able to talkback using the browser, stream info from when TTS is unable to successfully talkback, the relevant snippet of my HA configuration.yaml, and the logs from the go2rtc service here: https://gist.github.com/ebroder/b6d6d7753e994d49b43c1d47689d6b06

I specifically noticed that, after the go2rtc client issues the PLAY request to the Reolink RTSP server, it gets back a 400 Bad Request, but I don't understand RTSP well enough to know why that's happening.

ebroder commented 10 months ago

Thanks for putting that patch together, and sorry for not noticing it sooner (I expected to get notified, so I hadn't been watching the issue 🤷🏻‍♂️).

I grabbed the go2rtc master build. I'm no longer seeing the 400 errors on the PLAY request, but I still don't hear any audio from the doorbell. Here's the latest log and stream info: https://gist.github.com/ebroder/127d991af2de927eba8c2ca7f5c44ddb

AlexxIT commented 10 months ago

Try to update firmware for your doorbell. Also check this issue https://github.com/AlexxIT/go2rtc/issues/331

ebroder commented 10 months ago

OK. Looks like I was wrong about it not working. It does work, but the audio clip I was sending was too short. The first second or so of audio seems to be clipped, and the doorbell only starts playing audio after that. The audio clip I was using was only about a second of TTS, so it just got completely clipped off.

Additionally, the audio cuts off before getting to the end of the message. So if, e.g., I have a 5 second audio clip, the doorbell only plays the middle 3 seconds or so.

In the logs, I see a TEARDOWN request from ffmpeg to the go2rtc rtsp server at the same time that the audio from the doorbell cuts off. The ffmpeg process exits more or less immediately after that.

AlexxIT commented 10 months ago

OK. This is another issue. Will check it with my camera

kevdliu commented 10 months ago

@ebroder Could you post your logs from getting some audio to play from the doorbell? I have the same configuration as yours but I can't get any audio file to play. It always fails with

av_interleaved_write_frame(): Broken pipe
[out#0/rtsp @ 0xffff9a01ee70] Error muxing a packet

so I want to compare your logs with mine.

ebroder commented 10 months ago

Yeah sure - you can see the logs here: https://gist.github.com/ebroder/3cc8e08dbadbd4645196c3ce88c8c10a

I'm just using the developer tools to call tts.speak with a long enough message that it doesn't get swallowed by the lost second at the beginning and the end.