summaryrefslogtreecommitdiffstats
path: root/Demo/sgi/video/Vrecb.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-02-15 17:33:36 (GMT)
committerGuido van Rossum <guido@python.org>1993-02-15 17:33:36 (GMT)
commit852cc22bd3864a3beed45b97fc9a9fd439010e90 (patch)
treef2b57f70bd9862e88a12a2c84add86d20b5274dc /Demo/sgi/video/Vrecb.py
parent1104a8562d38c962d58791d6da7dcd11cca2da76 (diff)
downloadcpython-852cc22bd3864a3beed45b97fc9a9fd439010e90.zip
cpython-852cc22bd3864a3beed45b97fc9a9fd439010e90.tar.gz
cpython-852cc22bd3864a3beed45b97fc9a9fd439010e90.tar.bz2
Vrec.py: don't print Ids if no frames are captured.
Vrecb.py: use the new interfaces to imageop (fix -M, -m, -g options).
Diffstat (limited to 'Demo/sgi/video/Vrecb.py')
-rwxr-xr-xDemo/sgi/video/Vrecb.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/Demo/sgi/video/Vrecb.py b/Demo/sgi/video/Vrecb.py
index 84cd5cc..2dcbe8e 100755
--- a/Demo/sgi/video/Vrecb.py
+++ b/Demo/sgi/video/Vrecb.py
@@ -245,7 +245,11 @@ def record(v, info, filename, mono, grey, greybits, monotreshold, fields):
#
# Construct header and write it
#
- vout = VFile.VoutFile().init(filename)
+ try:
+ vout = VFile.VoutFile().init(filename)
+ except IOError, msg:
+ print filename, ':', msg
+ sys.exit(1)
if mono:
vout.format = 'mono'
elif grey and greybits == 8:
@@ -291,13 +295,15 @@ def record(v, info, filename, mono, grey, greybits, monotreshold, fields):
start = frameno*fieldsize
field = data[start:start+fieldsize]
if convertor:
- field = convertor(field, x, y)
+ field = convertor(field, len(field), 1)
elif mono and monotreshold >= 0:
- field = imageop.grey2mono(field, x, y, \
- 1, monotreshold)
+ field = imageop.grey2mono( \
+ field, len(field), 1, monotreshold)
elif mono:
- field = imageop.dither2mono(field, x, y)
+ field = imageop.dither2mono( \
+ field, len(field), 1)
vout.writeframe(int(realframeno*tpf), field, None)
+ realframeno = realframeno + 1
print 'Skipped',nskipped,'duplicate frames'
vout.close()