From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

NI-IMAQdx Grab and Save to AVI

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.

    Hardware

  • Machine Vision

    Software

  • LabVIEW

    Driver

  • NI Vision Acquistion Software

Code and Documents

Attachment

Overview

This example demonstrates how to Grab and Save to an AVI format by using IMAQdx.

Description

You need to specify the frame rate that your camera will be acquiring at, as this will adjust the playback rate of the AVI video produced. As the while loop iterates, it adds every grabbed image to the AVI video as single frames, once your acquisition is complete the AVI file will playback at the pre-set frame rate.

Steps to Implement or Execute Code

  1. Select your camera from the Session In control on the Front Panel
  2. Set your desired Frames Per Second
  3. Run the VI
  4. Specify a path to save the AVI file
  5. Press stop when you are finished with your acquisition

Requirements

Software

LabVIEW 8.6 "or compatible"

NI Vision Acquisition Software 8.6 "or compatible"

Hardware

Compatible camera

Please see the following link to determine if your camera is supported

VI Snippet

AVIMAQ.png

Additional Information or References

**This document has been updated to meet the current required format for the NI Code Exchange. For more details visit this discussion thread**


Thank You
Eric Reid
National Instruments
Motion R&D

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

Comments
Todd S.
NI Employee (retired)
on

Great stuff!!!

Todd S.
LabVIEW Community Manager
National Instruments
Qia.sky
Member
Member
on

But how can I add sound or audio acquired by microphone to the avi file, then I can play the avi with sound?

http://www.vitst.com
Virry Test & Control
LabVIEW Certified Developer
Julio_HDT
Member
Member
on

Hi, its so cool. but any body knows how to record in others formats? because a video 1 min = 200 megabits

Contributors