Jump to content

WebCams


Guest

Recommended Posts

Message from: "Harry Rogers"

 

Hi Farshad

 

In the App we are developing we have the ability to associate various

WebCams with specific sessions.

 

Using the UniURLFrame we can obviuosly give the user a live view.

If they are running a WebSession on the Same machine as the server we

can use the Windows Clipboard to Grab the required frame(s).

 

When they are running a WebSesion on a remote machine the UniURLFrame

can still be used but we don't get access to their clipboard (there may

be ways to achieve this but it somewaht goes against the grain of the

security model of a web app I think). So we are using an IndyHTTP to

Get the image from the camera's static image url to fill a stream, This

stream then gets loaded into a TJpegImage which is assigned to the

picture of UniImage. - This all works fine so we have a means to get

the image a users sees in the live UniFrameURL to server side.

 

Two questions :

 

1. Is there a better/faster way?

2. We tried originally to load the stream directly into the

UniImage.Picture.Graphic but this produces and AV.

 

 

Procedure TfrmCamUrl.UniButton1Click(Sender: TObject);

var

MS : TmemoryStream;

IMG : TJpegImage;

begin

try

MS := TmemoryStream.Create;

IMG := TjpegImage.Create;

idHttp1.Get('http://222.222.222.128/axis-cgi/jpg/image.cgi?',MS);

MS.Seek(0,soFromBeginning);

 

// TWO POSSIBLE WAYS TO GET IMAGE INTO THE UNIIAMGE

// METHOD 1 THIS WORKS

IMG.LoadFromStream(MS);

UniImage1.Picture.Assign(IMG);

 

// METHOD 2 THIS PRODUCES AN AV

// UniImage1.Picture.Graphic.LoadFromStream(MS);

 

finally

freeAndNil(IMG);

freeAndNil(MS);

end;

end;

--

 

.

 

Link to comment
Share on other sites

Message from: "Farshad Mohajeri"

 

"Harry Rogers" wrote in message

news:ZlTGjZdnLHA.2084@anaxagvs227...

> How about an extended UniImage component with a URL property that could

> do all the magic ?

>

 

URL support for UniImage will be available.

 

 

.

 

Link to comment
Share on other sites

  • 4 weeks later...

Message from: "Farshad Mohajeri"

 

"Harry Rogers" wrote in message

news:IteEJXdnLHA.2316@anaxagvs227...

> Hi Farshad

>

> In the App we are developing we have the ability to associate various

> WebCams with specific sessions.

>

> Using the UniURLFrame we can obviuosly give the user a live view.

> If they are running a WebSession on the Same machine as the server we

> can use the Windows Clipboard to Grab the required frame(s).

>

> When they are running a WebSesion on a remote machine the UniURLFrame

> can still be used but we don't get access to their clipboard (there may

> be ways to achieve this but it somewaht goes against the grain of the

> security model of a web app I think). So we are using an IndyHTTP to

> Get the image from the camera's static image url to fill a stream, This

> stream then gets loaded into a TJpegImage which is assigned to the

> picture of UniImage. - This all works fine so we have a means to get

> the image a users sees in the live UniFrameURL to server side.

>

> Two questions :

>

> 1. Is there a better/faster way?

 

Well, for showing video the best way is streaming video content using one of

the available standards, but its implementation can be complex.

 

> 2. We tried originally to load the stream directly into the

> UniImage.Picture.Graphic but this produces and AV.

 

What kind of stream is it? JPEG?

In 0.83.0 we have Url property for UniImage. Does assigning camera URL

directly to UniImage.Url solve this problem?

 

>

>

> Procedure TfrmCamUrl.UniButton1Click(Sender: TObject);

> var

> MS : TmemoryStream;

> IMG : TJpegImage;

> begin

> try

> MS := TmemoryStream.Create;

> IMG := TjpegImage.Create;

> idHttp1.Get('http://222.222.222.128/axis-cgi/jpg/image.cgi?',MS);

> MS.Seek(0,soFromBeginning);

>

> // TWO POSSIBLE WAYS TO GET IMAGE INTO THE UNIIAMGE

> // METHOD 1 THIS WORKS

> IMG.LoadFromStream(MS);

> UniImage1.Picture.Assign(IMG);

>

> // METHOD 2 THIS PRODUCES AN AV

> // UniImage1.Picture.Graphic.LoadFromStream(MS);

 

So "METHOD 2" works in VCL mode, or does it fails in VCL too?

 

>

> finally

> freeAndNil(IMG);

> freeAndNil(MS);

> end;

> end;

> --

>

 

 

.

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...