VideoReader error message - Unable to read the file.o
5 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!