vlc media player invoking

10 次查看(过去 30 天)
suresh duppad
suresh duppad 2012-7-5
when iam invoking the vlc media player it just showing the logo of vlc nothing else is happening
  4 个评论
suresh duppad
suresh duppad 2012-7-5
fig1=figure;
vlc=actxcontrol('VideoLAN.VLCPlugin.2',[50 50 700 500],fig1);
disp(vlc.versionInfo());
vlc.BaseURL = 'file//e:/Yellelama.mp3'; %%%%write ur file location over here
vlc.playlist.add('e:/Yellelama.mp3'); %%%%write ur file location over here
vlc.playlist.items.get;
vlc.playlist.play();
iam invoking like this in matlab
Mubin Bagwan
Mubin Bagwan 2013-5-8
function [] = vlc (filename)
%% plays a video file using Video Lan Client % Lee White % 7.13.2011
% path to vlc - system dependent vlc_path = 'C:\Program Files\VideoLAN\VLC\vlc.exe';
% sends the string as formatted as a dos command % The ampersand '&' forces the command to run in its own command window % The double quotations marks '"' accomodate any spaces ' ' that may be in % the file paths %filename='C:\Users\Public\Videos\Sample Videos\Wildlife.wmv';
dos(['"' vlc_path '" "' filename '" &']);
end

请先登录,再进行评论。

回答(1 个)

Jeffrey Girard
Jeffrey Girard 2014-12-3
I assume you are invoking VLC through ActiveX. You need to send it a video file in the MRL format in order to have it play correctly. See the third line of code for an example of how to load a local file.
f = figure('Position',[0 0 800 600]);
a=actxcontrol('VideoLAN.VLCPlugin.2',[0,0,800,600]);
a.playlist.add('file://localhost/C:/example.avi');
a.playlist.play();
  1 个评论
Tobias Piechowiak
Hmmm... tried this with a *.mp4 file. The embedded VLC is busy but the screen stays black... no error message though. Is there a problem with .mp4 files? Or the codec? Any other thoughts?
Cheers

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by