diff options
author | Guido van Rossum <guido@python.org> | 1992-09-07 09:35:23 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-09-07 09:35:23 (GMT) |
commit | e1783324ab1a9d201c0ce7347861e528355dffd8 (patch) | |
tree | 82c4361d7e3a2644d3795328b3e5ebcd625a6937 /Demo/sgi | |
parent | 4045c2fa5b8d4c22b51abbb28bbe15abe4cadced (diff) | |
download | cpython-e1783324ab1a9d201c0ce7347861e528355dffd8.zip cpython-e1783324ab1a9d201c0ce7347861e528355dffd8.tar.gz cpython-e1783324ab1a9d201c0ce7347861e528355dffd8.tar.bz2 |
Adapted the world to the new VFile.py. Fixed bugs in Vplay.py:
missing -n in help(), bogus frame skipping; and added patch for
weird time jumps. Removed colorsys.py (now in std library).
Fixed "sys.write" error in vcopy.py. Restructured README.
Diffstat (limited to 'Demo/sgi')
-rw-r--r-- | Demo/sgi/video/README | 98 | ||||
-rwxr-xr-x | Demo/sgi/video/Vinfo.py | 8 | ||||
-rwxr-xr-x | Demo/sgi/video/Vplay.py | 18 | ||||
-rwxr-xr-x | Demo/sgi/video/vcopy.py | 2 |
4 files changed, 73 insertions, 53 deletions
diff --git a/Demo/sgi/video/README b/Demo/sgi/video/README index 85855a9..335a108 100644 --- a/Demo/sgi/video/README +++ b/Demo/sgi/video/README @@ -26,7 +26,10 @@ a version of the Irix video library that supported capturing PAL format (in August 1992), Sjoerd added an interface to the video library to Python (sv) and Guido wrote Vrec.py (based upon a still frame grabber by Sjoerd, in turn based upon SGI demo code in C) -to record a movie using it. +to record a movie using it. Vrec was soon followed by modernized +versions of the other programs (Vinfo, Vplay, Vtime) and an +interactive editor (Vedit). Finally, VFile was rewritten for more +modularity, functionality and robustness. Guido van Rossum Jack Jansen @@ -36,6 +39,61 @@ to record a movie using it. Overview of files ----------------- +cmif-film.ms description of the CMIF video file format + + +These are programs with a command line interface: + +Vrec.py record video movies using the Indigo video library and + board + +Vplay.py play video movies + +Vinfo.py show statistics on movies + +Vtime.py (unrelated to vtime!!!) Copy a video file, + manipulating the time codes (e.g. faster/slower, or + regenerate time codes, or drop frames too close apart) + +Vedit.py interactive video editing program + + +These modules are used by the above programs: + +VFile.py classes that read and write CMIF video files + +Viewer.py two viewer classes used by Vedit + + +The following are C programs, either for efficiency or because they +need to link with a C library: + +squash.c make a movie smaller by averaging pixels + usage: squash factor [bits] <moviefile >newmoviefile + factor x and y compression factor + bits #bits left per sample in result (default 8) + +squash2.c make a movie smaller by dropping pixels + usage: squash2 factor <moviefile >newmoviefile + factor x and y compression factor + +tomono.c like squash2 but outputs a monochrome movie + +v2i.c convert the first frame of a movie file to SGI .rgb format + link with -limage + +i2v.c convert an rgb file to "lrectwrite" format (this was + used one time by the CMIF editor) + + +These programs are obsolete, but kept around for sentimental reasons. +Most either don't work any more because they don't use VFile and hence +haven't followed the frequent changes in the CMIF video file format; +or they are dependent upon hardware we don't have (SGI's previous +generation framegrabber). Except for cam.py / tv.py, their +functionality is present in the suite of programs whose name begins +with 'V' listed above. + cam.py network real-time tv broadcast; see tv.py usage: cam [packfactor [host]] specifying 'all' for host broadcasts @@ -54,11 +112,6 @@ camcorder.py record video movies or make snapshots (in movie format) p pause recording (record single frame if paused) ESC quit -Vrec.py record video movies using the Indigo video library and - board - -colorsys.py color conversions, used by video - statit.py various statistics operations on movie files syncaudio.py record audio synchronized with camcorder -a @@ -84,43 +137,12 @@ video.py player for movies recorded by camcorder.py soundfile default is none (no sound) skipbytes byte offset in soundfile where sound starts -Vplay.py similar but more modern, using VFile.py - vinfo.py print summary of movie file(s) usage: vinfo [-d] moviefile ... -d print delta times (default: print abs times) -Vinfo.py similar but more modern, using VFile.py - vpregs.py definition of VP registers vtime.py virtual time module imported by syncaudio.py and camcorder.py -Vtime.py (unrelated to vtime!!!) Copy a video file, - manipulating the time codes (e.g. faster/slower, or - regenerate time codes, or drop frames too close apart) - -Vedit.py interactive video editing program - -Viewer.py two viewer classes used by Vedit - - -The following are C programs, either for efficiency or because they -need to link with a C library: - -squash.c make a movie smaller by averaging pixels - usage: squash factor [bits] <moviefile >newmoviefile - factor x and y compression factor - bits #bits left per sample in result (default 8) - -squash2.c make a movie smaller by dropping pixels - usage: squash2 factor <moviefile >newmoviefile - factor x and y compression factor - -tomono.c like squash2 but outputs a monochrome movie - -v2i.c convert the first frame of a movie file to SGI .rgb format - link with -limage - -i2v.c convert an rgb file to "lrectwrite" format (this was - used one time by the CMIF editor) +colorsys.py color system conversions (now part of std python lib) diff --git a/Demo/sgi/video/Vinfo.py b/Demo/sgi/video/Vinfo.py index 341ddbf..cfda32a 100755 --- a/Demo/sgi/video/Vinfo.py +++ b/Demo/sgi/video/Vinfo.py @@ -65,13 +65,7 @@ def process(filename): sys.stderr.write(filename + ': EOF in video file\n') return 1 - print 'File: ', filename - print 'Version: ', vin.version - print 'Size: ', vin.width, 'x', vin.height - print 'Pack: ', vin.packfactor, '; chrom:', vin.chrompack - print 'Bits: ', vin.c0bits, vin.c1bits, vin.c2bits - print 'Format: ', vin.format - print 'Offset: ', vin.offset + vin.printinfo() if quick: vin.close() diff --git a/Demo/sgi/video/Vplay.py b/Demo/sgi/video/Vplay.py index 5f02ef1..facd20f 100755 --- a/Demo/sgi/video/Vplay.py +++ b/Demo/sgi/video/Vplay.py @@ -15,6 +15,7 @@ def help(): print '-d : write some debug stuff on stderr' print '-l : loop, playing the movie over and over again' print '-m delta : drop frames closer than delta msec (default 0)' + print '-n : don\'t wait after each file' print '-q : quiet, no informative messages' print '-r delta : regenerate input time base delta msec apart' print '-s speed : speed change factor (default 1.0)' @@ -137,13 +138,7 @@ def process(filename): return 1 if not quiet: - print 'File: ', filename - print 'Version: ', vin.version - print 'Size: ', vin.width, 'x', vin.height - print 'Pack: ', vin.packfactor, '; chrom:', vin.chrompack - print 'Bits: ', vin.c0bits, vin.c1bits, vin.c2bits - print 'Format: ', vin.format - print 'Offset: ', vin.offset + vin.printinfo() gl.foreground() @@ -211,6 +206,8 @@ def playonce(vin): time.millisleep(100) tin = 0 + toffset = 0 + oldtin = 0 told = 0 nin = 0 nout = 0 @@ -247,11 +244,18 @@ def playonce(vin): except EOFError: break nin = nin+1 + if tin+toffset < oldtin: + print 'Fix reversed time:', oldtin, 'to', tin + toffset = oldtin - tin + tin = tin + toffset + oldtin = tin if regen: tout = nin * regen else: tout = tin tout = int(tout / speed) if tout - told < mindelta: nskipped = nskipped + 1 + if not threading: + vin.skipnextframedata(size, csize) else: if not threading: try: diff --git a/Demo/sgi/video/vcopy.py b/Demo/sgi/video/vcopy.py index 1842094..fe012ea 100755 --- a/Demo/sgi/video/vcopy.py +++ b/Demo/sgi/video/vcopy.py @@ -10,7 +10,7 @@ def report(time, iframe): print 'Frame', iframe, ': t =', time def usage(): - sys.write('usage: vcopy infile outfile\n') + sys.stderr.write('usage: vcopy infile outfile\n') sys.exit(2) def help(): |