<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Vision acquisition tools in G Web Development Software</title>
    <link>https://ni.lithium.com/t5/G-Web-Development-Software/Vision-acquisition-tools/m-p/4354011#M679</link>
    <description>&lt;P&gt;As you have described, G Web Development Software does not have explicit support for web cam streaming. These are some of the things I have done for different projects:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Send images over SystemLink Tags&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The pattern there is to capture the images, convert them to the Data URL string format that can be displayed in the URL Image control on a WebVI, and write it to a SystemLink Tag. The forum&amp;nbsp;&lt;A href="https://forums.ni.com/t5/LabVIEW/Displaying-LV-Current-Gen-FP-in-NXG-WebVI/m-p/4073669/highlight/true#M1170895" target="_self"&gt;Displaying LV Current Gen FP in NXG WebVI&lt;/A&gt;&amp;nbsp;discusses that approach and uses capturing images of the LabVIEW Front Panel as an example but it is a similar concept.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some Pros:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The NI Web Server and tags can handle multiple connections from different WebVIs well reading tags or multiple applications publishing tags&lt;/LI&gt;
&lt;LI&gt;Works with tools and libraries included with LabVIEW + Drivers and G Web Development Development Software&lt;/LI&gt;
&lt;LI&gt;WebVIs are not trying to connect directly to the running LabVIEW application&lt;/LI&gt;
&lt;LI&gt;Tags have built-in robust access control / permissions&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some Cons:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;1-2 Hz updates for tags may not be sufficient for all applications&lt;/LI&gt;
&lt;LI&gt;Some overhead encoding everything as a string to store as a tag&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Send images over WebSockets&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The workflow in LabVIEW would look like:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Create a WebSocket server in LabVIEW. For libraries that can help make a WebSocket server see:&amp;nbsp;&lt;A href="https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000kJV5SAM&amp;amp;l=en-US" target="_self"&gt;How Do I Use WebSockets for Data Communication in LabVIEW&lt;/A&gt;?&lt;/LI&gt;
&lt;LI&gt;Wait for connections on the WebSocket server&lt;/LI&gt;
&lt;LI&gt;On connection start sending images captured over the WebSocket connection as binary. You likely want to use some compression like jpeg and keep the image resolution small for quick transfer.&lt;/LI&gt;
&lt;LI&gt;Manage the connection, in particular handling multiple connections (WebVIs opened in multiple tabs or a page is refreshed) and disconnects.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The workflow in G Web Development would look like:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Open a WebSocket connection to the LabVIEW server&lt;/LI&gt;
&lt;LI&gt;Read for a binary response from the LabVIEW server. Use the&amp;nbsp;&lt;A href="https://forums.ni.com/t5/Example-Code/Synchronous-Image-for-WebVI/ta-p/4198872" target="_self"&gt;Synchronous Image for WebVI&lt;/A&gt; example to efficiently pass the image to a custom control designed for efficient updates.&lt;/LI&gt;
&lt;LI&gt;Handle WebSocket disconnects and reconnection logic&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some Pros:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;There is no longer a server in the middle that both sides need to talk to so theoretically could have lower latency and higher throughput.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some Cons:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;This is fundamentally a faster way of sending individual images compared to a network video stream protocol designed for efficient video streaming. Probably not building the next video streaming service this way (well with a lot of effort maybe you could&amp;nbsp;&lt;A href="https://webrtchacks.com/zoom-avoids-using-webrtc/" target="_self"&gt;like the zoom video conferencing app&lt;/A&gt; did).&lt;/LI&gt;
&lt;LI&gt;Have to manage how many clients you want to allow to connect to the LabVIEW application.&lt;/LI&gt;
&lt;LI&gt;The WebVI needs to know the url of the WebSocket LabVIEW Server to connect to. Some options:
&lt;UL&gt;
&lt;LI&gt;Have a static ip address / DNS name for that LabVIEW application that is well known&lt;/LI&gt;
&lt;LI&gt;Have the LabVIEW application publish its WebSocket server URL as a tag the WebVI can read. I've had a LabVIEW application publish its WebSocket URL to a tag regularly so I can use the timestamp of the tag last update as a watchdog.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Have to figure out patterns for access control / permissions / security&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Use camera hardware / software designed for browser integration&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some webcams have built-in servers that can give you a URL that can be used with the URL Image control. For example in the &lt;A href="https://github.com/ni/webvi-examples?tab=readme-ov-file#embed-content-into-a-webvi" target="_self"&gt;Embed Content into a WebVI&lt;/A&gt; example the URL Image control is given a URL to an mjpeg video stream from a webcam.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is probably web cam software that can create servers for &lt;A href="https://en.wikipedia.org/wiki/HTML5_video#Supported_video_and_audio_formats" target="_self"&gt;video formats compatible with the browser native HTML&lt;FONT face="courier new,courier"&gt; &amp;lt;video&amp;gt;&lt;/FONT&gt;&lt;/A&gt; tag. While G Web does not have support for the &lt;A href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video" target="_self"&gt;HTML 5 &amp;lt;video&amp;gt; tag&lt;/A&gt; out of the box one could use the JavaScript Library Interface and the Placeholder HTML Container control to use one as described in the topic &lt;A href="https://www.ni.com/docs/en-US/bundle/g-web-development/page/create-ui-elements-with-javascript.html" target="_self"&gt;Creating UI Elements with JavaScript&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 11 Feb 2024 01:45:19 GMT</pubDate>
    <dc:creator>MilanR</dc:creator>
    <dc:date>2024-02-11T01:45:19Z</dc:date>
    <item>
      <title>Vision acquisition tools</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Vision-acquisition-tools/m-p/4353574#M677</link>
      <description>&lt;P&gt;Hello everyone, I'm new to the G Web Development software and I'm struggling with a certain project.&lt;/P&gt;
