]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Adapted the world to the new VFile.py. Fixed bugs in Vplay.py:
authorGuido van Rossum <guido@python.org>
Mon, 7 Sep 1992 09:35:23 +0000 (09:35 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 7 Sep 1992 09:35:23 +0000 (09:35 +0000)
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.

Demo/sgi/video/README
Demo/sgi/video/Vinfo.py
Demo/sgi/video/Vplay.py
Demo/sgi/video/vcopy.py

index 85855a9157300a298ebd2d490690adcd0c494712..335a108368cfcbcd1bba64599b8646a10eb550ae 100644 (file)
@@ -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)
index 341ddbf1c16160b96d263c227fe1110431be2fbd..cfda32a76ff1d9f888f72e6496cf9685a4cf11e6 100755 (executable)
@@ -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()
index 5f02ef1349b361d4afe154a528548045f448cd52..facd20f3fea65ee82a24a2aced35efee2f4306d3 100755 (executable)
@@ -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:
index 1842094a44661536ce1525ee8bd68b9f79282770..fe012ea5ff72b200b7a42f6dd96eed74b204362f 100755 (executable)
@@ -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():