Activex vlc plugin: Need help retrieving duration of video
2 次查看(过去 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!