%[filename, pathname] = uigetfile({'*.*','Any file'},'Pick a video file');

%Open an handle to the video file
[av_hdl, av_inf] = mplayerOpen([pathname, filename]);

if length(av_hdl) > 0;
		for frame_num = 1:av_inf.NumFrames/10:av_inf.NumFrames;
			
			%Reads frame_num from the video
			pixmap = mplayerReadMex(av_hdl, frame_num);
			imshow(reshape(pixmap/255,[av_inf.Height,av_inf.Width,3]));
			title(sprintf('frame number %d of %d',floor(frame_num), av_inf.NumFrames));
			fprintf('Press any key\n');
			pause;

		end

		%Cleanup
		mplayerCloseMex(av_hdl);
end
