Products and Environment
This section reflects the products and operating system used to create the example.
To download NI software, including the products shown below, visit ni.com/downloads.
Code and Documents
Attachment
Download All
Virus scan in progress. Please wait to download attachments.
Description
Description-Separate-1Introduction
This LabVIEW snippet shows how to use a third party ActiveX component to easily capture raw/synced audio and video without the need for using imaging/camera control software, such as Vision or IMAQ.
Purpose and Functionality
The main function of this program is to show others how to use ActiveX components in the LabVIEW environment to perform real-time audio and video capture. This was accomplished by using a PCMCIA Cardbus video capture card, specifically, an Imperx VCE-PRO-F (flat) (www.imperx.com/frame-grabbers/vce-pro) along with the VideoCapX (http://www.fathsoft.com/videocapx.html) multimedia ActiveX component called videocap.oxc.
How to use the code
- The ActiveX component videocap.oxc can be found by downloading a 30 day trial version of VideoCapX found from this website: http://www.fathsoft.com/videocapx.html. You will want to download the trial version so that you can write and try out your LabVIEW application before purchasing the Lite version of the software, which is $99.
- Open a new VI and place an ActiveX container on the front panel. The steps to do this are listed on this webpage: https://www.ni.com/docs/en-US/bundle/labview/page/creating-new-controls-in-an-activex-container.html.
- Place an Automation Open function onto the block diagram and wire the ActiveX control to the Automation Refnum input along with the local reference location of the ActiveX control.
- Refer to the Audio and Video ActiveX snippet below. Add a Property Node to the block diagram and wire it to the Automation Refnum output. When you will now be able to see and select all of the available properties of the ActiveX component. Right click on the Property Node and select the CapFileName property and specify where you would like to save the avi or wmv file.
- Next, in order to connect to the video device, add another Property Node to the block panel and set the Connected property to True. Next, define the video capture rate by using the CaptureRate property. If you would also like to capture audio, set the CaptureAudio property to True. You can then preview the video in real-time by setting Preview to True.
- If you would like to have video text to display date, time, month, or a title/caption overlayed onto the video, select the SetTextOverlay property and expand it by selecting the edge of the Property Node and dragging it down. For this snippet, I used a time stamp to display the date and time as the Caption. All properties and methods are listed in the VideoCapX.pdf file below.
- To start audio and video capture, add an Invoke Node to the block panel and select the method StartCapture. You can put an indicator onto the front panel to show that the video is recording by setting the IsCapturing property to True.
- The snippet does not show it, but you can place this into a for or while loop and use the StopCapture method to end the capture at a specific time.
Snippet attached below

Description-Separate-2
Brenda Novar
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.