Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support L16 audio codec for backchannel #696

Open
felipecrs opened this issue Oct 15, 2023 · 21 comments · May be fixed by #702
Open

Support L16 audio codec for backchannel #696

felipecrs opened this issue Oct 15, 2023 · 21 comments · May be fixed by #702
Labels
dahua Dahua cameras, VTO, SIP enhancement New feature or request

Comments

@felipecrs
Copy link
Contributor

Apparently some Dahua doorbells uses this codec by default for SIP communication, and changing it (somehow) breaks SIP communication.

Originally reported by @oNaiPs here.

According to @AlexxIT (here), it would be possible to support L16 for backchannel in go2rtc itself.

This separate issue is open for specific discussions about supporting L16 in backchannel in go2rtc, and upvoting. @AlexxIT, please don't change your priorities just because I opened this issue. And thanks as always.

@AlexxIT AlexxIT added the enhancement New feature or request label Oct 15, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Oct 15, 2023

It's better just to use full RTSP link to Dahua cameras. That support many codecs for backchannel.

@felipecrs
Copy link
Contributor Author

But according to the screenshot here #49 (comment), he is using the full URL (you can see at the top).

@oNaiPs are you in the latest firmware?

@oNaiPs
Copy link

oNaiPs commented Oct 15, 2023

But according to the screenshot here #49 (comment), he is using the full URL (you can see at the top).

I am using the URL rtsp://admin:pass@ip_addr/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif

@oNaiPs are you in the latest firmware?
yes "2021-05-14 V4.500.115A000.0.R"

@felipecrs
Copy link
Contributor Author

felipecrs commented Oct 15, 2023

What is your camera/doorbell model?

@oNaiPs
Copy link

oNaiPs commented Oct 15, 2023

@felipecrs I have VTO2211G. According to this I should have a newer FW update, trying to update now.

@felipecrs
Copy link
Contributor Author

felipecrs commented Oct 16, 2023

I usually check updates from the official Dahua website. But apparently they are pointing to the same version anyway (220523).

https://www.dahuasecurity.com/en/products/All-Products/Video-Intercoms/IP-Series/Villa-Door-Station/Pro-Series/VTO2211G-WP

@oNaiPs
Copy link

oNaiPs commented Oct 16, 2023

@felipecrs I am now on "2022-05-23 V4.511.0000000.0.R" updated the VTO with the ConfigTool (only works on Windows), firmware from here.
EDIT: this link has the same version as the link you sent above.

@felipecrs
Copy link
Contributor Author

Right. But what about the backchannel codec? How does the "sendonly" track looks like now? Mine looks like this:

"audio, sendonly, MPEG4-GENERIC/16000, MPEG4-GENERIC/8000, PCMU/16000, PCMU/8000, PCMA/16000, PCMA/8000, L16/8000, L16/16000"

@oNaiPs
Copy link

oNaiPs commented Oct 16, 2023

@felipecrs I think that might be the webrtc leg. You want to look at what the RTSP camera is providing. Can you check the lots from go2rtc?
That would be clicking on "info":
image

And you can see:
image

@felipecrs
Copy link
Contributor Author

felipecrs commented Oct 16, 2023

Ok, that's weird. Maybe one alternative solution for you would be:

@AlexxIT, if that one gets implemented someday we can then probably just close this one. It is unlikely that someone else will ever need L16 audio in backchannel if they can use CGI instead.

@oNaiPs
Copy link

oNaiPs commented Oct 17, 2023

@AlexxIT if you can provide me with the sample code and some points on where to place the code for this task, I can attempt to implement it (go developer here, I already setup go2rtc dev environment)

@AlexxIT
Copy link
Owner

AlexxIT commented Oct 17, 2023

Check ISAPI source. I think it's most similar

@markphillips100
Copy link

I've been following this and related threads and experience similar issues with a VTO2201 so thought I'd pass on the info.

My setup is using frigate docker with go2rtc v1.7.1 installed into it, and I've been experimenting without a VTH setup. I'm just trying to get the mic working via webrtc so I can use from Home Assistant at this stage. FYI I have mkcert (self-signed) SSL setup so chrome asks permission for mic usage.

I'm 100% certain my setup works (desktop mic received audio is output on VTO) so long as the VTO codec is G.711A with frequency 8000. The VTO defaults to PCM/16000 after every power recycle as confirmed by cgi getConfig action.

I've been setting the required parameters using the echo script approach but I get inconsistent rtsp setup (via go2rtc info links). Sometimes the sender is there, sometimes not. If I check current config via cgi the settings are correct. Not sure if it's the VTO unable to initialize before go2rtc restreams or not. I do not know enough about how that works.

Putting the inconsistent setup aside, I thought I'd check what happens if the VTH is in the mix. I setup the VTO for the G711/8000 and confirm set with getConfig. I then make a SIP call from VTO to VTH and the VTO has reset itself back to its default PCM/16000. So it seems I've no way of getting away from L16 (PCM).

@oNaiPs oNaiPs linked a pull request Oct 18, 2023 that will close this issue
@ikhudo
Copy link

ikhudo commented Nov 18, 2023

Hi @oNaiPs have you managed to get 2-way audio on your VTO2211G?

@Chris0793
Copy link

Is there anyone here who can use two way audio via go2rtc with their intercom? I have tried but the delay is too high. Is there a solution? I am currently using a SIP server, but I would like to get rid of it.

@felipecrs
Copy link
Contributor Author

Is there anyone here who can use two way audio via go2rtc with their intercom? I have tried but the delay is too high. Is there a solution? I am currently using a SIP server, but I would like to get rid of it.

If it's a Dahua doorbell, I believe your best option will be #52.

@Chris0793
Copy link

I'm sorry, I can't see how I have to configure it so that it works via cgi. Can you explain how I have to configure it?

@felipecrs
Copy link
Contributor Author

lol, sorry. I meant that when that gets implemented, it should be the best option.

@Chris0793
Copy link

Well then, I hope it will be implemented soon 😉.

@TheSleepySlee
Copy link

@felipecrs I think I played too much with DAHUA VTO CGI commands, and now my VTHs don't play the video feed when VTO button is pressed. I can see the video feed manually on the VTHs and also from RTSP.

I tried factory resey, without success. Any clue?

@felipecrs
Copy link
Contributor Author

felipecrs commented May 14, 2024

Factory reset should resolve all issues like these. Maybe factory reset both the VTO and VTH?

I don't use VTH though. I only use VTO with my own SIP server.

@AlexxIT AlexxIT added the dahua Dahua cameras, VTO, SIP label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dahua Dahua cameras, VTO, SIP enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants