LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Video transmission from one computer to another computer over TCP

Solved!
Go to solution

Wire the "Error out" of the "TCP C lose Connection" to a Clear Error. This should be done both in the "Wait For Connection" and "Stop" states.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 21 of 64
(375 Views)

I created it as you said, this error occurs on both sides.this error usually occurs when data is not transmitted correctly.

constructionworker_0-1657391091336.png

 

0 Kudos
Message 22 of 64
(372 Views)

What are the size of your images. This looks like one side of the receive is not receiving/processing the data quickly enough. To start, try increasing the delay in your client. You had it at 5 ms which I believe is way t o fast. I changed that to 50. Try something very slow like 1000 and see if that improves things. If you have large images as rolfk stated, you probably need some type of compression. TCP also includes a fair amount of overhead. Most video streaming is done using UDP which has much less overhead however it is not guaranteed delivery. Packets can get dropped and then you need some higher level protocol that can handled missing or out of order data packets.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 23 of 64
(363 Views)

I don't think the problem is related to latency.
The problem is in the way of sending the video here.

Pictures are 640x480 resolution

I think there is a problem when converting the video to string and sending the byte length.

constructionworker_0-1657396607691.png

 

constructionworker_0-1657394299893.png

 

0 Kudos
Message 24 of 64
(358 Views)

For what it is worth, you never created the Network Stream Writer (you never run the "Connect" state).

 

Bob Schor

 

P.S. -- I've not actually tried sending Frames by Network Streams.  I'm reasonably sure this can be done, as IMAQdx is available in LabVIEW RT on cRIOs, and I assume the RIO gets the Image from the Camera and sends it via Network Streams to the Host (but, as I just said, I've not tried it, myself).

0 Kudos
Message 25 of 64
(339 Views)

No, there is no problem doing that. The Flatten to String takes the input and converts it to a string and since it has knowledge of the structure of the input, it correctly includes meta data such as the length or strings and arrays in the data stream. As long as you use Unflatten from String with the correct type input the string will be correctly decoded. I don't have your setup so obviously I can't test it. I am confident in the data stream given that this is something I do all of the time.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 26 of 64
(335 Views)

@Bob_Schor wrote:

For what it is worth, you never created the Network Stream Writer (you never run the "Connect" state).


constructionworker_0-1657444575083.png

There is no problem on the same computer, but communication cannot be established on two different computers.


@Bob_Schor wrote:

P.S. -- I've not actually tried sending Frames by Network Streams.  I'm reasonably sure this can be done, as IMAQdx is available in LabVIEW RT on cRIOs, and I assume the RIO gets the Image from the Camera and sends it via Network Streams to the Host (but, as I just said, I've not tried it, myself).


I think the main problem is not whether the video can be transferred or not, because when trying to send normal data, a connection cannot be established between the two computers.
I'm running a different TCI/IP instance and connecting fine.
I don't know where the problem originates.

 

Download All
0 Kudos
Message 27 of 64
(323 Views)

Arguing over two different methods seems to lead to confusion.


-First of all, can you tell me where is the problem in the method I published  here  and  here?
Note: It is the fastest method I have tried so far and at least I can transmit the video.


- Since Network Stream is already on the basis of TCP/IP, I think it would be better if we could continue over TCP/IP example, because there will be no result that affects the video transmission speed.

Network stream, I think, creates a problem in data transfer with an ethernet cable between two computers.

0 Kudos
Message 28 of 64
(316 Views)

@Mark_Yedinak wrote:

No, there is no problem doing that. The Flatten to String takes the input and converts it to a string and since it has knowledge of the structure of the input, it correctly includes meta data such as the length or strings and arrays in the data stream. As long as you use Unflatten from String with the correct type input the string will be correctly decoded. I don't have your setup so obviously I can't test it. I am confident in the data stream given that this is something I do all of the time.



After making changes to the example you created, the connection is now established, but it gives an error as follows.

constructionworker_0-1657475208684.png

 

constructionworker_1-1657475221807.png

Problem occurs in unflatten from string.

0 Kudos
Message 29 of 64
(300 Views)

@constructionworker wrote:

@Mark_Yedinak wrote:

No, there is no problem doing that. The Flatten to String takes the input and converts it to a string and since it has knowledge of the structure of the input, it correctly includes meta data such as the length or strings and arrays in the data stream. As long as you use Unflatten from String with the correct type input the string will be correctly decoded. I don't have your setup so obviously I can't test it. I am confident in the data stream given that this is something I do all of the time.



After making changes to the example you created, the connection is now established, but it gives an error as follows.

constructionworker_0-1657475208684.png

 

constructionworker_1-1657475221807.png

Problem occurs in unflatten from string.


I'm pretty sure that means that the datatype you chose for unflattening isn't the same as the one that was flattened.If this is a complicated data structure, you should typdef it so there is no chance if this happening.  Or, it might be because you told it to include size data in one but not the other.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 30 of 64
(290 Views)