Example Code

DirectShow .NET LabVIEW SDK (Video, Audio, IP streams)

Code and Documents

Attachment

Inspired from LabVIEW portal - reference link

 

Library and examples provided as is, minor bugs (aka. features) included but still can be useful for someone who needs to acquire, compress and edit video/audio streams from various sources, directshow compatible devices and internet streams.

Works with GigE cameras if manufacturer provides directshow compatible filter. (Tested with Basler family).

DirectShow has a steep learning curve but once you get familiar with GraphEdit then samples from internet and examples from below should be sufficient to create sophisticated applications.

 

To back check your LabVIEW creating add

DsROTEntry.png

Wire it to your FilterGraph and open in GraphEdit program for inspection and debugging.

 

Requires:

Microsoft Windows SDK - download

Directshow.net library - download

DirectX.Capture class library - download

References:

MSDN DirectShow documetation

DirectShow Debugging/ConceptProofing Tools:

GraphEdit (Microsoft Windows SDK)

 

Alphabetical and Numerically Logical String Array Sort for user menu facelift

 

BEFORE Opening any vi make sure you have in the same directory:

DirectShowLib-2005.dll

DShowNET.dll

DirectX.Capture.dll

logicalstringarraysort.llb

 

Great links:

 

H.264 CUDA Encoder directshow filter -> Examples Added 02/16/2013

Directshow virtual video capture source - aka printscreen

Other articles from Maxim Kartavenkov

 

02/16/2013 Update

 

H264Encoder requires:

  • BaseClassesNET.dll
  • H264Encoder.dll

 

I went with wrapper mode implementation. Check Maxim Kartavenkov forum for details.

H264 CUDA Encoder directshow filter example can be done entirely in BaseClassesNET.dll. Which might be done one day...

No error checking on CUDA capabilities.

Use with Nvidia GPU's only

H264.png

Examples:

  • Capture Video and H264 CUDA.vi
  • Render Media Stream.vi

 

Updates to Library:

  • Add H264 CUDA Filter.vi
  • Create AviMux.vi - overrite file option added
  • Enum Pin Media Type.vi
  • Enum PinMediaTypes.vi
  • Enum Pins.vi
  • Free PinInfo.vi
  • H264 CUDA Get Filter Options.vi
  • H264 CUDA Set Filter Options.vi
  • H264 Object Wrapper.vi
  • H264 Settings.ctl
  • Media Mode.ctl
  • Media State.ctl
  • MediaFormatType to String.vi
  • MediaSubType to String.vi
  • MediaType to String.vi
  • AMMediaType to String.vi
  • Picture Snap (32-bit RGB Image).vi - updated auto init
  • Picture Snap (DIB Image).vi - updated auto init
  • Set Sample Grabber.vi
  • WaveFormatEx.ctl
  • Capture.vi - updated to reflect above changes
  • Minor tweaks

 

02/07/2013 Update

 

 

Examples:

 

  • Acquire Video.vi
  • Acquire Audio.vi
  • Acquire Video plus Sample Grabber.vi
  • Capture Video.vi
  • Capture Video with Preview.vi
  • Capture Video with Preview and Sample Grabber.vi

Acquire Video.png

Acquire Audio.png

Acquire Video plus Sample Grabber.png

Capture Video.png

Capture Video with Preview.png

Capture Video with Preview and Sample Grabber.png

 

 

Updates to Library:

  • Release Object.vi
  • Init Capture Preview.vi
  • Configure Capture plus Preview.vi
  • Configure Video with Sample Grabber.vi
  • Media Control - StartStopPause.vi

 

 

 

Updates to Capture.vi

  • Preview in Capture Mode
  • Proper Objects release upon start/stop/exit

DS Capture.png

Update 10/08/2014:

DShow - JPEG dump example.

 

-Artur

 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Cepera
Member
Member
on

GriffinRU and everyone:

 

I've been using this library for a while with LV 2017 32-bit on WIn 10 and 11 64-bit, and it works very well. If anyone is interested in my proof-of-concept application, you are welcome to try it, it's called Airplane! SnV, and you can find it here.

 

Now I am trying to use this library with LV2023 Q3 64-bit, and so far, no luck. (I did replace DirectShowLib-2005.dll with its 64-bit version from SourceForge, but I did not find 64-bit replacements for DShowNET.dll and DirectX.Capture.dll. Not sure if they are being used though).

 

Has anyone ported these libraries to 64 bits? Any advice? Thanks!

anhduy92
Member
Member
on

I am sorry for re-up this old post but I don't know where to download these following DLL files:

  • BaseClassesNET.dll
  • H264Encoder.dll

codeproject.com can not be accessed anymore. I could not find any other sources for downloading.

 

Thank you so much for any help.

Contributors