开发者

Difference between video streaming and file transfer

开发者 https://www.devze.com 2023-03-08 15:05 出处:网络
Set up and Explanation: I\'m working on a project for school, and have run into a perplexing problem.I\'m trying to transmit a USB signal wirelessly 3-4 feet across the room.I\'ve purchased开发者_JS百

Set up and Explanation:

I'm working on a project for school, and have run into a perplexing problem. I'm trying to transmit a USB signal wirelessly 3-4 feet across the room. I've purchased开发者_JS百科 three different wireless USB devices that all claim to be able to accomplish exactly what I'm seeking. Two of them use the WUSB protocol, and the third uses a slimmed down 802.11g protocol. The following three were the devices:

IOGear Wireless Hub

Belkin Wireless Hub

Gefen Wireless Hub

When running tests, only the device with 802.11g capabilities (Gefen) streamed any video at all, and it had massive frame rate loss. So, I devised a test where I could actually gather some hard data. What I found was pretty interesting.

In lieu of driving all the way to the store to buy a webcam, as most of the things I own have them integrated, I opted for turning my Droid Incredible into a webcam instead with the help of DroidCam's app. I set up TCP port forwarding and set up the client on Windows. I then used Advanced USB Port Monitor to get a baseline bandwidth measurement when it was connected straight to the computer with a wire. It averaged about 10.05 Mbits/s. I then put 200 MB file on my Droid, copied this file, and took a measurement. It averaged about 37.76 Mbits/s. I then switched to the Gefen device and ran the same test. The DroidCam test ran at an average of about 1.05 Mbits/s, and a file transfer rate average of 13.36 Mbits/s. While I expected speed degradation inherent in the wireless, I didn't quite expect that much of a drop.

As mentioned above, I couldn't get the Belkin or IOGear hubs to transmit any video (tested with another video source as well to be sure that it wasn't my Droid), but their file transfer rates were actually better than the Gefen. The IOGear hub clocked in with an average of 19.56 Mbits/s, and the Belkin with a 17.28 Mbits/s rate.

The Question: This is where the algorithms tag comes into play. Which algorithms are being used to copy files vs. stream video, and is there a way to use the "file copy" algorithm in lieu of the video streaming? From the file copy results, the wireless devices have more than enough bandwidth to handle a video stream. I feel like I'm just not tapping the right well of resources, so to speak.

Any help would be appreciated!


Copying a file and streaming video are very different.

Generally, streaming video will use the UDP protocol, (user datagram protocol), which is a connectionLESS protocol. This means that there is no "state" of the connection, and messages are "sent and forgot". If for any reason the packet isn't received correctly, then you're out-of-luck, and the hosts will move onto the next packet.

On the other hand, file sharing generally done with the TCP protocol, which is a connection oriented protocol. This means that there is on-going communication between the two hosts as to what the current status of the transmission is. When a host sends a message over TCP, it isn't just sending the message it is also sending the HASH of the message so that the other host can apply the same hashing algorithm to the packet payload and confirm that the payload from the packet is indeed the payload that was intended to be sent (and wasn't compromised for whatever reason). If the hashes don't match, then the message is sent over again. Generally an algorithm like this would be far less efficient in streaming video, as there are many many more calculations and transmissions taking place.

As for these implementations, I would suggest reading up on UDP and TCP implementations.

0

精彩评论

暂无评论...
验证码 换一张
取 消