NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
leiria
Posts: 5
0 Kudos

how to read mp4 video

Hello

 

I am start working with Labview 8.20 to do a project which have to contain some videos. I already have searched in this forum some information/code examples how to play mp4 videos (or other well-know formats like avi, mpeg...), but I didn't find nothing that I think it would help me.

Could someone give me some help or example codes that I can use?

 

Thanks 

Daniela

Active Participant
Thoric
Posts: 1,482
0 Kudos

Re: how to read mp4 video

Use the Windows Media Player ActiveX plugin to display media on your front panel.

It can be found in the functions palette under ".NET & ActiveX > Windows Media Player".

 

Thoric (CLA, CLED and LabVIEW Champion)
Member
leiria
Posts: 5
0 Kudos

Re: how to read mp4 video

Thanks for the tip!

But sincerely I already have found that plugin on Front Panel... 

What I would like to know more is how to play it, what are the fundamental tools to play it on front panel...

As I said above, after some searches I learned that it is necessary to connect a Invoke Node or others to the Media Player plugin, and I already did it but no results... I think it's necessary more connections mainly to the video I want to play, and I'm not achieving these functions!

 

Thanks again

Daniela

Knight of NI
Posts: 18,064
0 Kudos

Re: how to read mp4 video

Please perform a search. This has been asked before, and examples have been posted. If you have a specific problem after looking at the examples, then post back.

 

http://forums.ni.com/t5/forums/searchpage/tab/message?filter=location&location=Board%3A170&q=play+vi...

Member
leiria
Posts: 5
0 Kudos

Re: how to read mp4 video

Hi!

I've been awhile without working with LabView, but I've seen the link provided and found then a page that I thought it was what I was looking for. ..
However, I copied this code (which can be seen in annex) and place a sample video, but not getting results. Could be by incompatible versions of LabView? I'm using version 8.20.
I apologize if my question is basic, but as I had said, I started working with these types of programs recently and so I don't know much about it!
Thanks
Daniela
Knight of NI
Posts: 18,064
0 Kudos

Re: how to read mp4 video

If you are using the ActiveX container (which is what you need to use for the Windows Media Player control), then you should not use the Automation Open function, as this is automatic with the use of the container. 

 

What do you mean by "not getting results"? Does the video load? If you click on the play button does it play?

Member
leiria
Posts: 5
0 Kudos

Re: how to read mp4 video

As well as I put the program running and I click on the play button the video doesn't play.

So if I open the video normally in Windows Media Player and it plays, in LabView it should play too, right? 

Knight of NI
Posts: 18,064
0 Kudos

Re: how to read mp4 video

It should. If you have the actual file on disk. The code you have is a copy of the code from this Community Example. You did not change the name of the file that is being played. That example is looking for an MPEG file called "hst_1.mpg" that's in the same folder as the VI. I doubt very much that when Grant wrote the example he was able to look over 3 years into the future and determine that you would also have an MPEG file called "hst_1.mpg" in the same folder as your VI.

Active Participant
pcardinale
Posts: 345
0 Kudos

Re: how to read mp4 video

Try this.

 

Member
leiria
Posts: 5
0 Kudos

Re: how to read mp4 video

Yes, I have that mpeg file in the same folder as the VI because the Grant's example provides a ZIP file which contains the video "hst_1.mpg" so I saved it on my computer only for testing...But I have already changed to another video saved on my disk and it doesn't play on the same.