To download NI software, including the products shown below, visit ni.com/downloads.
Introduction
This example shows how to use the STM protocol to transmit video captured using the IMAQdx driver. The images are compressed prior to transmission in order to use less bandwidth.
Video Server:
Video Client:
Additional Notes
The VI was tested using the IMAQdx driver and a USB Webcam.
The Simple TCP/IP Messaging Protocol can be found here
Description-Separate-2
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
thank you, this exemple was helpful....but please could you give some extrat explanations about the way it work and its main functions . thanks
bk90,
I'm not quite sure what you're asking. Is there a particular function that you have questions on?
The idea is to grab an image, compress it for network transfer, and use STM (which is built on TCP/IP) to transfer the data to a client VI. I would recommend using Context Help (Ctrl+H) and highlight any functions you want to learn more about. Within each Context Help page, there should be a link to more Detailed information on each VI.
I've tried to transfer video between two pc's using the above example code.I can receive string data when i'm transmitting from one PC.but i cant unflatten that data into image data.Any other modifications needed?
Can you post your example? You can do this by clicking the HTML in the right corner of the reply editor and then selecting Show Full Editor.
Can you try compressing the image? Your server example is missing the IMAQ Flatten Image VI; it's designed to work with the Flatten to String function.
Ya I compressed the image before sending it..but its not works.then only i've modified the code as above. (its working for localhost, not for other pc(192.100.x.xxx).
Change the Snap function with Grab, then put while loop. Do as it is shown in the example and it will work. Usually the first frame of the camera is black. Check also Subnet Masks, they should be the same to see each other. And if after all that thing your program will again not work, then please expain here what you mean saying "not works". Does the VI give you any kind of error?
not works means there is no image received at the client vi. But the string data which is sent from the server can be received.when i try to unflatten this string data into image data,the image display is blank.
in 2011 labview STM is not there !!!what can i do now
STM has always been a seperate install. Look in VIPM and you can get the latest version.
hi crossrulz,
Thank you so much for your replay,now i am downloding VIPM
STM is not there in VIPM
It should be in the list once all of the packages from the LabVIEW Tools Network is downloaded.
How to stream video from labview to HTML ? I mean i need to stream video from a USB webcam connected to myRIO to web browser via web sockets or web service ?
Is it possible ?
Please help !
You'll probably need this driver to read the USB webcam (http://www.ni.com/example/30030/en/), I can't guarantee it'll work with the myRIO. At that point, instead of using STM to send your data, you will need to create a Web Service in LabVIEW to read the USB webcam data using the IMAQ for USB driver and provide the data to your thin client (web page).
I recommend starting here to learn about building a web service: https://decibel.ni.com/content/docs/DOC-41151. Note that not only do you need to build a web service in LabVIEW, but you'll need to create some kind of page (with HTML5, or JavaScript, or whatever web language you prefer) that accesses the web service.
You should be able to get plenty of help with the LabVIEW web service if you go to forums.ni.com and post your questions there; I can't guarantee they'll be able to help with the thin client. Generally, stackoverflow.com is a good resource for the web development.
Hi
Is it possible to stream using sjcam sj4000, my ip is 192.168.1.254.
it is well working with vlc player. can u pls help me out..
how about multi-client?