clear all;
clc;
%vr = videoReader('../hv30-pf30-clip2.mpg');
vr = videoReader('../hg10-pf24-clip2.mts');
%vr = videoReader('../30pf-hv30-2008_03_12-16_58_29.m2.0000.mpg')
%vr = videoReader('../hg10-24pf.MTS')
%vr = videoReader('../hg10-24pf.ts')
%vr = videoReader('../hg10-24pf_remux.mp4', 'ffmpegDirect');
%vr = videoReader('../hg10-24pf_video1.mpv');
%vr = videoReader('../hg10-24pf_remux.mp4');

disp(vr);

% try to avoid rescaling
info = getinfo(vr);
figure(1);
set(1,'Position',[100,25,info.width,info.height]);
subplot('Position',[0 0 1 1]);

for i=20:inf
  iWithoutDups = i;
  assert(logical(seek(vr,iWithoutDups)));
  imshow(getframe(vr)); drawnow;
  set(gcf,'Name', sprintf('frame %d',i), 'NumberTitle','off'); 
  display(vr);
  pause;
end
