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

Adding Audio sending capability from web page to Rpi server #425

Open
erwan2345 opened this issue Jun 22, 2021 · 6 comments
Open

Adding Audio sending capability from web page to Rpi server #425

erwan2345 opened this issue Jun 22, 2021 · 6 comments

Comments

@erwan2345
Copy link

Hello,
First, I wanted to congratulate you for the job about V4L2 (loopback, copy etc..) and also with this webrtc-streamer.

My webrtc-streamer environment:
I could make it working, from a chrome page (either from a windows laptop or an iphone in SSL) I could open a video stream coming from my RPi and getting sound from it (thks to a USB microphone).

I could use directly the raspicam in H264 and also, using the v4l2copy utility, a virtual device (I have 2 virtual device so that I can use the raspicam video in several applications at the same time).

My target is to make a video doorbell able to:

  • permanently send a RTSP H264 + Audio stream to my NAS (ok: thks to 4l2copy and v4l2rtspserver)
  • on demand: provide a webrtc communication to mobile phone web page (IOS & android), audio 2 way, video from RPi to webpage from outside local network.

My request:
Webrtc-streamer allow 1-way communication sending video+audio from RPI to any webpage.

Would it be possible to add a reverse communication (audio only is sufficient for my use) using webrtc from webpage to rpi audio jack out ? I'm not a big specialist, but please advise me in which area the code should be updated ?

Thks

@mpromonet
Copy link
Owner

mpromonet commented Jun 22, 2021

Hi,

WebRTC is 2-way connection, you can look to https://github.com/mpromonet/webrtc-streamer-html/blob/master/sendstream.html that was a try to send a stream from web browser to webrtc-streamer. The stream is notified in PeerConnectionObserver ::OnAddStream. The video sink is just printing frames size https://github.com/mpromonet/webrtc-streamer/blob/master/inc/PeerConnectionManager.h#L45, and audio sink is ignored, but you can send it to a audio device if you like.

Best Regards,
Michel.

@erwan2345
Copy link
Author

erwan2345 commented Jun 22, 2021 via email

@mpromonet
Copy link
Owner

Hi Erwan,

It needs to update the server side code to get the AudioSink and implement it.

Best Regards,
Michel.

@erwan2345
Copy link
Author

erwan2345 commented Jun 23, 2021 via email

@mpromonet
Copy link
Owner

Hi Erwan,

Don't be afraid, this is a really small project, the tricky part is probably to manage multiple session, and choose how to output the audio (using WebRTC SDK or not). If you are starting coding in C++, it may be a good opportunity to dive a learn a bit more.

Best Regards,
Michel.

@AleXoundOS
Copy link

@erwan2345, have you succeded?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants