Mercurial Hosting > traffic-intelligence
view scripts/play-video.py @ 399:c389fae9689a
Added a class to read list of image instead of video. This is controlled by the use of the database-filename and folder-data parameters in the config file.
author | Jean-Philippe Jodoin <jpjodoin@gmail.com> |
---|---|
date | Mon, 29 Jul 2013 17:12:45 -0400 |
parents | 1917db662aa7 |
children | 3058e00887bc |
line wrap: on
line source
#! /usr/bin/env python import sys, argparse import cvutils parser = argparse.ArgumentParser(description='The program displays the video.') parser.add_argument('-i', dest = 'videoFilename', help = 'name of the video file', required = True) parser.add_argument('-f', dest = 'firstFrameNum', help = 'number of first frame number to display', default = 0, type = int) parser.add_argument('--fps', dest = 'frameRate', help = 'approximate frame rate to replay', type = float) parser.add_argument('-r', dest = 'rescale', help = 'rescaling factor for the displayed image', default = 1., type = float) args = parser.parse_args() firstFrameNum = 0 if args.firstFrameNum != None: firstFrameNum = args.firstFrameNum frameRate = -1 if args.frameRate != None: frameRate = args.frameRate cvutils.playVideo(args.videoFilename, firstFrameNum, frameRate, rescale = args.rescale)