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

In videoroom v2 example, with 3 users, only 2 videos displayed per device. #32

Closed
alsiPanda opened this issue Apr 23, 2021 · 39 comments
Closed

Comments

@alsiPanda
Copy link

@shivanshtalwar0 I was trying out the videoroom v2 example, and kept facing the following problem:

  1. when using 3 virtual phones on my pc, each device only shows 2 videos, one from localrenderer, and another from one of the two other devices. Sometimes one of the device is only showing the local video.
  2. when using 2 virtual device, and 1 physical device, one of the virtual device shows all 3 streams, but the other virtual device and physical device only show localrenderer.

The only change to the example code I have made is the Janus url, which points to my gcp server, which hosts janus, and the username while registering so all three devices have different usernames.

My understanding of Janus and webrtc isn't really that deep, so do I need change or add something else in the example code ?

@shivanshtalwar0
Copy link
Collaborator

In my experience this seems like ice connection failed issue it can happen due to variety of reasons
Make sure stun server used in janus configuration is working you can make sure it is working by trying trickle test
Ice server url on client side that is janus client side should be same not necessarily but in my experience it works fine if it is same as stun server used in janus configuration
Let me know if that helps

@alsiPanda
Copy link
Author

alsiPanda commented Apr 23, 2021

@shivanshtalwar0 I tried using Google stun servers, one as well as multiple, but that resulted in only localrenderer showing up.
I am currently checking the Janus configuration, but it should be one of Google's stun servers.

PS: after uncommenting voip.eutelia in Janus config, I am getting the following output : device 1 only shows localrenderer, device 2 and 3 show only device 1 feed in remoterenderer.

@shivanshtalwar0
Copy link
Collaborator

Are you using docker for janus?

@alsiPanda
Copy link
Author

Yes, the atyenoria repo

@shivanshtalwar0
Copy link
Collaborator

shivanshtalwar0 commented Apr 23, 2021 via email

@alsiPanda
Copy link
Author

alsiPanda commented Apr 23, 2021

@shivanshtalwar0 installed the janus from your profile. Do I need to do anything else ? like configuring my nginx for janus. My previous janus setup was accessed on http://<server_ip>:8088/janus for rest, but currently I am unable to connect to that port.

@shivanshtalwar0
Copy link
Collaborator

shivanshtalwar0 commented Apr 23, 2021 via email

@alsiPanda alsiPanda reopened this Apr 23, 2021
@alsiPanda
Copy link
Author

alsiPanda commented Apr 24, 2021

docker-compose up -d didnt work out, at first it gave some version error , so i removed the version from docker-compose.yaml, then it showed error related to janus-multistreaming. I was able to install using docker build and docker run. But cant seem to figure to how to reverse proxy to the new janus, as in which port to proxy_pass, etc. If possible, can you share the code for reverse proxy from your nginx.conf ?

PS: my test server doesnt have any domain name, I use IP and port to directly access it. I hope that isnt an issue

@shivanshtalwar0
Copy link
Collaborator

shivanshtalwar0 commented Apr 24, 2021 via email

@alsiPanda
Copy link
Author

alsiPanda commented Apr 24, 2021

I ran this : docker run -itd -p 8088:8088 -p 8188:8188 --name myjanus <docker image built and tagged by you> , setup done. In nginx , I tried a reverse proxy for 8088, just to check, and it gives an error. So janus should be using the 8088 port already. In the app, rest = RestJanusTransport(url: 'http://<server_ip>:8088/rest'); - when I use this, or use https instead, I get the following error: Unhandled Exception: Connection to given url can't be established reason:-Janus Server not live or incorrect url/path specified

@shivanshtalwar0
Copy link
Collaborator

shivanshtalwar0 commented Apr 24, 2021 via email

@alsiPanda
Copy link
Author

alsiPanda commented Apr 24, 2021

I have added the following to my nginx file -

`map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

upstream websocket {
server 127.0.0.1:8081;
}
upstream rest {
server 127.0.0.1:8088;
}

server {
listen 80;
listen [::]:80;
location /websocket {
proxy_pass http://websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
}
location /rest/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://rest/janus/;
}
}`

After that when I use the following url for RestJanusTransport - http://<server_ip>/rest, I am still getting the Incorrect url/path error

@shivanshtalwar0
Copy link
Collaborator

shivanshtalwar0 commented Apr 24, 2021 via email

@alsiPanda
Copy link
Author

alsiPanda commented Apr 24, 2021

@shivanshtalwar0 , sorry but coming to Skype won't be possible for me, if need be I can send the code for my entire Nginx conf, as well as the slightly edited code for videoroom v2 example, would that be helpful ?

Any other screenshots as well if you require, I can send it.

@shivanshtalwar0
Copy link
Collaborator

shivanshtalwar0 commented Apr 24, 2021 via email

@alsiPanda
Copy link
Author

curl 127.0.0.1:8088/janus/info - this worked on the server side.
http://<server_ip>:8088/janus/info this worked in browser. So I am assuming reverse-proxy worked ?
In app, I used http://<server_ip>:8088/janus in the RestJanusTransport, after which I am able to see localrenderer but not the remoterenderers.

@shivanshtalwar0
Copy link
Collaborator

shivanshtalwar0 commented Apr 24, 2021 via email

@shivanshtalwar0
Copy link
Collaborator

shivanshtalwar0 commented Apr 24, 2021 via email

@alsiPanda
Copy link
Author

