Example Code

Play a Movie File with LabVIEW

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.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This example shows how to play a compatible movie file on a LabVIEW front panel.  It uses an ActiveX Container with a Windows Media Player object, and can play any file type that is compatible with Windows Media Player.

 

Description

This example shows how to play a compatible movie file on a LabVIEW front panel.  It uses an ActiveX Container with a Windows Media Player object, and can play any file type that is compatible with Windows Media Player.You must download the Event_Case_Selector.ctl and save it in the same location as the VI in order to successfully run the VI.

 

Requirements

  • LabVIEW 2012( (or compatible)

 

Steps to Implement or Execute Code

  1. Run the vi.
  2. Browse to a file that is compatible with Windows Media Player
  3. Watch movie clip, using front panel buttons or Windows Media Player buttons for control.

 

Note:  Sometimes when the VI is launched it will immediately begin playing a video file without running the VI at all.  This is expected behavior, and is due to LabVIEW initializing the ActiveX container from the GAC.

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

 

Patrick
CLA

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

Comments
eduardotovar97
Member
Member
on

Great VI thanks it was very useful.

Jisuk
Member
Member
on

First of all, Thanks for this example.

I'm traying to play the movie in full screen but there is an error when I use full screen property node.

How can I make it full?

Thank you in advance,

yaelha
Member
Member
on

Hi Jisuk,

I have the same problem. Is there a solution?

Best,

Lilah

Stephen1995
Member
Member
on

Is there a way to jump to different section on the video file?

What I want to do is to analyse a data stream and when something happens in the data stream I want to record the time at which point it happens and then automatically start the video at that time.

Thanks in advance

Stephen

I found a solution. If anyone is interested you can simply write the time you wish to start the video to the current position property node and use the event structure and an additional button or whatever to control when this executes.

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
Rinks
Member
Member
on

 is there any way to convert a video file into string in labview? please let me know if there is such methodology or program available.

Mario74
Member
Member
on

Good morning,

When I run the VI the video takes on a too big size, even if I had previously resized it. How can I make it stay of a reduced size?

Thanks