]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Minor improvements, comments; fix Vinfo -d.
authorGuido van Rossum <guido@python.org>
Tue, 18 Aug 1992 21:11:18 +0000 (21:11 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 18 Aug 1992 21:11:18 +0000 (21:11 +0000)
Demo/sgi/video/README
Demo/sgi/video/VFile.py
Demo/sgi/video/Vinfo.py
Demo/sgi/video/makemovie.py

index 39f63b500d3bf3c250499ab1b040b74e0f47cd1d..4995f58c602983fbc10fcea1a853d0ac2367da0b 100644 (file)
@@ -1,24 +1,41 @@
-This directory contains Python and C code for video stuff.
+CMIF video tools
+================
 
-History:
+This directory contains Python and C programs to manipulate files
+containing digitized video in the "CMIF video format".
 
-We started this in October 1991, when we had a large framegrabber
-board on loan from SGI for a few weeks.
 
-Later, when we started processing the recorded film fragments, the
-"CMIF video format" was revised several times, and we finally created
-an object-oriented interface for reading and writing various
-incarnations of these files, called VFile.
+History
+-------
 
-When we finally got our own Indigo entry-level video board (in June
-1992) and a version of the Irix video library that supported capturing
-PAL format (August 1992) Sjoerd added an interface to the video
+We started this in October 1991, when we had a large framegrabber
+board on loan from SGI for a few weeks: we developed a movie recording
+program (camcorder.py) and added numerous features, including still
+frame capture and synchronous sound recording using a second machine
+(the machine holding the framegrabber board didn't have audio).
+
+During the following months, when we started using and processing the
+recorded film fragments, the "CMIF video format" was revised several
+times, and we eventually created an object-oriented interface for
+reading and writing various incarnations of these files, called VFile.
+(This module is also used by our flagship application, the CMIF
+editor, not in this directory but in /ufs/guido/mm/.)
+
+When we got our own Indigo entry-level video board (in June 1992) and
+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 makemovie.py (based upon a
-still frame grabber by Sjoerd) to record a movie using it.
+still frame grabber by Sjoerd, in turn based upon SGI demo code in C)
+to record a movie using it.
 
-       --Guido, Jack and Sjoerd
+       Guido van Rossum
+       Jack Jansen
+       Sjoerd Mullender
 
 
+Overview of files
+-----------------
+
 cam.py         network real-time tv broadcast; see tv.py
                usage: cam [packfactor [host]]
                specifying 'all' for host broadcasts
@@ -67,21 +84,21 @@ 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       same but using VFile.py
+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       same but using VFile.py
+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
 
 
-These are C programs, either for efficiency or because they need to
-link with a C library.
+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
@@ -96,3 +113,6 @@ 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)
index 2febd5a275216bdb30492110176e97d2e063feb3..5b9cd014d8601b1ce10de4641f6ad31b9f24cb84 100755 (executable)
@@ -33,8 +33,9 @@ def conv_rgb8(rgb,d1,d2):
 # init(filename)
 # initfp(fp, filename)
 # rewind()
-# getframe()
-# skipframe()
+# getnextframe()
+# skipnextframe()
+# (and many more)
 #
 # The following read-only data members provide public information:
 # version
index 2aec8032ae784f26fd2729b7b04107ff1f00e872..d20d93fa5fe68f01be833829ac8d10787bfeb885 100755 (executable)
@@ -26,19 +26,19 @@ import getopt
 
 short = 0
 quick = 0
-diffs = 0
+delta = 0
 
 
 # Main program -- mostly command line parsing
 
 def main():
-       global short, quick, diffs
+       global short, quick, delta
        opts, args = getopt.getopt(sys.argv[1:], 'dqs')
        for opt, arg in opts:
                if opt == '-q':
                        quick = 1
                elif opt == '-d':
-                       diffs = 1
+                       delta = 1
                elif opt == '-s':
                        short = 1
        if not args:
@@ -50,7 +50,17 @@ def main():
 # Process one file
 
 def process(filename):
-       vin = VFile.VinFile().init(filename)
+       try:
+               vin = VFile.VinFile().init(filename)
+       except IOError, msg:
+               sys.stderr.write(filename + ': I/O error: ' + `msg` + '\n')
+               return
+       except VFile.Error, msg:
+               sys.stderr.write(msg + '\n')
+               return
+       except EOFError:
+               sys.stderr.write(filename + ': EOF in video file\n')
+               return
        print 'File:    ', filename
        print 'Version: ', vin.version
        print 'Size:    ', vin.width, 'x', vin.height
@@ -62,7 +72,10 @@ def process(filename):
                vin.close()
                return
        if not short:
-               print 'Frame times:',
+               if delta:
+                       print 'Frame time deltas:',
+               else:
+                       print 'Frame times:',
        n = 0
        t = 0
        told = 0
index 983e5ed3bb326422aec30b3e795a429297b6a1a6..5cb41cde2ec2d63fb4480c619e9df1bf34d0fc78 100755 (executable)
@@ -1,5 +1,5 @@
+#! /ufs/guido/bin/sgi/python
 #! /ufs/guido/src/video/py
-# XXX for now, you need this special version of Python
 
 # Capture a CMIF movie using the Indigo video library and board