http://<server_ip>/rest/info is working in the browser. But http://<server_ip>/rest gives incorrect url error. I tried adding port numbers - 80, 8088 to above ip, but it didn't work. I also tried ws://<server_ip>/websocket in WebsocketJanusTransport but I got - connection was not upgraded to websocket.

PS: going to try out https next.

@alsiPanda
Copy link
Author

alsiPanda commented Apr 24, 2021

@shivanshtalwar0 , any other possible reason that remoterenderer not showing ? https will require getting a domain name and all. Summarizing, So far setup is working and reverse proxy is also working, as tested using /info in the browser and server. Using http://<server_ip>:8088/janus directly in the RestJanusTransport works. But remoterenderers not showing up. Once in a while, one of the devices shows a remoterenderer but it is completely black box instead of the video stream.

Could it have anything to do with ip address of all the device being same or the server bandwidth being low.

@shivanshtalwar0
Copy link
Collaborator

Well honestly I haven't tested it on http and i am preety sure it has got something to do with janus server or http connection
I will try it on http when i get time until then if possible you could try on https by getting tech domain and other cool stuff by applying for GitHub education if you got id card of an institute ;)

@alsiPanda
Copy link
Author

Got a domain name and the https running. But the videoroom is still showing only localrenderer. I will try a few other things later, maybe try running the new V2 example code as is and continue from there.

@shivanshtalwar0
Copy link
Collaborator

shivanshtalwar0 commented Apr 26, 2021 via email

@alsiPanda
Copy link
Author

So I tried with the examples folder directly and only replaced displayed name and the urls. In JanusClient I used rest instead of ws. In Videoroom I can see only localrenderer.

@shivanshtalwar0
Copy link
Collaborator

shivanshtalwar0 commented Apr 27, 2021 via email

@alsiPanda
Copy link
Author

I downloaded the janus_client V2 version instead of master from GitHub. The page I ran is videoroom and videoroomV2.

@shivanshtalwar0
Copy link
Collaborator

shivanshtalwar0 commented Apr 27, 2021 via email

@alsiPanda
Copy link
Author

alsiPanda commented Apr 27, 2021

In VideoRoom_V2.dart (Not useing ws because getting an error related websocket)
rest = RestJanusTransport(url: 'https://mywebsite.xyz/rest/'); ws = WebSocketJanusTransport( url: 'wss://mywebsite.xyz/websocket'); j = JanusClient(transport: rest, iceServers: [ RTCIceServer( url: "stun:stun.voip.eutelia.it:3478", username: "", credential: "") ]);

In conf.dart
var servers = [ 'wss://kosmosnetworkapps.xyz/websocket', 'wss://janus.conf.meetecho.com/ws', 'https://kosmosnetworkapps.xyz/rest/', 'wss://janus.conf.meetecho.com/ws', 'wss://kosmosnetworkapps.xyz/websocket', 'https://kosmosnetworkapps.xyz/rest/' ];

Map<String, String> servermap = { 'janus_ws':'wss://janus.conf.meetecho.com/ws', 'onemandev_master_ws': 'wss://kosmosnetworkapps.xyz/websocket', 'onemandev_master_rest': 'https://kosmosnetworkapps.xyz/rest/', 'onemandev_unified_rest': 'https://kosmosnetworkapps.xyz/rest/', 'onemandec_unified_ws': 'wss://kosmosnetworkapps.xyz/websocket' };

@shivanshtalwar0
Copy link
Collaborator

shivanshtalwar0 commented Apr 27, 2021 via email

@alsiPanda
Copy link
Author

Tried the meetecho url everywhere, as you suggested, the example code is working perfectly. I assume that means, the problem is with the Janus server setup. Or maybe, the Nginx configuration for the Janus docker.

@shivanshtalwar0
Copy link
Collaborator

shivanshtalwar0 commented Apr 30, 2021 via email

@alsiPanda
Copy link
Author

alsiPanda commented Apr 30, 2021

@shivanshtalwar0 , I did a thorough recheck and finally managed to get things working using Janus installed on my server.
My modified version - same as original issue, one device shows all 3 , other two devices show only 2 /3.
Example with my server url - the first device shows nothing, other two device show only 2/3, self and the first one.

This is the result for videoroom v2.

@shivanshtalwar0
Copy link
Collaborator

So that's great! You can close this issue then if everything worked for you

@alsiPanda
Copy link
Author

I think, I may have written it the wrong way. But basically I am back to where this issue started. The videoroom is not showing all the users videos. One of the device is showing all 3, and the other 2 are only showing 2. So I am finally getting the same results using the the same Janus docker installation as yours , as I was getting earlier with the atyenoria repo.

@shivanshtalwar0
Copy link
Collaborator

shivanshtalwar0 commented May 1, 2021 via email

@alsiPanda
Copy link
Author

@shivanshtalwar0 Thanks for looking into it. The problem only appears in 2+ devices. Will wait for your reply before trying anything else.

@alsiPanda
Copy link
Author

@shivanshtalwar0 , Anyway I can help, maybe test in a specific way, or try some changes out, I would be happy to help.

@shivanshtalwar0
Copy link
Collaborator

Definitely i will let you know once i have done some changes you can test 😊

@shivanshtalwar0
Copy link
Collaborator

@alsiPanda I think this issue is there because lorenzo merged multistream in master branch for janusgateway and videoroom example needs to accommodate those changes you can still make existing example work by setting up janusgateway version prior to multistream support

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

2 participants