marce147
Posts: 8
Joined: Tue Dec 22, 2015 9:00 pm

video stream in real time

Sat May 16, 2020 7:20 pm

With my raspberry at "http://192.168.1.222:4747" I am able to view (with Chromium) a video stream in real time.
The video stream comes from a smartphone (connected via wifi) with a particular app for Android (DroidCam).
I don't know how to make a page in HTML code that produces the same effect.

Code: Select all

<Html>
<Body>
?????????
</ Body>
</ Html>
Can anyone help me?

deepo
Posts: 579
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: video stream in real time

Sat May 16, 2020 7:37 pm

marce147 wrote:
Sat May 16, 2020 7:20 pm
With my raspberry at "http://192.168.1.222:4747" I am able to view (with Chromium) a video stream in real time.
The video stream comes from a smartphone (connected via wifi) with a particular app for Android (DroidCam).
I don't know how to make a page in HTML code that produces the same effect.

Code: Select all

<Html>
<Body>
?????????
</ Body>
</ Html>
Can anyone help me?
A little more information please. A simple port number is not enough.
What sort of stream comes out of the 4747 port? What feeds that stream?

And </ Html> is not valid html. It should be:

Code: Select all

<!DOCTYPE html>
<html>
<body>
</body>
</html>
/Mogens

marce147
Posts: 8
Joined: Tue Dec 22, 2015 9:00 pm

Re: video stream in real time

Sun May 17, 2020 6:42 pm

After further tests and after having documented myself again, I am able to provide more information; the previous ones are replaced by these.
I have a web microsite that resides on a Raspberry connected in the local ethernet network to a modem / router.
The site is visible all over the world (!) As its DNS relies on the ddns.net service.
The URL of the site is therefore http://NomeSito.ddns.net

The code on the index.html page has (summarize):

Code: Select all

FIRST LINE <BR>
<a href="http://192.168.1.2:51042"> LIVE VIDEO </a> <BR>
THIRD LINE <BR>
Using the Raspberry in the local network, both with the Chromium and Epiphany browsers, they are able to view the home page of the micro site.
By clicking on the above link I can see the live video produced by an app that resides on a smartphone, also connected to the local network via wifi. This smartphone does not have a SIM, however it is not necessary.
The same thing happens with a PC, connected via ethernet to the same local network.

Through the internet (with another smartphone) I see the page like this:
FIRST LINE
LIVE VIDEO
THIRD LINE
By clicking on the "LIVE VIDEO" link, however, I can't see the video.

I specify that I opened (I believe) the 51042 port on the Raspberry.
Despite numerous tests I was unable to watch the video with the second smartphone (through the internet).
Where am I wrong? In the HTML code, in some port to open (perhaps in the modem / router) or what else?
Thanks for the attention

deepo
Posts: 579
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: video stream in real time

Sun May 17, 2020 8:41 pm

You are unable to see the video in browsers that are not placed on the same net as the Raspberry Pi and the camera (or whatever is at http://192.168.1.2:51042).
By placing a link (the a href thing) on a page you effective ask any browser that views the page to visit http://192.168.1.2:51042 but that's not available anywhere outside your home network.

/Mogens

marce147
Posts: 8
Joined: Tue Dec 22, 2015 9:00 pm

Re: video stream in real time

Mon May 18, 2020 5:02 pm

Thanks for the informations.
So is it impossible, in any other way, to view this video stream outside the local network ?
I would like to point out that vice versa the index.htlm page can be viewed outside the local network.
What alternative solution would you suggest ?

deepo
Posts: 579
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: video stream in real time

Mon May 18, 2020 8:06 pm

marce147 wrote:
Mon May 18, 2020 5:02 pm
Thanks for the informations.
So is it impossible, in any other way, to view this video stream outside the local network ?
I would like to point out that vice versa the index.htlm page can be viewed outside the local network.
What alternative solution would you suggest ?
The index.html page is viewable outside your network because you configured it so.
So what did you do to make that happen?
You need to make more of that configuration for the server that serves the video.

/Mogens

deepo
Posts: 579
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: video stream in real time

Mon May 18, 2020 8:13 pm

My guess is that you have added a port forward configuration in your router, so that http port 80 is routed to your Raspberry Pi.
You have also setup dynamic dns, so that requests to http://nomesito.ddns.net/ goes to the IP address of your router.
And the port forward allows http requests to be served by your Raspberry Pi.

For this to work you'll need to add a port forward up for the port number for the video stream.
And you need to edit the IP address in index.html to be your external IP address.
So any request for the video stream goes to the correct server.

/Mogens

Return to “Beginners”