LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Check out the related Code Repository Files or visit the LabVIEW Wiki Internet Portal


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> USB webcam over LAN problem
z3r0 c0o1
post Sep 6 2008, 09:47 PM
Post #1


Enough LAVA to be dangerous


Member
Posts: 4
Joined: 6-September 08
Member No.: 12472
Using LabVIEW Since:2008
LV:8.5 ,7.1 ,.
Yugoslavia Nothing Selected Nothing Selected


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.gif 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 sad.gif . 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



Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Sep 6 2008, 09:47 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
crelf
post Sep 6 2008, 10:23 PM
Post #2


I'm a LAVA, not a fighter.
******

V I Engineering, Inc.
Posts: 3749
Joined: 13-October 03
From: Michigan, USA
Member No.: 181
Using LabVIEW Since:1993
LV:8.5 ,. ,.
Australia United States Nothing Selected My Blog


QUOTE (z3r0 c0o1 @ Sep 6 2008, 05:47 PM) *
I am... a new member to this forum

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.

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
z3r0 c0o1
post Sep 7 2008, 03:40 AM
Post #3


Enough LAVA to be dangerous


Member
Posts: 4
Joined: 6-September 08
Member No.: 12472
Using LabVIEW Since:2008
LV:8.5 ,7.1 ,.
Yugoslavia Nothing Selected Nothing Selected


Thanks for the welcoming

Here is the part of the code I am having trouble with





Attached File  image_receiver.vi ( 51.29K ) Number of downloads: 65
Attached File  image_sender.vi ( 26.07K ) Number of downloads: 51





Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
crelf
post Sep 7 2008, 04:58 AM
Post #4


I'm a LAVA, not a fighter.
******

V I Engineering, Inc.
Posts: 3749
Joined: 13-October 03
From: Michigan, USA
Member No.: 181
Using LabVIEW Since:1993
LV:8.5 ,. ,.
Australia United States Nothing Selected My Blog


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 smile.gif 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...

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
z3r0 c0o1
post Sep 7 2008, 04:49 PM
Post #5


Enough LAVA to be dangerous


Member
Posts: 4
Joined: 6-September 08
Member No.: 12472
Using LabVIEW Since:2008
LV:8.5 ,7.1 ,.
Yugoslavia Nothing Selected Nothing Selected


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


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
crelf
post Sep 7 2008, 05:06 PM
Post #6


I'm a LAVA, not a fighter.
******

V I Engineering, Inc.
Posts: 3749
Joined: 13-October 03
From: Michigan, USA
Member No.: 181
Using LabVIEW Since:1993
LV:8.5 ,. ,.
Australia United States Nothing Selected My Blog


QUOTE (z3r0 c0o1 @ Sep 7 2008, 12:49 PM) *
Thanks for the advice crelf.

No worries - anytime. If you get a chance, can you please add a link to the jpg string VI? I'd like to tage it so I can find it more easily...

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
z3r0 c0o1
post Sep 8 2008, 12:23 AM
Post #7


Enough LAVA to be dangerous


Member
Posts: 4
Joined: 6-September 08
Member No.: 12472
Using LabVIEW Since:2008
LV:8.5 ,7.1 ,.
Yugoslavia Nothing Selected Nothing Selected


Here is a link for the JPEG decode and encode pack I think this is what you were talking about.
http://forums.ni.com/ni/board/message?boar...ssage.id=335445
Maybe ill post these in the Machine Vision section so others can access it easily, what do you think about that? shifty.gif


Tags
IMAQ JPG     IMAQ JPEG     JPEG encode     JPG encode    
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 1st December 2008 - 10:02 PM