473,785 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ipcam to stream?

I have an airlink101 ipcam. It "streams" jpeg images to a web browser.

Basically, the camera sends a never-ending http page, and continually
retransmits a jpeg image.

This sort of works, but eventually the browser tries to save the file.
It's also impossible to embed in a page.

What I really want is to grab that stream at the web server level using
something like php, and create a stream similar to a webcam so that I
can show embedded live video on the page.

I have never done anything like this, though, and my google searches
have not revealed anything useful - mostly how-tos on creating
proprietary streams using desktop tools.

I need something that can automagically create a stream that a browser
can understand.

I've tried mplayer/mencoder and motion, but neither will produce a
stream....

The web server is running linux (debian etch), apache2, and php5.

I would appreciate any pointers or guidance.

Thanks,

--Yan

Mar 26 '07 #1
4 2939
CptDondo wrote:
I have an airlink101 ipcam. It "streams" jpeg images to a web browser.

Basically, the camera sends a never-ending http page, and continually
retransmits a jpeg image.
Hi,

Really? A never ending http page that refreshes the image all the time?
Do they use some meta-refresh header for that?

They would be better off using JavaScript, and simply replace the image all
the time (better performance).

But I think you can just look at the URL of the image, and my bet is that
that same image changes all the time. Right?

If so: what you need in PHP to get the stream of images is simply
rerequesting the same image all the time and store them on HD or something.

So you need something simple as:

*************** **************
// Look up the path in the sourcecode of you page that displays the jpg
$imageSourcePat h = "http://localhost/path/to/your/cam/image.jpg";
$saveDir = "/home/Yan/webcam/";
$nrOfPicsToCapt ure = 1000;

for ($counter=0;$co unter<$nrOfPics ToCapture;$coun ter++){
// make sure nobody caches
$theImg = $imageSourcePat h."?rand="+micr otime();
// get new picture
$content = file_get_conten ts($theImg);
// safe it in a file
$fileName = $saveDir."image ".$counter.".jp g";
file_put_conten ts($fileName,$c ontent);
}
*************** **************
(not tested of course)

How you make a movie out of the seperate jpg files, I don't know, but I am
sure some software out there can help you with that (try sourceforge eg).

Hope that helps.

Regards,
Erwin Moller

>
This sort of works, but eventually the browser tries to save the file.
It's also impossible to embed in a page.

What I really want is to grab that stream at the web server level using
something like php, and create a stream similar to a webcam so that I
can show embedded live video on the page.

I have never done anything like this, though, and my google searches
have not revealed anything useful - mostly how-tos on creating
proprietary streams using desktop tools.

I need something that can automagically create a stream that a browser
can understand.

I've tried mplayer/mencoder and motion, but neither will produce a
stream....

The web server is running linux (debian etch), apache2, and php5.

I would appreciate any pointers or guidance.

Thanks,

--Yan
Mar 27 '07 #2
Erwin Moller wrote:
CptDondo wrote:
>I have an airlink101 ipcam. It "streams" jpeg images to a web browser.

Basically, the camera sends a never-ending http page, and continually
retransmits a jpeg image.

Hi,

Really? A never ending http page that refreshes the image all the time?
Do they use some meta-refresh header for that?

They would be better off using JavaScript, and simply replace the image all
the time (better performance).

But I think you can just look at the URL of the image, and my bet is that
that same image changes all the time. Right?

If so: what you need in PHP to get the stream of images is simply
rerequesting the same image all the time and store them on HD or something.

So you need something simple as:

*************** **************
// Look up the path in the sourcecode of you page that displays the jpg
$imageSourcePat h = "http://localhost/path/to/your/cam/image.jpg";
$saveDir = "/home/Yan/webcam/";
$nrOfPicsToCapt ure = 1000;

for ($counter=0;$co unter<$nrOfPics ToCapture;$coun ter++){
// make sure nobody caches
$theImg = $imageSourcePat h."?rand="+micr otime();
// get new picture
$content = file_get_conten ts($theImg);
// safe it in a file
$fileName = $saveDir."image ".$counter.".jp g";
file_put_conten ts($fileName,$c ontent);
}
*************** **************
(not tested of course)

