VideoReader error message - Unable to read the file.o

5 views (last 30 days)
Hello everyone,
Running Matlab R2013a on a CentOS server.
I am trying to read a specific frame from the mp4 file and getting the following error message:
>>obj = VideoReader('image.mp4');
>>image3 = read(obj, 225);
Error using VideoReader/read (line 145)
Unable to read the file.o
The same frame can be successfully read on my MacBook with MatLab R2013b.
If I run
image3 = read(obj, [175 250) - no error message.
I've tried running strace, but getting no output for read command.
Also, the following script successfully creates all 450 frames from the file in JPG format (including frame 225).
%vid = video which needs to be extracted
vid = 'image.mp4';
readerobj = VideoReader(vid);
vidFrames = read(readerobj);
%get number of frames
numFrames = get(readerobj, 'numberOfFrames');
for k = 1 : numFrames
mov(k).cdata = vidFrames(:,:,:,k);
mov(k).colormap = [];
%imshow(mov(k).cdata);
imagename=strcat(int2str(k), '.jpg');
%save inside output folder
imwrite(mov(k).cdata, strcat('output\frame-',imagename));
end
Thank you for your help,
Asya

Answers (0)

Community Treasure Hunt

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

Start Hunting!