|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (10 bit)
Join Date: Aug 2005
Location: Vancouver, BC, Canada
Posts: 976
|
Multiple MJPEG streams in browser
I'm running a server with Linux Motion and 4 cameras. Each camera is broadcasting on a separate port.
If I open firefox and direct it to http://myserver ort1 then I see one stream. If I direct it to myserver ort2 I see the second stream.Obviously FF has no problem displaying a MJPEG stream. How do I create a web page that displays all 4 streams in a single page? Thanks.
__________________
If you remind me of my dog... we'll probably get along. |
|
|
|
|
|
#2 |
|
Barefoot on the Moon!
Staff
Premium Member
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
|
Look at the HTML code and see what's happening. Beyond that, I couldn't tell you without looking at it.
__________________
There are two secrets to staying young, being happy, and achieving success. You have to laugh and find humor every day, and you have to have a dream.
|
|
|
|
|
|
#3 |
|
Member (10 bit)
Join Date: Aug 2005
Location: Vancouver, BC, Canada
Posts: 976
|
Found a solution:
HTML Code:
<body> <img src="http://192.168.0.114:8081?refresh=0.0" width="640" height="480"> <img src="http://192.168.0.114:8082?refresh=0.0" width="640" height="480"> <img src="http://192.168.0.114:8083?refresh=0.0" width="640" height="480"> <img src="http://192.168.0.114:8084?refresh=0.0" width="640" height="480"> </body> |
|
|
|
|
|
#4 |
|
Member (4 bit)
Join Date: Apr 2008
Location: Naperville, IL
Posts: 11
|
Another possible solution would have been to use iframes in the HTML.
|
|
|
|
|
|
#5 |
|
Barefoot on the Moon!
Staff
Premium Member
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
|
|
|
|
|
|
|
#6 |
|
Member (4 bit)
Join Date: Apr 2008
Location: Naperville, IL
Posts: 11
|
It depends on what you are trying to do. In this case it looks like he knows the actual sizes of the feeds, so could just set the size of the iframe to fit. We have a browser application that automatically resizes the iframe when its content changes. This is certainly not the best solution for everything (or most things), but sometimes it is appropriate.
|
|
|
|
|
|
#7 |
|
Member (10 bit)
Join Date: Aug 2005
Location: Vancouver, BC, Canada
Posts: 976
|
Now I'd like to access the stream from work.
When I open the webpage from work I see placeholders (broken image link) for the image streams. When I view the image properties/location I see 192.168.114:8081 (and 8082, 8083 and so on) which is fine when I open the webpage from within my network but obviously doesn't work from outside. How do I get it to work? Thanks. |
|
|
|
|
|
#8 |
|
Forum Administrator
Staff
Premium Member
Join Date: May 2000
Location: Joplin MO
Posts: 37,790
|
Those ports have to be forwarded in your router to the local IP address, and you have to connect using your real IP address.
|
|
|
|
|
|
#9 |
|
Member (10 bit)
Join Date: Aug 2005
Location: Vancouver, BC, Canada
Posts: 976
|
I am using my real ip and forwarding to the correct location. The web page (the basic html code that I listed in a previous post) loads but the streams do not.
The webpage that loads is supposed to load all the streams to a single page (for easy viewing). It looks like this: refreshing image from server:8081 | refreshing image from server:8082 refreshing image from server:8083 | refreshing image from server:8084 How do I make it so the image loads from the server ort location and not sends the viewing browser to search for an image at its own 192.168.0.114:8081 which obviously doesn't contain my stream?
|
|
|
|
|
|
#10 |
|
Member (4 bit)
Join Date: Apr 2008
Location: Naperville, IL
Posts: 11
|
As glc stated above, you need to use a real Internet IP address in your web page. You cannot use a locally assigned IP address that is not available outside of the local server network.
After rereading your last post, you cannot use the internal IP address within the HTML. You need to use the real address there as well. If your HTML code is not using the 192.168 addresses as in your sample code, then you have some other connectivity issue. I would check your web server access logs to see if the URL requests are coming through for those streams. Last edited by Shadowjack; 10-18-2011 at 01:40 PM. Reason: Clarification |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|