owt-server
owt-server copied to clipboard
Issue with Open WebRTC live stream using Public IP
We are using Open WebRTC toolkit in our project to get the live stream of the IP camera and play it on our UI. The live stream is working fine when it is being run over the Private IP or as a localhost but when we tried to run it over Public IP it isn't working and we are not able to see the live stream over UI there.
Can someone please suggest some way to sort out this problem with Public IP context?
Could your Public IP be accessed in your deployment environment?
I can access my application over HTTP session using any browser (Chrome, Firefox, Edge etc.) without any problem via Public IP. Only the Live Camera Streaming feature (enabled by Open WebRTC toolkit) is not working over Public IP. Please note the very same Live Camera Streaming feature (enabled by Open WebRTC toolkit) is working without any flaw over Private IP. The deployment environment can be accessed over SSH as well.
Since you could run it via localhost. I think camera streaming could be enabled if you can access that public IP under your deployment environment.
I can access my deployment environment over Public IP using both of HTTP and SSH session. Yet Live camera streaming feature is not working over Public IP (with localhost/Private IP live camera streaming works in perfect manner). Can you guide us how to enable live camera streaming over Public IP.
I mean from your deployment, can you access the public IP. For example, you could open an SSH session to the deployment environment, and check the connectivity to public IP by typing "ping" command (or other tools) in the SSH terminal.
Hi @starwarfan ,
Sorry for delayed response.
We tried running our application in AWS environment and we have enabled all the ports in security rules. We are able to ping our elastic ip from inside the vm also.
But still when we try to start live streaming from our personal laptop using this elastic ip, it does not work. But when we try running the same using private ip of vm or localhost from browser of this server, it works fine.
Can you please help us on how to debug this issue.
Regards,
@tarun28jain Maybe I misunderstood your problem before. Is the IP you mentioned IP camera's or server's? If your IP camera's IP is A, the server's IP is B, you failed to access the A through REST API or failed to access B in browser?
If you failed to access server's public IP in browser, you need edit webrtc_agent/agent.toml to add configuration for public IP.
Hi,
We have updated webrtc_agent/agent.toml file as below
[webrtc] #The network inferface all peer-connections will be established through. All network interfaces in the system will be adopted if this item is not specified or specified with an empty array. ##Valid value is an array of objects that has two properties: name and replaced_ip_address. name is the name of network interface that will be used, replaced_ip_address is the IP address used for replacing the internal IP address in locally generated SDP's and ICE candidates during establishing the peer-connection(useful when behind NATs). replaced_ip_address is optional, if it is not specified, IP address from corresponding network interface will not be replaced. #Example of valid value: [{name = "eth1"}, {name = "eth2", replaced_ip_address = "192.0.2.2"}]. #network_interfaces =[{ name="eth1", replaced_ip_address="<aws private ip>"}] network_interfaces =[{ name="eth1", replaced_ip_address="<aws private ip>"},{ name="eth2", replaced_ip_address="<aws public ip>"}]
We have updated our docker image with changed file contents.
We commented network_interfaces which was already there with private ip only and added line with both private and public ip.
But now after running the application, live streaming is not working on both public or private ip.
Kindly let us know if changes are done correctly or not.
Regards,
Hi,
The replaced_ip_address should be your <aws public ip>. Besides, the portal.toml also need changes.
You could refer to the section 2.4 of wiki (https://github.com/open-webrtc-toolkit/owt-server/wiki/How-to-deploy-OWT-server-which-can-be-connected-from-both-internal-and-external-networks#24-deployment-on-device-b)
Hi,
If your IP camera's IP is A, the server's IP is B, you failed to access the A through REST API or failed to access B in browser?
From my browser, i am able to access B i.e. ip of my server where my UI is working.
From my UI, i am not able to access camera stream.
Scenario:
Actually, we have an application based on "https://github.com/OpenVisualCloud/Smart-City-Sample"
It have made some simulated cameras and accessing it using RTSP url.
But public ip access is not working for this application also and based on our understanding, it is using webrtc toolkit for accessing live streams, token creation etc.
We would be replacing these simulated cameras with real one once our code is stable.
Any pointers on debugging this can be helpful.
The replaced_ip_address should be your <aws public ip>. Besides, the portal.toml also need changes.
You could refer to the section 2.4 of wiki (https://github.com/open-webrtc-toolkit/owt-server/wiki/How-to-deploy-OWT-server-which-can-be-connected-from-both-internal-and-external-networks#24-deployment-on-device-b)
Will check and confirm if its running using the link shared.
Thanks,