How you make a movie out of the seperate jpg files, I don't know, but I am
sure some software out there can help you with that (try sourceforge eg).

Hope that helps.

Regards,
Erwin Moller
That was my first cut.... But it takes about 1-2 seconds to refresh,
and the camera frame rate is 10 fps. Here's the description of the
process the camera uses (from
<http://msdn.microsoft. com/coding4fun/hardware/video/article.aspx?ar ticleid=912407>
):

MotionJPEG over HTTP uses the Content-Type header
"multipart/x-mixed-replace" along with a configurable boundary. This
means that the stream is made up of Multiple Parts (hence multipart) and
each new frame should replace the previous frame (hence
x-mixed-replace). This particular camera sends an HTTP Header like this:

Content-Type: multipart/x-mixed-replace;boundar y=--video boundary--

So.. I'm kind of stuck on how to deal with that. I want to take that
stream and display it an an embedded object.

--Yan
Mar 27 '07 #3
CptDondo wrote:
Erwin Moller wrote:
>CptDondo wrote:
>>I have an airlink101 ipcam. It "streams" jpeg images to a web browser.

Basically, the camera sends a never-ending http page, and continually
retransmits a jpeg image.

Hi,

Really? A never ending http page that refreshes the image all the time?
Do they use some meta-refresh header for that?

They would be better off using JavaScript, and simply replace the image
all the time (better performance).

But I think you can just look at the URL of the image, and my bet is that
that same image changes all the time. Right?

If so: what you need in PHP to get the stream of images is simply
rerequesting the same image all the time and store them on HD or
something.

So you need something simple as:

************** ***************
// Look up the path in the sourcecode of you page that displays the jpg
$imageSourcePa th = "http://localhost/path/to/your/cam/image.jpg";
$saveDir = "/home/Yan/webcam/";
$nrOfPicsToCap ture = 1000;

for ($counter=0;$co unter<$nrOfPics ToCapture;$coun ter++){
// make sure nobody caches
$theImg = $imageSourcePat h."?rand="+micr otime();
// get new picture
$content = file_get_conten ts($theImg);
// safe it in a file
$fileName = $saveDir."image ".$counter.".jp g";
file_put_conten ts($fileName,$c ontent);
}
************** ***************
(not tested of course)

How you make a movie out of the seperate jpg files, I don't know, but I
am sure some software out there can help you with that (try sourceforge
eg).

Hope that helps.

Regards,
Erwin Moller

That was my first cut.... But it takes about 1-2 seconds to refresh,
and the camera frame rate is 10 fps. Here's the description of the
process the camera uses (from
<http://msdn.microsoft. com/coding4fun/hardware/video/article.aspx?ar ticleid=912407>
):

MotionJPEG over HTTP uses the Content-Type header
"multipart/x-mixed-replace" along with a configurable boundary. This
means that the stream is made up of Multiple Parts (hence multipart) and
each new frame should replace the previous frame (hence
x-mixed-replace). This particular camera sends an HTTP Header like this:

Content-Type: multipart/x-mixed-replace;boundar y=--video boundary--

So.. I'm kind of stuck on how to deal with that. I want to take that
stream and display it an an embedded object.
Yes, I see.
Sorry, I have no clue how to proceed either. I never did that before. :-/
Maybe dig into RFC that describe this type of stream?
Good luck

Regards,
Erwin
>
--Yan
Mar 28 '07 #4
CptDondo wrote:
I have an airlink101 ipcam. It "streams" jpeg images to a web browser.

Basically, the camera sends a never-ending http page, and continually
retransmits a jpeg image.

This sort of works, but eventually the browser tries to save the file.
It's also impossible to embed in a page.

What I really want is to grab that stream at the web server level using
something like php, and create a stream similar to a webcam so that I
can show embedded live video on the page.

