Guido van Rossum | 7268c93 | 1992-08-18 21:11:18 +0000 | [diff] [blame] | 1 | CMIF video tools |
| 2 | ================ |
Guido van Rossum | e4bddea | 1991-10-30 11:52:48 +0000 | [diff] [blame] | 3 | |
Guido van Rossum | 7268c93 | 1992-08-18 21:11:18 +0000 | [diff] [blame] | 4 | This directory contains Python and C programs to manipulate files |
| 5 | containing digitized video in the "CMIF video format". |
| 6 | |
| 7 | |
| 8 | History |
| 9 | ------- |
Guido van Rossum | b2e8228 | 1992-08-18 16:01:19 +0000 | [diff] [blame] | 10 | |
| 11 | We started this in October 1991, when we had a large framegrabber |
Guido van Rossum | 7268c93 | 1992-08-18 21:11:18 +0000 | [diff] [blame] | 12 | board on loan from SGI for a few weeks: we developed a movie recording |
| 13 | program (camcorder.py) and added numerous features, including still |
| 14 | frame capture and synchronous sound recording using a second machine |
| 15 | (the machine holding the framegrabber board didn't have audio). |
Guido van Rossum | b2e8228 | 1992-08-18 16:01:19 +0000 | [diff] [blame] | 16 | |
Guido van Rossum | 7268c93 | 1992-08-18 21:11:18 +0000 | [diff] [blame] | 17 | During the following months, when we started using and processing the |
| 18 | recorded film fragments, the "CMIF video format" was revised several |
| 19 | times, and we eventually created an object-oriented interface for |
| 20 | reading and writing various incarnations of these files, called VFile. |
| 21 | (This module is also used by our flagship application, the CMIF |
| 22 | editor, not in this directory but in /ufs/guido/mm/.) |
Guido van Rossum | b2e8228 | 1992-08-18 16:01:19 +0000 | [diff] [blame] | 23 | |
Guido van Rossum | 7268c93 | 1992-08-18 21:11:18 +0000 | [diff] [blame] | 24 | When we got our own Indigo entry-level video board (in June 1992) and |
| 25 | a version of the Irix video library that supported capturing PAL |
| 26 | format (in August 1992), Sjoerd added an interface to the video |
Guido van Rossum | 9e3f335 | 1992-09-29 13:40:47 +0000 | [diff] [blame] | 27 | library to Python (sv) and Guido wrote Vrec.py (based upon a still |
| 28 | frame grabber by Sjoerd, in turn based upon SGI demo code in C) to |
| 29 | record a movie using it. Vrec was soon followed by modernized |
Guido van Rossum | e178332 | 1992-09-07 09:35:23 +0000 | [diff] [blame] | 30 | versions of the other programs (Vinfo, Vplay, Vtime) and an |
| 31 | interactive editor (Vedit). Finally, VFile was rewritten for more |
Guido van Rossum | 9e3f335 | 1992-09-29 13:40:47 +0000 | [diff] [blame] | 32 | modularity, functionality and robustness, and various other tools were |
| 33 | added as needed. |
Guido van Rossum | b2e8228 | 1992-08-18 16:01:19 +0000 | [diff] [blame] | 34 | |
Guido van Rossum | 7268c93 | 1992-08-18 21:11:18 +0000 | [diff] [blame] | 35 | Guido van Rossum |
| 36 | Jack Jansen |
| 37 | Sjoerd Mullender |
Guido van Rossum | e4bddea | 1991-10-30 11:52:48 +0000 | [diff] [blame] | 38 | |
Guido van Rossum | 96059b3 | 1991-11-04 14:31:31 +0000 | [diff] [blame] | 39 | |
Guido van Rossum | 7268c93 | 1992-08-18 21:11:18 +0000 | [diff] [blame] | 40 | Overview of files |
| 41 | ----------------- |
| 42 | |
Guido van Rossum | 9e3f335 | 1992-09-29 13:40:47 +0000 | [diff] [blame] | 43 | cmif-film.ms description of the CMIF video file format (a little |
| 44 | out of date) |
Guido van Rossum | e178332 | 1992-09-07 09:35:23 +0000 | [diff] [blame] | 45 | |
| 46 | |
| 47 | These are programs with a command line interface: |
| 48 | |
| 49 | Vrec.py record video movies using the Indigo video library and |
| 50 | board |
| 51 | |
| 52 | Vplay.py play video movies |
| 53 | |
| 54 | Vinfo.py show statistics on movies |
| 55 | |
| 56 | Vtime.py (unrelated to vtime!!!) Copy a video file, |
| 57 | manipulating the time codes (e.g. faster/slower, or |
| 58 | regenerate time codes, or drop frames too close apart) |
| 59 | |
Guido van Rossum | 9e3f335 | 1992-09-29 13:40:47 +0000 | [diff] [blame] | 60 | Vmkjpeg.py compress an rgb or grey video file to jpeg[grey] format |
| 61 | |
| 62 | Vunjpeg.py expand a jpeg[grey] video file to rgb or grey format |
| 63 | |
Guido van Rossum | ff3da05 | 1992-12-09 22:16:35 +0000 | [diff] [blame^] | 64 | Vfix.py truncate the scan line width of a video file to |
| 65 | a multiple of 4 ('grey' images only) |
| 66 | |
Guido van Rossum | e178332 | 1992-09-07 09:35:23 +0000 | [diff] [blame] | 67 | Vedit.py interactive video editing program |
| 68 | |
Guido van Rossum | 67b4895 | 1992-09-24 12:54:35 +0000 | [diff] [blame] | 69 | Vsend.py unicast or multicast live video as UDP packets |
| 70 | |
| 71 | Vreceive.py receive transmissions from Vsend |
| 72 | |
Guido van Rossum | e178332 | 1992-09-07 09:35:23 +0000 | [diff] [blame] | 73 | |
| 74 | These modules are used by the above programs: |
| 75 | |
| 76 | VFile.py classes that read and write CMIF video files |
| 77 | |
| 78 | Viewer.py two viewer classes used by Vedit |
| 79 | |
Guido van Rossum | 67b4895 | 1992-09-24 12:54:35 +0000 | [diff] [blame] | 80 | LiveVideoIn.py live video input class, used by Vsend |
| 81 | |
| 82 | LiveVideoOut.py live video output class, used by Vsend and Vreceive |
| 83 | |
Guido van Rossum | e178332 | 1992-09-07 09:35:23 +0000 | [diff] [blame] | 84 | |
| 85 | The following are C programs, either for efficiency or because they |
Guido van Rossum | ff3da05 | 1992-12-09 22:16:35 +0000 | [diff] [blame^] | 86 | need to link with a C library. (These probably don't work any more |
| 87 | since the video file format has changed several times since they were |
| 88 | written. Also, they can now be recoded in Python using the 'imageop' |
| 89 | and 'imgfile' modules.) |
Guido van Rossum | e178332 | 1992-09-07 09:35:23 +0000 | [diff] [blame] | 90 | |
| 91 | squash.c make a movie smaller by averaging pixels |
| 92 | usage: squash factor [bits] <moviefile >newmoviefile |
| 93 | factor x and y compression factor |
| 94 | bits #bits left per sample in result (default 8) |
| 95 | |
| 96 | squash2.c make a movie smaller by dropping pixels |
| 97 | usage: squash2 factor <moviefile >newmoviefile |
| 98 | factor x and y compression factor |
| 99 | |
| 100 | tomono.c like squash2 but outputs a monochrome movie |
| 101 | |
| 102 | v2i.c convert the first frame of a movie file to SGI .rgb format |
| 103 | link with -limage |
| 104 | |
| 105 | i2v.c convert an rgb file to "lrectwrite" format (this was |
| 106 | used one time by the CMIF editor) |
| 107 | |
| 108 | |
| 109 | These programs are obsolete, but kept around for sentimental reasons. |
| 110 | Most either don't work any more because they don't use VFile and hence |
| 111 | haven't followed the frequent changes in the CMIF video file format; |
| 112 | or they are dependent upon hardware we don't have (SGI's previous |
Guido van Rossum | ff3da05 | 1992-12-09 22:16:35 +0000 | [diff] [blame^] | 113 | generation framegrabber). Anyway, their functionality is present in |
| 114 | the suite of programs whose name begins with 'V' listed above. |
Guido van Rossum | e178332 | 1992-09-07 09:35:23 +0000 | [diff] [blame] | 115 | |
Guido van Rossum | e4bddea | 1991-10-30 11:52:48 +0000 | [diff] [blame] | 116 | cam.py network real-time tv broadcast; see tv.py |
| 117 | usage: cam [packfactor [host]] |
| 118 | specifying 'all' for host broadcasts |
| 119 | |
| 120 | camcorder.py record video movies or make snapshots (in movie format) |
Guido van Rossum | 96059b3 | 1991-11-04 14:31:31 +0000 | [diff] [blame] | 121 | usage: camcorder [-c] [-a audiohost [-s]] [-p pf] [moviefile] |
| 122 | -c color (equivalent to -p 0) |
Guido van Rossum | e4bddea | 1991-10-30 11:52:48 +0000 | [diff] [blame] | 123 | -a audiohost syncaudio is running on audiohost |
| 124 | -s start syncaudio (on audiohost) |
Guido van Rossum | 96059b3 | 1991-11-04 14:31:31 +0000 | [diff] [blame] | 125 | -p packfactor packfactor (default 2; 0 records color) |
Guido van Rossum | e4bddea | 1991-10-30 11:52:48 +0000 | [diff] [blame] | 126 | moviefile (default film.video) |
| 127 | keyboard commands: |
| 128 | s stop grabbing (single step if already stopped) |
| 129 | c continuous grabbing |
| 130 | r start recording |
| 131 | p pause recording (record single frame if paused) |
| 132 | ESC quit |
| 133 | |
| 134 | statit.py various statistics operations on movie files |
| 135 | |
| 136 | syncaudio.py record audio synchronized with camcorder -a |
| 137 | usage: syncaudio videohost soundfile |
Guido van Rossum | 96059b3 | 1991-11-04 14:31:31 +0000 | [diff] [blame] | 138 | soundfile format: 16 bits/sample, 16000 samples/sec, 1 channel |
| 139 | (actually, you'd better set the sampling rate to 16000 |
| 140 | with the audio panel) |
Guido van Rossum | e4bddea | 1991-10-30 11:52:48 +0000 | [diff] [blame] | 141 | |
| 142 | tv.py receiver for transmissions from cam.py |
| 143 | |
Guido van Rossum | 7caf611 | 1991-11-04 15:55:01 +0000 | [diff] [blame] | 144 | vcopy.py selectively write frames from one movie file to another |
| 145 | usage: vcopy infile outfile |
| 146 | commands: 'n' gets next frame; 'w' writes current frame |
| 147 | |
Guido van Rossum | e4bddea | 1991-10-30 11:52:48 +0000 | [diff] [blame] | 148 | video.py player for movies recorded by camcorder.py |
Guido van Rossum | 7385d58 | 1991-11-22 14:03:57 +0000 | [diff] [blame] | 149 | usage: video [-l] [-p pf] [-m mag] [-F] |
| 150 | [moviefile [soundfile [skipbytes]]] |
Guido van Rossum | 228381e | 1991-11-04 18:04:47 +0000 | [diff] [blame] | 151 | -p pf override packfactor (to zoom) |
| 152 | -l looping -- restart movie when done |
Guido van Rossum | 7385d58 | 1991-11-22 14:03:57 +0000 | [diff] [blame] | 153 | -m mag magnification |
| 154 | -F run at max speed |
Guido van Rossum | 228381e | 1991-11-04 18:04:47 +0000 | [diff] [blame] | 155 | moviefile default is film.video |
| 156 | soundfile default is none (no sound) |
| 157 | skipbytes byte offset in soundfile where sound starts |
Guido van Rossum | e4bddea | 1991-10-30 11:52:48 +0000 | [diff] [blame] | 158 | |
Guido van Rossum | eda5dfd | 1991-11-06 16:13:25 +0000 | [diff] [blame] | 159 | vinfo.py print summary of movie file(s) |
| 160 | usage: vinfo [-d] moviefile ... |
| 161 | -d print delta times (default: print abs times) |
Guido van Rossum | e4bddea | 1991-10-30 11:52:48 +0000 | [diff] [blame] | 162 | |
Guido van Rossum | 96059b3 | 1991-11-04 14:31:31 +0000 | [diff] [blame] | 163 | vpregs.py definition of VP registers |
| 164 | |
Guido van Rossum | e4bddea | 1991-10-30 11:52:48 +0000 | [diff] [blame] | 165 | vtime.py virtual time module imported by syncaudio.py and camcorder.py |