02-03-2021 08:26 AM
From your video it looks like a snapshot file would be ok. The example already has the ability to save a frame to file. You just have to load that file back into LabVIEW.
If you want to access data in memory, I think you would have to use the smem (https://wiki.videolan.org/Stream_to_memory_(smem)_tutorial/). That would require a separate DLL where you define callbacks for VLC and in those callbacks maybe use user events to send your video frames to LabVIEW.
02-03-2021 03:30 PM
@ThamS wrote:
I think my probelm is, the VLC activeX seems doesn't really create image on picture box. instead it just use the windows handler of the .NET picturebox to show the frame on top of picturebox control. (I'm refereing to VLC scripting in LabVIEW by GriffinRU)
what do you guys think?
*off topic*
Longtime ago, I've witnessed something like you are describing above: here , when a .NET picturebox is used to display the imagestream of a webcam (via a Windows Runtime in the background)
I could not solve this issue directly, but found a work-around, which ironically is also authored by GriffinRU
😀
*off-topic*
When using VLC to stream an image stream, there usually is a snapshot button available.
when pressed this does save a single frame encoded as a .png to your harddrive.
I don't even know, if this is an option for your application,
but at the bottom of the VLC Scripting page there's this note:
...
VLC - Play Stream&Snapshot.vi
Update: 9/03/2014
VLC - Save Stream.vi - save video stamp with text and logo
Note: snapshot function doesn't work...https://forum.videolan.org/viewtopic.php?f=14&t=104610
02-05-2021 10:29 AM - edited 02-05-2021 10:32 AM
ok, I had to try it myself:
I can access a IP camera image stream by feeding its http:// ip adress : port into VLC
So - let's try with Griffin's Play Stream and Snapshot Snippet which is the second from above:

In this snippet he is using VLC 32 Bit-
Turns out I am using LabView x64 and VLC x64 Bit.
"VLC Get Program Location" does spawn the right patrh to the essential libvlc.dll
, but I have to manually change every I32 to I64 and every U32 to U64.
I almost overlooked the PictureBox: Handle > IntPtr: ToInt64 (which was Int32, of course)
I save the .vi, enter http:// ip adress : port into the Media Source String control - and voila - an embedded VLC Window spawns in my .vi
and now: if I press the Snap Button - one frame is saved to file (as in this case the Ip Cam streams a jpg encoded stream, I use .jpg file)
so, if we want access a single frame as 2d array in LabView we first have to save to file and then read back via
https://zone.ni.com/reference/en-XX/help/371361R-01/lvpict/read_jpeg_file/
I don't know if is possible to access the array data directly ...