Minor improvements, comments; fix Vinfo -d.
This commit is contained in:
parent
8b9c734e12
commit
7268c93c55
|
@ -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".
|
||||
|
||||
|
||||
History
|
||||
-------
|
||||
|
||||
We started this in October 1991, when we had a large framegrabber
|
||||
board on loan from SGI for a few weeks.
|
||||
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).
|
||||
|
||||
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.
|
||||
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 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
|
||||
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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue