Stream Video to one user and receive audio from the user

4.2k Views Asked by At

My requirement: I want to stream to a person (Larix?) With my smartphone and get the audio from that person. The latency should be as low as possible and the quality as high as possible. I want to host the whole thing on my server.

What is the best method? I've tried SRS, the quality is high and the latency is low, but I don't know how to get the audio from the other person.

Would SRT also be an option?

What is best suited to make that happen?

2

There are 2 best solutions below

0
On

Given the latency requirements it sounds like a real time focused solution leveraging RTSP, Web RTC or similar would be a good approach.

Using something like this as close to standard as possible with video only in one direction and audio only in the other direction (or both if you need it) seems like it might be the easiest approach.

I think you may find this much easier and quicker than starting from scratch yourself, especially to get the best quality within a given latency budget as this is a core consideration of WebRTC.

There are existing Web RTC Android and iOS clients which you can build on - more are available all the time so worth searching but some examples:

2
On

Once published live stream to SRS, over RTMP by OBS, FFmpeg or other encoder, you could play the stream on other devices.

Generally there are serval players, on both H5 or mobile:

  • HLS, about 5~10s latency, easy to play, you only need a H5 video tag, or hls.js.
  • HTTP-FLV, about 1~3s latency, also very easy, please use flv.js player.
  • WebRTC WHIP/WHEP, about 0.5~1s latency, it's realtime, but be careful, especially on your mobile browser.

Note that all H5 native js player works perfect with MSE except iOS Safari browser. For iOS Safari, it's possible to play the HTTP-FLV by WASM also, or use WebRTC WHEP, please read link for details.

WebCodecs and WebTransport can also be used to play live streams, but they are not yet stable and supported on all devices. Please refer to this post and WebCodecs API for more details.

On mobile(iOS/Android) native platform, it's OK to use ijkplayer which use FFmpeg, and there is some wraps like fijkplayer for flutter.