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
4.87k stars 394 forks source link

Getting tapo cameras working for two-way audio, help please #956

Closed borgqueenx closed 4 months ago

borgqueenx commented 8 months ago

I bought tapo cameras specifically to mess around with later for two-way audio, but i am not so sure all their camera's support two-way audio now. I have found on their online forum that (at least some) camera's only support onvif profile s, instead of profile T, that is needed for two-way audio. I have go2rtc by default in frigate, and have set it up to just use the rtsp streams from the camera account you can make in the tapo app, and use for onvif as well. i can use the preset positions and move the camera with frigate. i just cant seem to get two-way audio working. It is the tapo C225 camera that i bought.

However if it is not working or supported through rtsp/onvif, is it perhaps working when using the tapo protocol, and how do i set that up? I have seen it around that people use tapo://xxxxxxxx instead of rtsp://xxxxxxxxx

with a tab with the microphone open, i have the following info:

{
   "producers": [
     {
       "type": "RTSP active producer",
       "url": "rtsp://192.168.1.185:554/stream1/",
       "remote_addr": "192.168.1.185:554",
       "user_agent": "go2rtc/1.8.4",
       "sdp": "v=0\r\no=- 14665860 31787219 1 IN IP4 192.168.1.185\r\ns=Session streamed by \"TP-LINK RTSP Server\"\r\nt=0 0\r\nm=video 0 RTP/AVP 96\r\nc=IN IP4 0.0.0.0\r\nb=AS:4096\r\na=range:npt=0-\r\na=control:track1\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1; profile-level-id=640032; sprop-parameter-sets=Z2QAMqzGoAoALWhAAAADAEAAAAyh,aOqPLA==\r\nm=audio 0 RTP/AVP 8\r\na=rtpmap:8 PCMA/8000\r\na=control:track2\r\n",
       "medias": [
         "video, recvonly, H.264 High 5.0",
         "audio, recvonly, PCMA/8000"
       ],
       "receivers": [
         "96 H264, bytes=134060786, senders=3",
         "8 PCMA/8000, bytes=8053760, senders=4"
       ],
       "recv": 143464378
     },
     {
       "type": "RTSP passive producer",
       "url": "rtsp://127.0.0.1:8554/592797f94ce330ce7a6e792d27cd623b",
       "remote_addr": "127.0.0.1:60782",
       "user_agent": "ffmpeg/go2rtc",
       "sdp": "v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=go2rtc/1.8.4\r\nc=IN IP4 127.0.0.1\r\nt=0 0\r\na=tool:libavformat LIBAVFORMAT_VERSION\r\nm=audio 0 RTP/AVP 96\r\nb=AS:48\r\na=rtpmap:96 MPEG4-GENERIC/8000/1\r\na=fmtp:96 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3; config=158856E500\r\na=control:streamid=0\r\n",
       "medias": [
         "audio, recvonly, MPEG4-GENERIC/8000"
       ],
       "receivers": [
         "96 MPEG4-GENERIC/8000, bytes=2890102, senders=1"
       ],
       "recv": 2926350
     }
   ],
   "consumers": [
     {
       "type": "RTSP passive consumer",
       "url": "rtsp://127.0.0.1:8554/living-room?audio",
       "remote_addr": "127.0.0.1:60732",
       "user_agent": "go2rtc/ffmpeg",
       "sdp": "v=0\r\no=- 1 1 IN IP4 0.0.0.0\r\ns=go2rtc/1.8.4\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\nm=audio 0 RTP/AVP 96\r\na=rtpmap:96 PCMA/8000\r\na=control:trackID=0\r\n",
       "medias": [
         "audio, sendonly, ANY"
       ],
       "senders": [
         "96 PCMA/8000, bytes=8053760, receivers=1"
       ],
       "send": 8179600
     },
     {
       "type": "RTSP passive consumer",
       "url": "rtsp://192.168.1.184:8554/living-room?audio",
       "remote_addr": "172.30.32.1:59534",
       "user_agent": "FFmpeg Frigate/0.13.2-6476f8a",
       "sdp": "v=0\r\no=- 1 1 IN IP4 0.0.0.0\r\ns=go2rtc/1.8.4\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\nm=audio 0 RTP/AVP 96\r\na=rtpmap:96 PCMA/8000\r\na=control:trackID=0\r\n",
       "medias": [
         "audio, sendonly, ANY"
       ],
       "senders": [
         "96 PCMA/8000, bytes=8053760, receivers=1"
       ],
       "send": 8179600
     },
     {
       "type": "RTSP passive consumer",
       "url": "rtsp://192.168.1.184:8554/living-room",
       "remote_addr": "172.30.32.1:59462",
       "user_agent": "FFmpeg Frigate/0.13.2-6476f8a",
       "sdp": "v=0\r\no=- 1 1 IN IP4 0.0.0.0\r\ns=go2rtc/1.8.4\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\nm=video 0 RTP/AVP 96\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1; profile-level-id=640032; sprop-parameter-sets=Z2QAMqzGoAoALWhAAAADAEAAAAyh,aOqPLA==\r\na=control:trackID=0\r\nm=audio 0 RTP/AVP 97\r\na=rtpmap:97 MPEG4-GENERIC/8000\r\na=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3; config=158856E500\r\na=control:trackID=1\r\n",
       "medias": [
         "video, sendonly, H264, H265",
         "audio, sendonly, MPEG4-GENERIC"
       ],
       "senders": [
         "96 H264, bytes=134060786, receivers=1",
         "97 MPEG4-GENERIC/8000, bytes=2890102, receivers=1"
       ],
       "send": 138405382
     },
     {
       "type": "WebRTC/WebSocket async passive consumer",
       "remote_addr": "tcp4 prflx 192.168.1.213:11742 related :0",
       "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36",
       "medias": [
         "video, sendonly, VP8, RTX, VP9, H264, AV1, RED, ULPFEC, FLEXFEC-03",
         "audio, sendonly, OPUS/48000/2, RED/48000/2, G722/8000, PCMU/8000, PCMA/8000, CN/8000, TELEPHONE-EVENT/48000, TELEPHONE-EVENT/8000, L16, PCML",
         "audio, recvonly, OPUS/48000/2, RED/48000/2, G722/8000, PCMU/8000, PCMA/8000, CN/8000, TELEPHONE-EVENT/48000, TELEPHONE-EVENT/8000"
       ],
       "receivers": [
         "111 OPUS/48000/2, bytes=38821, senders=0"
       ],
       "senders": [
         "102 H264, bytes=1975988, receivers=1",
         "8 PCMA/8000, bytes=95232, receivers=1"

Appriciate any assistance :)

borgqueenx commented 8 months ago

Edit: This can be closed. I had to use the tapo protocol in the main frigate config settings (the part about go2rtc) Here is a example for people who faced the same issue:

living-room:
- rtsp://tapocameraaccount:tapocamerapassword@192.168.1.185/stream1
- tapo://Tapoapploginaccountpassword@192.168.1.185
- ffmpeg:living-room#audio=aac

The above aac is needed for frigate to record audio.

AlexxIT commented 8 months ago

Try to use only tapo:// source to check if your settings good. Maybe you has problem with cloud password. Or go2rtc version / camera firmware. Also you need to open tapo stream from mobile app once.

AlexxIT commented 4 months ago

Please let me know if the problem is relevant