Matlab mmreader issue in Ubuntu 12.04

7 views (last 30 days)
Hari
Hari on 20 Jul 2012
Commented: Walter Roberson on 12 Mar 2018
I have installed Ubuntu 12.04 and run tried to extract the frames from a video. For that, I used the following code
clear all;
clc;
close all;
xyloObj = mmreader('/home/user/Work/Person01.mpg');
nFrames = xyloObj.NumberOfFrames;
vidHeight = xyloObj.Height;
vidWidth = xyloObj.Width;
% Preallocate movie structure.
mov(1:nFrames) = ...
struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),...
'colormap', []);
% Read one frame at a time.
for k = 1 : nFrames
mov(k).cdata = read(xyloObj, k);
end
% Size a figure based on the video's width and height.
hf = figure;
set(hf, 'position', [150 150 vidWidth vidHeight])
% Play back the movie once at the video's frame rate.
movie(hf, mov, 1, xyloObj.FrameRate);
But, it giving the following error
??? Could not seek to frame. Frame accurate seeking is not supported for this file on the current platform.
Error in ==> mmreader.read at 74 videoFrames = read(getImpl(obj), index);
Error in ==> video_play2 at 19 mov(k).cdata = read(xyloObj, k);
What will be the issue ? How can I solve this problem ?

Answers (1)

Walter Roberson
Walter Roberson on 20 Jul 2012
Read the entire movie instead.
mov = read(xyloObj);
  3 Comments
Helga  Soundarya
Helga Soundarya on 12 Mar 2018
Edited: Walter Roberson on 12 Mar 2018
"Could not seek to frame. Frame accurate seeking is not supported for this file on the current platform ",
this error occurs due to some updates in windows. If we uninstall the update, then this command will work smoothly
Walter Roberson
Walter Roberson on 12 Mar 2018
Thanks for the information Helga.
The original question has to do with Linux which handles reading a different way.
When I look at the error now my guess for the original question would be that the person did not have gstreamer 0.1 installed. Linux versions stopped installing that old version about the time of the question.

Sign in to comment.

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!