I have never done anything like this, though, and my google searches
have not revealed anything useful - mostly how-tos on creating
proprietary streams using desktop tools.

I need something that can automagically create a stream that a browser
can understand.

I've tried mplayer/mencoder and motion, but neither will produce a
stream....

The web server is running linux (debian etch), apache2, and php5.

I would appreciate any pointers or guidance.

Thanks,

--Yan
Yan,

I've never tried it either, but I've seen it done. It normally requires
more than just dumping the jpeg repeatedly to the browser. HTTP is a
request/response protocol - it's not really designed to have one request
go on for long periods of time.

You could take a look at http://195.196.35.90/view/view.shtml. He's
doing the same thing I think you want to do, using some javascript. It
might give you some ideas.

Unfortunately I don't have the webmaster's email - I bookmarked this a
couple of years ago as a neat site and have since lost contact with him.

You could also try asking over on alt.www.webmasters - some of them
might have some ideas.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 28 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
26805
by: andrewcw | last post by:
OK I am half way there - I can manipulate the stream without the byte issue like this - but is this the way to push the new values back into the stream & write out the stream without resorting to byte conversion ?? FileStream stream = null; stream = File.Open(fiPath, FileMode.Open, FileAccess.ReadWrite,FileShare.None); System.IO.StreamReader Tin = new System.IO.StreamReader (stream);
5
2555
by: andrewcw | last post by:
I have an object to serialize. TextWriter writer = new StreamWriter("test.xml"); serializer.Serialize(writer,obj); writer.Close(); but below does not, why ?? I have a file that I will have exclusively opened & I use the stream for that operation. THANKS { I am tring to push the object back into the stream )
3
15325
by: MJB | last post by:
I'm getting an IStream back from function xmlHttp.responsestream. I would like to convert this to a System.IO.Stream in order to work with it in my application. Has anyone encountered this and written a conversion? TIA, Matt
4
2319
by: fastback66 | last post by:
Evidently per the C++ standard, it is not possible to measure the distance between two stream iterators, because two non-end-of-stream iterators are equal when they are constructed from the same stream. I still don't quite understand why that fact is true. But... I wish to find the first occurance of some sequence in an existing stream. For the moment this stream is a file on disk, but later may be a stream from another process. Anyway,...
8
10466
by: Marc Gravell | last post by:
I want to write a method that will accept a stream as a parameter, and which will write xml to the stream (based in reality on database results) using the XmlTextWriter class. However, this insists on closing my stream, and I can't convince it not to. A much-simplified example is below; basically, as soon as the writer is disposed (marked **** below) the base stream gets closed - which is a pain if I was still using it ;-p The base...
0
3122
by: mario.lat_ | last post by:
Hallo to all, I have write a little script for connecting to cisco router BUT I have a problem: I have to send to router all the commands and then I have to read the output. If I send a command1 and read the output for command1 the script works well, If I sent command1 , I send command2 and then I read output for command1 and command2 it works well. If i send command1 and then I read the output for command1 then send command2 I can't...
3
3034
by: sven.suursoho | last post by:
Hello, In main(), the first output API is what I try to achieve. Unfortunately it fails, printing first string as pointer instead of human readable message. Tried to initialize str(""), set new buffer etc, but nothing worked. Ideas? Also might use another internal construct, only API is needed and requirement to reuse existing std::ostream inserters.
4
2336
by: Scott F. Brown | last post by:
Greetings all... I was playing around with compressing streams and came across a behavior that I do not understand. I create a stream (input) from the contents of a textbox. That stream is compressed into another stream (output). I then copy the stream (output) to another stream (input2). The compressed stream (input2) is then decompressed into a final stream (output2). My question is this. I create input2 from output.GetBuffer()...
0
1316
by: Flawio_83 | last post by:
I have an ADSL modem and ipcam. I want to desing a web page in ASP.NET or with using any other technologies, to watch my ipcam on the internet, from everyplaces in the world. I'll be glad to hear from you soon. Thanks, Ali
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.