Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
dfb61fa2
Commit
dfb61fa2
authored
Aug 20, 1992
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor improvements: exit status, data size stats.
parent
180924d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
Demo/sgi/video/Vinfo.py
Demo/sgi/video/Vinfo.py
+23
-7
No files found.
Demo/sgi/video/Vinfo.py
View file @
dfb61fa2
...
...
@@ -43,8 +43,11 @@ def main():
short
=
1
if
not
args
:
args
=
[
'film.video'
]
sts
=
0
for
filename
in
args
:
process
(
filename
)
if
process
(
filename
):
sts
=
1
sys
.
exit
(
sts
)
# Process one file
...
...
@@ -54,13 +57,14 @@ def process(filename):
vin
=
VFile
.
VinFile
().
init
(
filename
)
except
IOError
,
msg
:
sys
.
stderr
.
write
(
filename
+
': I/O error: '
+
`msg`
+
'
\
n
'
)
return
return
1
except
VFile
.
Error
,
msg
:
sys
.
stderr
.
write
(
msg
+
'
\
n
'
)
return
return
1
except
EOFError
:
sys
.
stderr
.
write
(
filename
+
': EOF in video file
\
n
'
)
return
return
1
print
'File: '
,
filename
print
'Version: '
,
vin
.
version
print
'Size: '
,
vin
.
width
,
'x'
,
vin
.
height
...
...
@@ -68,24 +72,28 @@ def process(filename):
print
'Bits: '
,
vin
.
c0bits
,
vin
.
c1bits
,
vin
.
c2bits
print
'Format: '
,
vin
.
format
print
'Offset: '
,
vin
.
offset
if
quick
:
vin
.
close
()
return
if
not
short
:
if
delta
:
print
'Frame time deltas:'
,
else
:
print
'Frame times:'
,
n
=
0
t
=
0
told
=
0
datasize
=
0
while
1
:
try
:
t
,
data
,
cdata
=
vin
.
getnextframe
()
except
EOFError
:
if
not
short
:
print
break
datasize
=
datasize
+
len
(
data
)
if
cdata
:
datasize
=
datasize
+
len
(
cdata
)
if
not
short
:
if
n
%
8
==
0
:
sys
.
stdout
.
write
(
'
\
n
'
)
...
...
@@ -95,10 +103,18 @@ def process(filename):
else
:
sys
.
stdout
.
write
(
'
\
t
'
+
`t`
)
n
=
n
+
1
if
not
short
:
print
print
'Total'
,
n
,
'frames in'
,
t
*
0.001
,
'sec.'
,
if
t
:
print
'-- average'
,
int
(
n
*
10000.0
/
t
)
*
0.1
,
'frames/sec'
,
print
print
'Total data'
,
0.1
*
int
(
datasize
/
102.4
),
'Kbytes'
,
if
t
:
print
'-- average'
,
int
(
n
*
10000.0
/
t
)
*
0.1
,
'frames/sec'
,
print
'-- average'
,
print
0.1
*
int
(
datasize
/
0.1024
/
t
),
'Kbytes/sec'
,
print
vin
.
close
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment