-
Notifications
You must be signed in to change notification settings - Fork 344
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
Unable to use Hikvision ISAPI 2 Way Audio #903
Comments
Here are the logs when setting go2rtc's RTSP log to trace: HikvisionLogs
Am I doing something wrong? Why do I not see any backchannel audio negotiation? |
Maybe |
Good catch, unfortunately it doesn't fix anything for the cameras in question. I can confirm it works with the one 2 way audio camera that I have. |
Are there any other logs I could enable which would be more relevant? Would a trace of the |
I've just started trying to get mine setup. To test whether the camera can receive/play audio you can do the following:
curl --digest "http://$USER:$PASS@192.168.1.100/ISAPI/System/TwoWayAudio/channels" You will receive some XML similar to this:
I have not yet successfully be able to get my microphone audio to exit the camera speaker. My goal is to get the HASS Frigate Lovelace Card two-way audio going. The magic webrtc page on the go2rtc dashboard asks for permission to access my microphone, and on my iphone I get my own voice back thorugh the speaker, but no matter what device or interface I use nothing comes out of the actual camera-end yet. Please post back if you get that working with your Hikvision. |
Has anyone figured this out? I am trying to get ISAPI commands to work with Hikvision for two-way audio. The response implies it has worked but no audio is heard.
|
To start, make sure your audio file compression matches what your camera is set to. In your example it is set to AAC. My example is based on ulaw, which is needed to work with iphone/ipad. You can see at the beginning where I do the conversion using ffmpeg. |
like how do i start on doing this? sorry im new to all this stuff so can you pls elaborate? So to start where would i create a ulaw file? "Make an 8k ulaw audio file:" is it a call service on home assistant? or do i have to install a program on my computer? |
If the answer I provided above does not make immediate sense to you, it may be that you are out of your depth. Anyhow... Step 1: Get a bash shell open on a linux system and have installed/understand the commands "ffmpeg" and "curl" Step 2: Follow the steps I already listed... |
ok after some research i manage to step 2-4 using home assistant SSH addon and here is sample if the screenshot. what i don't understand is step #1 which is make a 8k ulaw audio file.. and where to put the converted file.. what i did is convert a mp3 to ulaw using some online website converter.. after the conversion my mp3 file became a wav file not ulaw and i don't understand why. Also where would i put this command in step #1? "ffmpeg -i duck.wav -ac 1 -ar 8000 -f mulaw duck.ulaw" i know i don't know much of this but im willing to learn.. thanks for guiding.. |
ok i manage to convert my audio to ulaw using ffmpeg.. but after trying to send the audio to my camera i got this error..
Maybe i have not declare where my file directory is?? I'm confuse how will the command know where my converted ulaw audio is. By the way i paste the ding_dong.ulaw in my home assistant config directory /upload/ folder |
It sounds like ding_dong.ulaw isn't in the directory you are running curl from. Try giving it the full path to the file. If your configuration is similar to mine, the correct command should be: |
Don't forget you need to make sure the connection is closed and then have to "open" the connection before sending the file:
|
I do have the same issue, no sound from the camera at all after sending 8hz ulaw. |
Are your cameras configured to use ulaw? |
Yes they are. But in fact I am having it working when I send the ISAPI:// url directly to the camera instead of the nvr to the 65001 port which the nvr forwards. |
OP here. I decided to give this another look due to the new attention this thread has received. I'm still unable to get this to work. Here's some logs at a pretty in-depth level from go2rtc: HikvisionLogs
Here we have the camera config in go2rtc's config file:
I've of course got the camera itself set to AAC for audio, though I don't see any options for audio inputs I might add. It doesn't work in my browser for 2 way audio (my ultimate goal here), and it doesn't work with a local .aac audio file. That's what the logs are showing above. Any ideas? Thanks. |
Do you use an nvr or camera direct ? |
Actually i use a DVR connected to my home network.. microphone is connected to dvr.. camera is connected to dvr and speaker is connected to dvr too. I can do two way talk using frigate built on go2rtc.. but i cannot make send audio file to camera to work.. I made a automation than when someone press the doorbell button.. camera would popup on my wall tablet.. this works fine. What i want to add is a chime or a pre recorded audio to play on the speaker everytime the doorbell is press.. so the person waiting outside will knew it went thru.. hope you get the idea.. |
Try to set isapi url directly to camera instead of nvr. If you use camera virtual host you can set url to port 65001 for camera 1 etc. |
If you were asking me, I don't use hardware NVR. As per the config above, you can see I am connecting to the camera directly. I'm not getting any luck. |
Its an analog camera with BNC connector.. there's no setting on the camera itself.. all settings is made thru the DVR. All the camera does is send video feed to the DVR. |
Hi all...I don't have the bandwidth to breakdown anyone's config or do any step-by-step diagnostics, but here are some tips that got me up and running:
Example config that works with go2rtc v1.9.1 using Frigate HASS Card and Hikvision DS-2CD2386G2-ISU/SL, with the Frigate HASS card using "Front_Door-Intercom":
|
WebRTC doesn't require g.711u. It typically uses Opus for audio, and even supports a handful of other codecs too. You can specify an ffmpeg audio codec change within go2rtc for whatever desired codec you wish to use on the user facing front. The camera might require something specific for 2 way audio support, but that is entirely independent of WebRTC. Same setup with MSE as I understand it, but with different codec support. Either way, the codec I'm using doesn't seem to change whether my cameras work or not. A packet inspection isn't going to change much either, since via the HTTP PUT uploads, the camera is clearly receiving the packets and providing an "ok" response. I know I won't be buying any more of these cameras in the future where I need 2 way audio support. They're pieces of junk, software/firmware wise. I'll probably look back to Dahua, and see if they have a large sensor product like their 5442's but now with ONVIF 2 way audio support. |
I just screwed around with it some more, and if I set my codecs in use on my camera to ulaw (I tried this before, but not in combination with the following steps), then set my go2rtc config as follows:
Then if I start the 2 way audio stream via go2rtc's interface, and THEN I send an HTTP PUT to close and then open the audio, go2rtc's 2 way audio will work. I then rebooted my cameras, and they seem to work again? It's so weird that the PUT commands would return a status of "ok" when they clearly weren't in a state to receive audio. Yet another broken aspect of these cameras. I guess they were stuck in a closed state, somehow? It seems to work now after rebooting the cameras again. Firmware versions 5.7.3 and 5.7.13. Edit: specifying |
I'm wondering if it's a camera configuration issue on my end, somehow. However, it is present with TWO identical cameras, model: DS-2CD2387G2-LSU/SL
I had it working some months ago on this camera and it broke after some configuration change between either my camera and go2rtc. Tested on Go2rtc versions 1.6.2 and 1.8.5 (latest)
go2rtc.yaml:
I have a different (not Hikvision / ISAPI) camera where 2 way audio works fine over ONVIF Profile T via go2rtc. I can't figure out what I'm doing wrong or where to start troubleshooting this. Sending it audio clips via something like
ffmeg:https://samplelib.com/lib/preview/mp3/sample-3s.mp3#audio=pcma#input=file
also doesn't work (though, I can't seem to get this to work on the working 2 way audio camera either).There are no logs that I can find anywhere in relation to this problem. What can I do to troubleshoot this? I'd really like to have this working. Thanks.
The text was updated successfully, but these errors were encountered: