LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I play MPEG-2 video on a CVI 6.0 panel?

NI has an example called "Controlling Windows Media Player from LabWindows/CVI" that plays these videos just fine in CVI 7.0.

But in CVI 6.0, that example gives me a E_NOINTERFACE error (No such interface supported) on the MediaPlayer_IMediaPlayer2SetFileName() function. Is there any way I can play an MPEG-2 video (.mpg file) on a CVI 6.0 panel?
0 Kudos
Message 1 of 7
(4,669 Views)
mpeg-2 decoding should be copyrighted. You should install a third part
software that add a directshow filter for mpeg-2 decoding. As powerdvd or
similar. Not all software dvd player add the directshow filter.

Then you should be able to use the example "Controlling Windows Media Player
from LabWindows/CVI"

"bmihura" wrote in message
news:5065000000080000000EE90000-1079395200000@exchange.ni.com...
> NI has an example called "Controlling Windows Media Player from
> LabWindows/CVI" that plays these videos just fine in CVI 7.0.
>
> But in CVI 6.0, that example gives me a E_NOINTERFACE error (No such
> interface supported) on the MediaPlayer_IMediaPlayer2SetFileName()
> function. Is there any way I can play an MPEG-2 video (.mpg file) on
> a CVI 6.0 panel
?
0 Kudos
Message 2 of 7
(4,669 Views)
I've tried running third party software in a separate window with LaunchExecutable() and LaunchExecutableEx(), but then CVI loses control over the video.

The "third party software" approach cannot close the video once it starts nor check its status, even with LaunchExecutableEx(), which does not return the handle it's supposed to.

Any other ideas?
0 Kudos
Message 3 of 7
(4,669 Views)
Use ActiveX rather than LaunchExecutable. You could use either ActiveX Automation (launching it in a seperate window) or an embedded ActiveX control. Either way will allow you to retain control of the video after launching it. There are examples which ship with CVI on doing it with Media Player.

Regards,
Ryan K.
0 Kudos
Message 4 of 7
(4,669 Views)
I prefer ActiveX. That NI example I cited at the beginning of this thread uses ActiveX and Windows Media Player.

It works fine in CVI 7.0 but not in CVI 6.0-- and I have to use CVI 6.0 on my project 😞

Is there another ActiveX component somewhere I could try in CVI 6.0 that plays MGEG-2 video? Or some other clever way to play the video on a CVI panel?
0 Kudos
Message 5 of 7
(4,669 Views)
Hrm, I don't have 6.0 on this computer to try it out, but a couple of options:

1. If I remember right, the example uses an embedded ActiveX control, you might try using Media Player through Automation instead of an embedded control. This would involve a little more work, but tends to have fewer compatibility issues, since media player would be running in it's own window (the best way to start here would be to use the ActiveX controller wizard to generate a function panel for the Media Player ActiveX server).

2. You can just search the internet for other players which might work, running a search for activex and mpeg2 players through google turned up quite a few results. Unfortunately, most of them probably aren't free.

Does
the media player example not work at all for you, or does it just not play mpeg-2 files (i.e. can it play mpeg-1 or other movie files)?

Regards,
Ryan K.
0 Kudos
Message 6 of 7
(4,669 Views)
I googled around and found an MPEG-1 file, still no luck.

I was able to use the ActiveX automation controller wizard (Tools >> Create ActiveX Controller) to create a new .fp file for the latest Windows Media Player. The same error happened.

It looks like I'll have to search the Internet for a player that will work in LabWindows/CVI 6.0-- but at least you showed me how to create a CVI interface in your step 1, thanks.
0 Kudos
Message 7 of 7
(4,669 Views)