Is there a way to embed a webcam video stream on page_0


Antony

Recommended Posts

Hello,

I would like to embed a webcam based video stream onto Page_0 if possible.

Currently, I have to open IE to view the video stream from the monitoring webcam. It would be great if I could embed the video stream and get rid of IE. This would make the UI controls and visuals available on the one application.

Link to comment
Share on other sites

This sounds like a true webcam, meaning it displays in a browser. You could use system.helpdialog() to popup a window that displays the URL, but its a modal dialog so you couldn't access the rest of DF at the same time. You'd have to close the window first. There are other ways to do it, but would require some advanced programming, basically writing a separate little application that displayed the webcam in a system modal dialog (always on top), and then call that from DF using system.shellexecute().

Link to comment
Share on other sites

Is it possible to create a custom component that will display a nominated ie. based url?

The properties would be URL:

That is all that is needed.

What would need to be done in order to create this custom component?

Link to comment
Share on other sites

You can't, and truthfully we couldn't really create one for you because in your application, the browser would want to be able to refresh its area at its own rate and the way DF draws its pages won't allow for that.

That all said, one option would be to use the DAQConnect service and embed the data side in a page that also contained the embedded video link.

Link to comment
Share on other sites

  • 3 months later...

Hmm, this is interesting...

I have an AIC250, and I made a protocol for this device and can Tx to it, but it returns a GETHEAD error.

Possibly have to know what kind of language the camera speaks in to communicate with it, correct?

I'm pretty sure this camera isn't a "video" stream, but it utilizes something called MJPEG, taking a series of pictures and making a "video" from them.

Would be kinda cool to have a small pop-up of the ip cam. ;)

Link to comment
Share on other sites

It all really depends on the camera. That particular camera (AIC250) appears to support FTP, so maybe you can download the latest image to a file using DF's built in FTP client, then open and read the file into a variable. You'd just have to figure out what the format of the file was. If its a bitmap, you can easily parse through the data. If its a jpeg, you can use the loadJpeg() function of a symbol control to load the image into the control. Then just repeat every 5 seconds or so and while its not real time 30fps video, it is something.

True high speed video would require a number of other tricks.

Link to comment
Share on other sites

Would it be something like this in the expression of a symbol component?

loadJpeg(c:\theimage.jpg)

That is, if the camera is sending the files to a local hard disc?

Can you give me an example of parsing out a .bmp file? (pretty sure this camera is MJPEG)

Thanks!

Link to comment
Share on other sites

No, it'd be:

component.mysymbol.loadjpeg("c:\theimage.jpg")

It is a common problem, for some reason, that customers specify values without "", meaning not as a string. It is important to understand that anything not specified in "" as a string will need to be either an object (like a variable, channel, logging set, etc) or a constant (like 1, 2, or {3,4}) c:\theimage.jpg is none of these.

You would parse a bitmap using the from.byte functions and then rearrange the array. This is quite advanced and I'll wait until someone has a real need for it. Lets just say its possible. I know a number of people who have done it from image capture hardware (more advanced than webcam)

Link to comment
Share on other sites

  • 6 years later...
  • 3 months later...

You basically call device.webcam.init() once.  Then call device.webcam.takeFrame() to capture a frame.  This you'll likely want to trigger in a separate sequence that just calls that at some interval.  Finally, call GetLastFrame() to retrieve the last frame captured.  The result of this function you can just store in a string variable that you can then reference in an image component to view that frame.

Beyond that it just depends what you want to do, but the above should get you an image.

Link to comment
Share on other sites

I haven't worked with DAQ factory for a while so I am a little rusty, pardon me if this seems Naive...

I created a sequence with this code:

 

 device.webcam.init()
 global string frame

 while(1)
  device.webcam.takeFrame()
  delay (0.5)
   GetLastFrame() = frame
 endwhile

Then I created an image component with the expression being:   frame

Am I missing something?


 

 

Link to comment
Share on other sites

I get these error messages:

 11/11/16 12:55:26.410
C1033 Unable to load device driver RFScada.dll, check file path and make sure manufacturer's drivers are installed.
11/11/16 12:55:26.911
C1000 Channel or function not found: webcam Line 7 - Uncaught error in sequence webcam
 

Link to comment
Share on other sites

made sequence with this code now:

 

device.webcam.init()
global string frame

while(1)
device.webcam.takeFrame()
frame = "GetLastFrame()"
delay (0.5)
endwhile
 

now the loop runs but i get this error message:

C1033 Unable to load device driver RFScada.dll, check file path and make sure manufacturer's drivers are installed.

Link to comment
Share on other sites

Ok I changed my sequence to this:

 

device.webcam.init()
global string frame

while(1)
  device.webcam.takeFrame()
  delay (0.5)
  frame = device.webcam.getLastFrame()
endwhile

 

I have am image component on page_0 with the expression:   frame

 The loop runs, the image component goes solid white, and i get this error message now once per loop:

C1033 Unable to load device driver DDE.dll, check file path and make sure manufacturer's drivers are installed.

I don't see " RFSCADA.dll" or "DDE.dll" in the DAQ factory folder.

 

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.