deepch / RTSPtoWeb

RTSP Stream to WebBrowser
MIT License
1.27k stars 302 forks source link

Audio working in demo site but not in endpoint #363

Open reaganch opened 1 year ago

reaganch commented 1 year ago

I've set my Hikvision camera to stream audio using G.711ulaw encoding.

When I view the WebRTC stream on localhost:8083, I can hear audio perfectly.

When I place the WebRTC endpoint on my website following the example in docs/examples/webrtc, however, it appears the audio track is absent, and I cannot unmute the video.

Could you please help me understand how the example in docs/examples/webrtc is different from what is implemented on localhost:8083, and if I can enable audio on the WebRTC endpoint?

Happy to provide any logs you need.

Thanks!

reaganch commented 1 year ago

Just conducted another test and I observe the same behaviour using G.711alaw encoding as well. Any advice would be much appreciated. As mentioned, would be happy to provide any logs you may need to assist with this. Please just let me know which logs you would need. Thanks!

reaganch commented 1 year ago

For what it's worth, have been tinkering around a bit, and I found that changing the word 'video' to 'audio' in the line 14 of the file docs/examples/webrtc/main.js, which currently reads webrtc.addTransceiver('video', { direction: 'sendrecv' }) gets audio working, but I lose my video. I feel like I'm close to the answer, but am stumped.

rj-indro commented 3 months ago

Has there been any updates on this? Having the same issue and tried what you did with webrtc.addTranceiver and had the same result, with audio now working but no video.

@deepch