Jump to content

USB webcam over LAN problem


z3r0 c0o1

Recommended Posts

Hi guys, I am fairly new user of labview and a new member to this forum and I apologies in advance for any irregularities.

Ok, here is what I have done.

I have successfully installed the IMAQUSB drivers and they are working great with my Logitech webcam. Now I have created two separate vis as a client and server to send the video input from the cam over LAN using UDP. I first tested the two programs on a same PC sending the data to localhost and its working great, the image is displayed and the indicator of bytes received is going up :yes: as it should.

And now the problem:

The problem happened when I placed the two programs on separate pcs connected over LAN. On both pcs there is an identical set of software from LabView with the drivers running on XP Pro SP2. The two vis are working ok, the firs pc is sending the image and the second should display the image, but it doesn't :( . The indicator for the bytes received on the second pc is going up indicating that the two vis are communicating but there is no picture. Also the probe at the UDP data output is indicating "image0" saying that the image is coming except the image display is not showing anything.

After this I tried to broadcast the image over lan and again the same thing, on the localhost there is an image and on the remote pc there is no image, but the number of bytes received is going up.

If anyone has any idea about this problem or has an example vi for transmitting webcam video over lan ill appreciate it

Thanks

Link to comment

QUOTE (z3r0 c0o1 @ Sep 6 2008, 05:47 PM)

Welcome!

QUOTE (z3r0 c0o1 @ Sep 6 2008, 05:47 PM)

After this I tried to broadcast the image over lan and again the same thing, on the localhost there is an image and on the remote pc there is no image, but the number of bytes received is going up.

Can you post your code? That would help us a lot in tracking down the issue.

Link to comment

OK - here's the issue: Most folks will tell you that LabVIEW is dataflow - the data figuratively flows along the wires, so when you branch a wire, the value gets branched, etc - this model is often affectionately referred to as "by-value' (or "by-val" for short). IMAQ is one of the very few LabVIEW paradigms that isn't by-value: it's by-reference ("by-ref"). The purple IMAQ datatype is actually a reference to the image that's somewhere in memory, so when you pass that value between VIs, the image data isn't actually passed, but a reference to where the data is. That's why it works with localhost, but not across different PCs: when you're local host, the reference that the sender sends refers to the same memory space as the receiver receives whereas when you're on different PCs the receiver doesn't have the image data in memory, so the reference is to nothing. The reason you're seeing packets passed is that you're sending the reference across UDP - and that takes space.

So, now that we've gotten that out of the way, you probably want ideas on how to make this work :) I suggest that you need to get the image data out of memory and stream that across the network. You're going to need to convert the data to a string, and depending on the resolution and colour depth of your image, that could be a lot o' data and could take some time to get across the network. There's a VI floating around somewhere that convert the data to a jpg string with compression directly from an IMAQ reference - have a dig around on the net...

If you get stuck, post again - I'm a little flat-out at the moment, otherwise I'd try to dig up a solution for you...

Link to comment

Thanks for the advice crelf.

I've seen the jpg conversion vi on the forum wile searching for a solution for the problem, I was thinking of using it but I wasn't sure about the problem.

I am glad I have your advice now as an experienced user.

Ill play around with this more. If you have any other good pointer about this I'll appreciate it

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.