How to play movine backward in matlab?

Hi all
I want to play video frames backwardly in matlab can any one help in this regards
My code is
source='LID.AVI';
vidobj=VideoReader(source);
frames=vidobj.NumberofFrames
for f=1:frames
thisframe=read(vidobj,f);
figure(1);imshow(thisframe);
end
This plays the video normally but when I want to change the loop
for f=frame:1
thisframe=read(vidobj,f);
figure(1);imshow(thisframe);
end
it does not work.any help is appreciated

Answers (1)

for f=frame:-1:1

4 Comments

and how can I simultaneously play two frames.I mean backward video as well as forward video
for f1:1:frames
thisframe=read(vidobj,f1);
for f2=frames:-1:1
itframe=read(vidobj,f2);
end
end
for f1 = 1 : frames
thisframe = read(vidobj, f1);
otherframe = read(vidobj, frames - f1 + 1);
%display thisframe at this point
%display otherframe at this point
end
Sir I want video frames should play in reverse ..plz help me
for f=frame:-1:1
thisframe=read(vidobj,f);
figure(1);imshow(thisframe);
end

Sign in to comment.

Categories

Asked:

on 15 Oct 2013

Commented:

on 30 Sep 2016

Community Treasure Hunt

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

Start Hunting!