Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

about mmreader'sproperty thanks!

Asked by Pan on 16 Jul 2012

i want to ask about mmreader that could control the "fps" ???!!! please tell me! thanks~

0 Comments

Pan

Products

No products are associated with this question.

1 Answer

Answer by Andreas Goser on 16 Jul 2012
Edited by Andreas Goser on 16 Jul 2012
xyloObj = mmreader('xylophone.mpg', 'Tag', 'My reader object');
get(xyloObj)
xyloObj.FrameRate

Note: MMREADER will be removed in a future release. Use VideoReader instead. The mmreader class has been renamed VideoReader.

3 Comments

Pan on 16 Jul 2012

hi,may I ask you a question .

beacuse my part code is that

function f1() clear all;

obj1 = mmreader('book750.avi'); vid1 = read(obj1); frame1 = 1; f4 = 1; hst1=0;

h = figure('Name','Video ', 'NumberTitle','off','Color',[1,1,1],'Toolbar','none','Visible','on', 'Position',[30 40 1000 700],... 'Resize','on','menu','none');

hstat1 = uicontrol('unit','pixel','style','checkbox','value',0,'position',... [50 420 25 25],'units','normalized');

hplay1 = uicontrol('unit','pixel','style','pushbutton','string','藥罐_PLAY',... 'position',[50 420 70 40],'backgroundColor',[0.3,0.7,1],'units','normalized','callback',{@play1_callback});

hstop1 = uicontrol('unit','pixel','style','pushbutton','string','藥罐_STOP',... 'position',[50 320 70 40],'backgroundColor',[0.2,1,0],'units','normalized','callback',@stop1_callback);

hexit = uicontrol('unit','pixel','style','pushbutton','string','EXIT',... 'position',[50 220 70 40],'backgroundColor',[1,0,0],'units','normalized','callback',@exit_callback);

while (1)

if hst1==1 subplot(1,1,1); vid(1,'FrameRate'); imshow(vid1(:,:,:,frame1)); title('keyframe video'); if frame1 < size(vid1,4) frame1 = frame1+1; else frame1 = 1; end

end

drawnow; if f4 ==2 break; % else f4 = f4+1; end end

function play1_callback(hObject0,eventdata0) set(hstat1,'value',1); hst1=1; set(hplay1 ,'backgroundColor',[1,1,0],'string','藥罐_播放中'); %close h1; end

function stop1_callback(hObject,eventdata) set(hstat1,'value',0); hst1=0; set(hplay1 ,'backgroundColor',[0.3,0.7,1],'string','藥罐_PLAY'); frame1 end

function exit_callback(hObject,eventdata) f4=2; stop1_callback; close gcf; end

end

Pan on 16 Jul 2012

I didn't use that

xyloObj = mmreader('xylophone.mpg', 'Tag', 'My reader object'); get(xyloObj)

so I also didn't know that controling "FrameRate"

Pan on 16 Jul 2012

Thank~~ Thaank~

Andreas Goser

Contact us