Mercurial Hosting > traffic-intelligence
diff scripts/play-video.py @ 821:26daf35180ad
finished modification and demo script to replay synchronized video (with same frame rate)
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 22 Jun 2016 16:36:12 -0400 |
parents | e73e7b644428 |
children | 933670761a57 |
line wrap: on
line diff
--- a/scripts/play-video.py Wed Jun 22 15:23:20 2016 -0400 +++ b/scripts/play-video.py Wed Jun 22 16:36:12 2016 -0400 @@ -7,7 +7,7 @@ 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('--fps', dest = 'frameRate', help = 'approximate frame rate to replay', default = -1, type = float) parser.add_argument('-r', dest = 'rescale', help = 'rescaling factor for the displayed image', default = 1., type = float) parser.add_argument('-s', dest = 'step', help = 'display every s image', default = 1, type = int) @@ -17,8 +17,4 @@ if args.firstFrameNum is not None: firstFrameNum = args.firstFrameNum -frameRate = -1 -if args.frameRate is not None: - frameRate = args.frameRate - -cvutils.playVideo([args.videoFilename], None, firstFrameNum, frameRate, rescale = args.rescale, step = args.step) +cvutils.playVideo([args.videoFilename], None, [firstFrameNum], args.frameRate, rescale = args.rescale, step = args.step)