&lt;P&gt;So I'm trying to acquire a live camera feed from a webcam and i'm trying to do this on the G Web software, is this feasible or are there modules to do this in G Web like the IMAQ modules on LabView . I couldn't find anything relevant and don't think i can use system link on LabView as it seems to be not for these kinds of tasks due to a ~2Hz approx frequency which is unusable for a live video feed ( correct me if I am wrong ).&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 14:17:30 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Vision-acquisition-tools/m-p/4353574#M677</guid>
      <dc:creator>Jasserz</dc:creator>
      <dc:date>2024-02-08T14:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Vision acquisition tools</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Vision-acquisition-tools/m-p/4354011#M679</link>
      <description>&lt;P&gt;As you have described, G Web Development Software does not have explicit support for web cam streaming. These are some of the things I have done for different projects:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Send images over SystemLink Tags&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The pattern there is to capture the images, convert them to the Data URL string format that can be displayed in the URL Image control on a WebVI, and write it to a SystemLink Tag. The forum&amp;nbsp;&lt;A href="https://forums.ni.com/t5/LabVIEW/Displaying-LV-Current-Gen-FP-in-NXG-WebVI/m-p/4073669/highlight/true#M1170895" target="_self"&gt;Displaying LV Current Gen FP in NXG WebVI&lt;/A&gt;&amp;nbsp;discusses that approach and uses capturing images of the LabVIEW Front Panel as an example but it is a similar concept.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some Pros:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The NI Web Server and tags can handle multiple connections from different WebVIs well reading tags or multiple applications publishing tags&lt;/LI&gt;
