Activex vlc plugin: Need help retrieving duration of video
4 ビュー (過去 30 日間)
古いコメントを表示
Hey,
I am building a non-guide gui with an activex vlc player plugin. I am trying to sync the slider to the current time of the videofile being played. To do this I need to know the duration of the video file but cannot seem to get this information from the built in activex controls. I have been using the mmfileinfo function to do this. Is there a way for me to do this without having to resort to mmfileinfo? A sample from my code is shown below.
% video code
fig = figure('position', [100 100 500 500]);
set(fig,'Position',[50, 250, 500, 500],'Color',[0.5 0.5 0.5],'DoubleBuffer', 'on','Tool','none');
vlc1 = actxcontrol('VideoLAN.VLCPlugin.2', [0 100 500 400], fig); % creates a vlc active x pnel on the gui window
vlc1.playlist.add('Bicycle.wmv');
vlc1.AutoLoop = 1;
vlc1.AutoPlay = 1;
vlc1.playlist.get_length(); % should return file duration instead I get the following message - No appropriate method, property, or field get_length for class Interface.VideoLAN_VLC_ActiveX_Plugin.IVLCPlaylist.
vlc1.input.length; % should also return file duration, i get an error message 'Invoke Error, Dispatch Exception: Unspecified error'
I am using r2011b.
Thanks in advance!
1 件のコメント
Arjun Nagendran
2019 年 9 月 19 日
Coming across this issue nearly 8 years later, but calling play() before querying the length seems like one way to solve the issue. Code snippet below:
handles.vlc.playlist.play();
pause(0.1);
handles.vlc.playlist.togglePause();
videolength = handles.vlc.input.length;
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で ActiveX についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!