Sending audio to the IP Camera backchannel
Note
This feature requires the Datastead RTSP/RTMP/HTTP/ONVIF Source filter version 9.2.4.4 or newer.
The filter includes a "Datastead Audio To Backchannel" sink filter that receives uncompressed PCM audio from a DirectShow graph and forwards it over the network to an IP camera or a network speaker.
The mode of operation is selected automatically from the URL scheme:
- rtsp://...: ONVIF audio backchannel (Hikvision, Dahua, Axis, and most ONVIF Profile T/Q cameras). The audio codec is auto-detected from the camera SDP.
- sip://...: SIP UAC mode (Axis network speakers and any SIP-capable device). The audio codec is fixed: PCMU (G.711 µ-law) at 8 kHz, mono.
E.g., ONVIF audio backchannel:
VideoGrabber.IPCameraURL := 'rtsp://user:password@192.168.1.40/Streaming/Channels/101>autoreconnect=1>volumelevel=-20000';
E.g., SIP UAC mode:
VideoGrabber.IPCameraURL := 'sip://26@192.168.1.26>transport=tls>autoreconnect=1>volumelevel=-20000';
To send audio to the IP camera backchannel, use the following sample code (here the source is a webcam microphone):
VideoGrabber.VideoSource := vs_VideoCaptureDevice;
VideoGrabber.AudioDevice := VideoGrabber.AudioDeviceIndex ('Microphone (Logi C615 HD WebCam)');
VideoGrabber.AudioRenderer := VideoGrabber.AudioRendererIndex ('Datastead Audio To Backchannel');
VideoGrabber.IPCameraURL := 'rtsp://user:password@192.168.1.40/Streaming/Channels/101';
VideoGrabber.AudioDeviceRendering := true;
VideoGrabber.StartAudioRendering();
SIP URL syntax
sip://[ID:password@]host[<sep>localip=x.x.x.x[<sep>port=5060][<sep>transport=tcp|udp|tls]]
The localip parameter is required: it is the LAN IP address of the PC that goes into the SDP offer sent to the camera. Without it, the camera does not know where to send the RTP stream back.
In SIP mode, the user part of the URL is the dial ID (the speaker extension), e.g. "26" for an Axis SIP speaker. If the camera also requires a separate Digest username, set it with SetAuthentication:
VideoGrabber.SetAuthentication (at_IPCamera, 'user', 'password');
Examples:
sip://26:secret@192.168.1.26?localip=192.168.1.10
sip://26:secret@192.168.1.26>localip=192.168.1.10>port=5060>transport=udp
sip://26@192.168.1.26!localip=192.168.1.10!transport=tls (then call SetAuthentication with at_IPCamera)
Note
Depending on the camera, the localip parameter may not be required.