&lt;LI&gt;Works with tools and libraries included with LabVIEW + Drivers and G Web Development Development Software&lt;/LI&gt;
&lt;LI&gt;WebVIs are not trying to connect directly to the running LabVIEW application&lt;/LI&gt;
&lt;LI&gt;Tags have built-in robust access control / permissions&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some Cons:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;1-2 Hz updates for tags may not be sufficient for all applications&lt;/LI&gt;
&lt;LI&gt;Some overhead encoding everything as a string to store as a tag&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Send images over WebSockets&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The workflow in LabVIEW would look like:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Create a WebSocket server in LabVIEW. For libraries that can help make a WebSocket server see:&amp;nbsp;&lt;A href="https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000kJV5SAM&amp;amp;l=en-US" target="_self"&gt;How Do I Use WebSockets for Data Communication in LabVIEW&lt;/A&gt;?&lt;/LI&gt;
&lt;LI&gt;Wait for connections on the WebSocket server&lt;/LI&gt;
&lt;LI&gt;On connection start sending images captured over the WebSocket connection as binary. You likely want to use some compression like jpeg and keep the image resolution small for quick transfer.&lt;/LI&gt;
&lt;LI&gt;Manage the connection, in particular handling multiple connections (WebVIs opened in multiple tabs or a page is refreshed) and disconnects.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The workflow in G Web Development would look like:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Open a WebSocket connection to the LabVIEW server&lt;/LI&gt;
&lt;LI&gt;Read for a binary response from the LabVIEW server. Use the&amp;nbsp;&lt;A href="https://forums.ni.com/t5/Example-Code/Synchronous-Image-for-WebVI/ta-p/4198872" target="_self"&gt;Synchronous Image for WebVI&lt;/A&gt; example to efficiently pass the image to a custom control designed for efficient updates.&lt;/LI&gt;
&lt;LI&gt;Handle WebSocket disconnects and reconnection logic&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some Pros:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;There is no longer a server in the middle that both sides need to talk to so theoretically could have lower latency and higher throughput.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some Cons:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;This is fundamentally a faster way of sending individual images compared to a network video stream protocol designed for efficient video streaming. Probably not building the next video streaming service this way (well with a lot of effort maybe you could&amp;nbsp;&lt;A href="https://webrtchacks.com/zoom-avoids-using-webrtc/" target="_self"&gt;like the zoom video conferencing app&lt;/A&gt; did).&lt;/LI&gt;
&lt;LI&gt;Have to manage how many clients you want to allow to connect to the LabVIEW application.&lt;/LI&gt;
&lt;LI&gt;The WebVI needs to know the url of the WebSocket LabVIEW Server to connect to. Some options:
&lt;UL&gt;
&lt;LI&gt;Have a static ip address / DNS name for that LabVIEW application that is well known&lt;/LI&gt;
&lt;LI&gt;Have the LabVIEW application publish its WebSocket server URL as a tag the WebVI can read. I've had a LabVIEW application publish its WebSocket URL to a tag regularly so I can use the timestamp of the tag last update as a watchdog.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Have to figure out patterns for access control / permissions / security&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Use camera hardware / software designed for browser integration&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some webcams have built-in servers that can give you a URL that can be used with the URL Image control. For example in the &lt;A href="https://github.com/ni/webvi-examples?tab=readme-ov-file#embed-content-into-a-webvi" target="_self"&gt;Embed Content into a WebVI&lt;/A&gt; example the URL Image control is given a URL to an mjpeg video stream from a webcam.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is probably web cam software that can create servers for &lt;A href="https://en.wikipedia.org/wiki/HTML5_video#Supported_video_and_audio_formats" target="_self"&gt;video formats compatible with the browser native HTML&lt;FONT face="courier new,courier"&gt; &amp;lt;video&amp;gt;&lt;/FONT&gt;&lt;/A&gt; tag. While G Web does not have support for the &lt;A href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video" target="_self"&gt;HTML 5 &amp;lt;video&amp;gt; tag&lt;/A&gt; out of the box one could use the JavaScript Library Interface and the Placeholder HTML Container control to use one as described in the topic &lt;A href="https://www.ni.com/docs/en-US/bundle/g-web-development/page/create-ui-elements-with-javascript.html" target="_self"&gt;Creating UI Elements with JavaScript&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Feb 2024 01:45:19 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Vision-acquisition-tools/m-p/4354011#M679</guid>
      <dc:creator>MilanR</dc:creator>
      <dc:date>2024-02-11T01:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Vision acquisition tools</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Vision-acquisition-tools/m-p/4354082#M680</link>
      <description>&lt;P&gt;Thank you, I will try them and see if they work well for my kind of application.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 08:36:44 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Vision-acquisition-tools/m-p/4354082#M680</guid>
      <dc:creator>Jasserz</dc:creator>
      <dc:date>2024-02-12T08:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Vision acquisition tools</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Vision-acquisition-tools/m-p/4354096#M681</link>
      <description>&lt;P&gt;How about using real time streaming protocol (rtsp)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have gweb application that should be extended to also display cctv.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If anyone in this forum has implemented this before, please kindly share how to perform this in gweb.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 09:53:53 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Vision-acquisition-tools/m-p/4354096#M681</guid>
      <dc:creator>irfanabid</dc:creator>
      <dc:date>2024-02-12T09:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Vision acquisition tools</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Vision-acquisition-tools/m-p/4354100#M682</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;I haven't used an rtsp before or a related application but I will look into it and hopefully I will come up with a possible solution.&lt;/P&gt;
&lt;P&gt;If anyone has a know-how or related program please inform me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 10:32:42 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Vision-acquisition-tools/m-p/4354100#M682</guid>
      <dc:creator>Jasserz</dc:creator>
      <dc:date>2024-02-12T10:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Vision acquisition tools</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Vision-acquisition-tools/m-p/4354178#M683</link>
      <description>&lt;P&gt;I don't have much RTSP video streaming experience so it will be interesting to see what y'all find.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do know that web browsers cannot access the RTSP protocol directly, so you likely need some additional server software in the middle.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 16:47:03 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Vision-acquisition-tools/m-p/4354178#M683</guid>
      <dc:creator>MilanR</dc:creator>
      <dc:date>2024-02-12T16:47:03Z</dc:date>
    </item>
  </channel>
</rss>

