Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Playing movies in GUI Part 4: Problems with activex

179 views
Skip to first unread message

Eric

unread,
Jun 9, 2011, 12:53:05 PM6/9/11
to
Hey everybody!

So I'm still on my quest to be able to play videos is my GUI. Thanks to Steven_Lord, I found a player that is already built into a GUIDE GUI:

http://www.mathworks.com/matlabcentral/fileexchange/3670-activexcontrol-for-video-and-audio

Now presumably, I can use this GUI and just add my other buttons/features to it. My only problem now is that I am getting this error when I run it:

??? Error using ==> feval
Input PROGID does not represent an Activex control.
If this PROGID used to work before, please check vendor's
documentation for equivalent activex control progid.

Error in ==> actxcontrol>createControl at 240
ctrl = feval(comstr, 'control', position, parent, '', filename, hwnd, licensekey, false,parent_string);

Error in ==> actxcontrol at 212
hControl = createControl;

Error in ==> act_ive_gui>act_ive_gui_OpeningFcn at 126
MovieControl = actxcontrol('AMOVIE.ActiveMovieControl.2',pos);

Error in ==> gui_mainfcn at 221
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});

Error in ==> act_ive_gui at 99
gui_mainfcn(gui_State, varargin{:});

Can anyone help me with this one? I really appreciate the support of this community.

matt dash

unread,
Jun 9, 2011, 2:50:22 PM6/9/11
to
"Eric " <ericjay...@gmail.com> wrote in message <isqtph$3ob$1...@newscl01ah.mathworks.com>...

You don't have the required activex control installed on your computer. Did you install it from the link on the FEX page? If so, did you restart matlab afterward? Be warned that there's a good chance the activex control won't work on 64-bit matlab, if that is relevant to you.

Eric

unread,
Jun 9, 2011, 2:56:04 PM6/9/11
to
"Eric " <ericjay...@gmail.com> wrote in message <isqtph$3ob$1...@newscl01ah.mathworks.com>...

Actually, I solved the problem myself (by updating windows and downloading the latest internet explorer) .

Only to discover another error (of course):

??? Attempt to reference field of non-structure array.

Error in ==> act_ive_gui>ope_n_fil_e_Callback at 168
mp = handles.MovieControl.MediaPlayer;

Error in ==> gui_mainfcn at 96
feval(varargin{:});

Error in ==> act_ive_gui at 99
gui_mainfcn(gui_State, varargin{:});

Error in ==> @(hObject,eventdata)act_ive_gui('ope_n_fil_e_Callback',hObject,eventdata,guidata(hObject))


??? Error while evaluating uicontrol Callback

So the Movie player GUI will launch, but whenever I try to play a video I get that error.

Can anyone assist?

Eric

unread,
Jun 9, 2011, 3:02:04 PM6/9/11
to
Actually I think Im confusing myself here. The player came with 2 files: a .m file and .fig file. When I try to run the .m file, nothing happens and I get the activex error. When I run the .fig file, the GUI launches but gives the unstructured array error when I attempt to play a video

I must be doing something wrong as far as thees files are concerned.

matt dash

unread,
Jun 9, 2011, 3:16:19 PM6/9/11
to
"Eric " <ericjay...@gmail.com> wrote in message <isr5bc$qtk$1...@newscl01ah.mathworks.com>...

> Actually I think Im confusing myself here. The player came with 2 files: a .m file and .fig file. When I try to run the .m file, nothing happens and I get the activex error. When I run the .fig file, the GUI launches but gives the unstructured array error when I attempt to play a video
>
> I must be doing something wrong as far as thees files are concerned.


You're supposed to run the m file, not the fig file. The fig file error appears to be because the m file was supposed to create the control and fill that variable (handles.MovieControl.MediaPlayer), so when you dont run the m file you dont get the activexcontrol error, but you get a new error later.

You might want to just try to solve this yourself using a newer activexcontrol. I noticed that after installing VLC player (and restarting matlab) i get an activexcontrol for it, and sure enough if I run just these lines...

f=figure
a=actxcontrol('VideoLAN.VLCPlugin.1',[20 20 300 300])
a.addTarget('C:\...\near_science_med.avi',[],0,2)
a.play

... it plays the video! I'm sure with some googling you can find a player appropriate for your application. Try checking actxcontrollist and look for something that sounds like it plays videos, you might already have one.

Eric

unread,
Jun 10, 2011, 10:15:04 AM6/10/11
to
"matt dash" wrote in message <isr663$27$1...@newscl01ah.mathworks.com>...

Thank you for the lesson.

So let me see if I am understanding you correctly:
Download newer version of some media player(this will automatically upgrade my activex). which will make this player that I downloaded work?

And what is this "actxcontrolist"? And where can I find it?

matt dash

unread,
Jun 10, 2011, 11:44:04 AM6/10/11
to
"Eric " <ericjay...@gmail.com> wrote in message <ist8t8$kfa$1...@newscl01ah.mathworks.com>...

actxcontrollist is a matlab function that lists all of your activexcontrols. The first columns is the name of the control, but the second column is the important one... it tells you what you type to create the control (in the example above, 'VideoLAN.VLCPlugin.1'). I would start by checking that list to see what you already have. In my list in addition to the VLC player i have one for windows media player called WMPlayer.OCX.7.

So if you see something there that looks like i plays videos you might not need to install anything, otherwise try searching for a video player that has an activexcontrol (like vlc player). Once you find it, make one using a=actxcontrol('...') where ... is that string in the second column of actxcontrollist.

Then you can use methodsview(a) to see everything that it can do. You'll presumably see things like "play" "pause" and something to load a file. For the VLC player this is addTarget. methodsview will also give you some hints as to what kind of syntax each method requires, but you might also need to do some googling for documentation, or some guessing. A lot of activexcontrols have little to no documentation available.

If your movies will play in windows media player, the WMPlayer.OCX.7 might be the best bet, since it is well documented and presumably pretty stable. Do they?

0 new messages