Mercurial > hg > nsaunier > traffic-intelligence
comparison scripts/play-video.py @ 334:1d90e9080cb2
moved python scripts to the scripts directory
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Fri, 14 Jun 2013 10:34:11 -0400 |
| parents | python/play-video.py@ca9131968bce |
| children | 1917db662aa7 |
comparison
equal
deleted
inserted
replaced
| 333:c9201f6b143a | 334:1d90e9080cb2 |
|---|---|
| 1 #! /usr/bin/env python | |
| 2 | |
| 3 import sys,getopt | |
| 4 import cvutils | |
| 5 | |
| 6 options, args = getopt.getopt(sys.argv[1:], 'hi:f:',['help', 'fps=']) | |
| 7 options = dict(options) | |
| 8 print options | |
| 9 | |
| 10 if '--help' in options.keys() or '-h' in options.keys() or len(sys.argv) == 1: | |
| 11 print('Usage: '+sys.argv[0]+' --help|-h -i video-filename [-f first_frame] [--fps frame_rate]') | |
| 12 sys.exit() | |
| 13 | |
| 14 firstFrameNum = 0 | |
| 15 if '-f' in options.keys(): | |
| 16 firstFrameNum = int(options['-f']) | |
| 17 | |
| 18 frameRate = -1 | |
| 19 if '--fps' in options.keys(): | |
| 20 frameRate = int(options['--fps']) | |
| 21 | |
| 22 cvutils.playVideo(options['-i'], firstFrameNum, frameRate) |
