function demo_video (trackers, videos, gt, r, demo_vid,main_trackers, frame_no_col)

if (nargin < 7)
    frame_no_col = 'y';
end

fr_rate = 30;
load('cc');

for vid = 1:length(demo_vid)
    vn = -1;
    for i = 1:length(videos)
        if (strcmp(videos{i},demo_vid{vid}))
            vn = i;
            break
        end
    end
    if (vn == -1)
        disp(['Video ' demo_vid{vid} ' not found'])
        
    else
        disp(['Saving video #' num2str(vn) ': ' demo_vid{vid}])
        
        writerObj = VideoWriter( ['./vis/res_' demo_vid{vid} '.avi']); % VID
        writerObj.FrameRate = fr_rate; % VID
        open(writerObj); % VID
        
        img_path = ['D:\\Data\\TB-100-all\\' demo_vid{vid} '\\' demo_vid{vid} '\\img\\'];
        
        fh = figure;
        for fr = 1:min(r{vn,1}.seq_len,100) %%%%% CUT the video after 100 frames
            
            try
                img = imread(sprintf('%s%04d.jpg',img_path,fr));
            catch
                img = imread(sprintf('%s%05d.jpg',img_path,fr));
            end
            imshow(img);
            hold on
            
            set(gcf,'Color','w');
            
            for tr = 1:length(trackers)
                box = r{vn,tr}.res(fr,:);
                if (all(box > 0))
                    rectangle('Position',box,'EdgeColor',[0.7,0.7,0.7],'LineWidth',2);
                end
            end
            
            rectangle('Position',gt{vn}(fr,:),'EdgeColor','y','LineWidth',3,'LineStyle',':');
            
            for i = 1:length(main_trackers)
                tr = main_trackers(i);
                box = r{vn,tr}.res(fr,:);
                if (all(box > 0))
                    rectangle('Position',box,'EdgeColor',cc(i,:),'LineWidth',4);
                end
            end
            
            
            set(gca,'Position',[0,0,1,1]);
            text(20,20,['Frame: ' num2str(fr)],'FontSize',28,'Color',frame_no_col );
            drawnow;
            frame = getframe(fh); % VID
            writeVideo(writerObj,frame); % VID
            
        end
        
        close(writerObj); % VID
    end

end
end