Ejemplo n.º 1
0
def process(filename):
    try:
        vin = VFile.RandomVinFile(filename)
    except IOError, msg:
        sys.stderr.write(filename + ': I/O error: ' + ` msg ` + '\n')
        return 1
    except VFile.Error, msg:
        sys.stderr.write(msg + '\n')
        return 1
    except EOFError:
        sys.stderr.write(filename + ': EOF in video file\n')
        return 1

    if terse:
        print string.ljust(filename, maxwidth),
        kbytes = (VFile.getfilesize(filename) + 1023) / 1024
        print string.rjust( ` kbytes `, 5) + 'K',
        print ' ', string.ljust( ` vin.version `, 5),
        print string.ljust(vin.format, 8),
        print string.rjust( ` vin.width `, 4),
        print string.rjust( ` vin.height `, 4),
        if type(vin.packfactor) == type(()):
            xpf, ypf = vin.packfactor
            s = string.rjust(`xpf`, 2) + ',' + \
               string.rjust(`ypf`, 2)
        else:
            s = string.rjust( ` vin.packfactor `, 2)
            if type(vin.packfactor) == type(0) and \
               vin.format not in ('rgb', 'jpeg') and \
               (vin.width/vin.packfactor) % 4 <> 0:
                s = s + '!  '
Ejemplo n.º 2
0
#! /usr/bin/env python
# Print some info about a CMIF movie file
# Usage:
#
# Vinfo [-d] [-q] [-s] [-t] [file] ...
# Options:
#
# -d       : print deltas between frames instead of frame times
# -q       : quick: don't read the frames
# -s       : don't print times (but do count frames and print the total)
# -t       : terse (one line/file, implies -s)
# file ... : file(s) to inspect; default film.video
import sys
sys.path.append('/ufs/guido/src/video')
import VFile
import getopt
import string
# Global options
short = 0
quick = 0
delta = 0
terse = 0
maxwidth = 10
# Main program -- mostly command line parsing

def main():
    global short, quick, delta, terse, maxwidth
    try:
        opts, args = getopt.getopt(sys.argv[1:], 'dqst')
    except getopt.error, msg:
Ejemplo n.º 3
0
def process(filename):
	try:
		vin = VFile.RandomVinFile(filename)
	except IOError, msg:
		sys.stderr.write(filename + ': I/O error: ' + `msg` + '\n')
		return 1
	except VFile.Error, msg:
		sys.stderr.write(msg + '\n')
		return 1
	except EOFError:
		sys.stderr.write(filename + ': EOF in video file\n')
		return 1

	if terse:
		print string.ljust(filename, maxwidth),
		kbytes = (VFile.getfilesize(filename) + 1023) / 1024
		print string.rjust(`kbytes`, 5) + 'K',
		print ' ', string.ljust(`vin.version`, 5),
		print string.ljust(vin.format, 8),
		print string.rjust(`vin.width`, 4),
		print string.rjust(`vin.height`, 4),
		if type(vin.packfactor) == type(()):
			xpf, ypf = vin.packfactor
			s = string.rjust(`xpf`, 2) + ',' + \
				  string.rjust(`ypf`, 2)
		else:
			s = string.rjust(`vin.packfactor`, 2)
			if type(vin.packfactor) == type(0) and \
				  vin.format not in ('rgb', 'jpeg') and \
				  (vin.width/vin.packfactor) % 4 <> 0:
				s = s + '!  '
Ejemplo n.º 4
0
#! /usr/bin/env python
# Print some info about a CMIF movie file

# Usage:
#
# Vinfo [-d] [-q] [-s] [-t] [file] ...

# Options:
#
# -d       : print deltas between frames instead of frame times
# -q       : quick: don't read the frames
# -s       : don't print times (but do count frames and print the total)
# -t       : terse (one line/file, implies -s)
# file ... : file(s) to inspect; default film.video

import sys
sys.path.append('/ufs/guido/src/video')
import VFile
import getopt
import string

# Global options
short = 0
quick = 0
delta = 0
terse = 0
maxwidth = 10

# Main program -- mostly command line parsing
def main():