This repository contains OpenCV python implementation of a motion-based video synopsis. This application summarizes events (movements) in a video (e.g. video1.avi, video2.avi) and outputs a short video displaying events in a chronological order (via time tags) (e.g. out_vid1.avi, out_vid2.avi). This program, in fact, extracts the static background of the video (e.g. BG1.jpg, BG2.jpg) and traces moving objects in the foreground (by label assignment and matching). Moreover, it detects the colors of the objects, calculates the speed of moving objects, counts the number of objects moving up and down, and also generates an image showing principal commuting tracks (directions) (e.g. img_lines1.jpg, img_lines2.jpg).