How can I play an RTSP live stream of my Tapo camera over the Internet?
Hello,
I am developing a software. I would like to play an RTSP live stream of my Tapo camera over the Internet but cannot figure out how.
Reading this page (https://www.tp-link.com/us/support/faq/2680/), I was able to play an RTSP live stream on computers within a local area network (LAN), where the camera is located.
In C++ along with OpenCV, for example, I wrote something like:
cv::VideoCapture cap("rtsp://username:password@IP_address_of_the_camera:554/stream1");
Now, I tried to do the same with a computer outside the LAN. The above code, of course, did not work because it does not tell the global/external IP address of the router for the LAN.
As I searched relevant information, it seems like I need the following info:
1) Local IP address of Tapo camera (which I can see on the official Tapo app)
2) Internal IP address of the router (which I have)
3) External IP address of the router (which I have)
4) Port number (which probably is 554)
Using the above four, I probably need to do 'port forwarding' on the router.
Now, my first question is: Should the C++ code still be like this?
cv::VideoCapture cap("rtsp://username:password@IP_address_of_the_camera:554/stream1");
Or do I need to write the code differently (like http://...)?
My second question is about port forwarding. I am using a Ubuntu/Linux computer as a Wi-Fi router (i.e., activated a 'hotspot' function). Thus, I cannot log in to a web page for the router in order to port forwarding unlike typical routers. This, however, does not seem to be necessary because the official Tapo app appears to do it automatically when configuring a camera (perhaps, using UPnP). So how can I do something like that?
Thanks