Calling Read(obj) on a video object crashes matlab

3 views (last 30 days)
Hello, I have been hacking away at this problem for a while and cannot seem to get it. I am using video reader to read in a .mpg video file and it seems that the file has a variable frame rate. I want to find out the frames by using read(video, inf) but whenever I call read() matlab crashes with an access violation error. Is there something I am doing wrong. I will post my code below. Thanks in advance.
Calling xldat = read(video); in the code causes matlab to crash.
function()
FileSpec = {'*.mpg'}; %'*.avi' FileSpec
[FileName,PathName] = uigetfile('k:\MP_ROOT\101PNV01\*.mpg','Select the Video File you wish to analyze');
file_path = strcat(PathName, FileName);
fprintf('hello video reader %s %s', FileName, PathName);
%set video sign
video = VideoReader(file_path);
get(video);
assignin('base','file_path',file_path);
assignin('base','video',video);
xldat = read(video);
NumFrames = size(xldat);
fs = uint16(NumFrames(1,4));
frames = read(video, [1 fs]);

Answers (0)

Categories

Find more on Printing and Saving in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!