Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
27cb9916
Kaydet (Commit)
27cb9916
authored
Kas 04, 1991
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Made it work for more cases.
üst
b51afcc5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
13 deletions
+28
-13
vinfo.py
Demo/sgi/video/vinfo.py
+28
-13
No files found.
Demo/sgi/video/vinfo.py
Dosyayı görüntüle @
27cb9916
#!/ufs/guido/bin/sgi/python3.3
from
gl
import
*
from
GL
import
*
from
DEVICE
import
*
...
...
@@ -10,36 +9,52 @@ epoch = Struct()
EndOfFile
=
'End of file'
bye
=
'bye'
def
openvideo
(
name
):
f
=
open
(
name
,
'r'
)
w
,
h
=
eval
(
f
.
readline
()[:
-
1
])
return
f
,
w
,
h
def
loadframe
(
f
,
w
,
h
):
tijd
=
f
.
readline
()
if
tijd
=
''
:
def
openvideo
(
filename
):
f
=
open
(
filename
,
'r'
)
line
=
f
.
readline
()
if
not
line
:
raise
EndOfFile
if
line
[:
4
]
=
'CMIF'
:
line
=
f
.
readline
()
x
=
eval
(
line
[:
-
1
])
if
len
(
x
)
=
3
:
w
,
h
,
pf
=
x
else
:
w
,
h
=
x
;
pf
=
2
return
f
,
w
,
h
,
pf
def
loadframe
(
f
,
w
,
h
,
pf
):
line
=
f
.
readline
()
if
line
=
''
:
raise
EndOfFile
tijd
=
eval
(
tijd
[:
-
1
])
f
.
seek
(
w
*
h
*
4
,
1
)
x
=
eval
(
line
[:
-
1
])
if
type
(
x
)
=
type
(
0
)
or
type
(
x
)
=
type
(
0.0
):
tijd
=
x
if
pf
=
0
:
size
=
w
*
h
*
4
else
:
size
=
(
w
/
pf
)
*
(
h
/
pf
)
else
:
tijd
,
size
=
x
f
.
seek
(
size
,
1
)
return
tijd
def
saveframe
(
name
,
w
,
h
,
tijd
,
data
):
f
=
open
(
name
,
'w'
)
f
.
write
(
`w,h`
+
'
\n
'
)
f
.
write
(
`tijd`
+
'
\n
'
)
f
.
write
(
data
)
f
.
close
()
def
main
():
if
len
(
sys
.
argv
)
>
1
:
names
=
sys
.
argv
[
1
:]
else
:
names
=
[
'film.video'
]
for
name
in
names
:
f
,
w
,
h
=
openvideo
(
name
)
print
name
+
': '
+
`w`
+
'x'
+
`h`
f
,
w
,
h
,
pf
=
openvideo
(
name
)
print
name
,
':'
,
w
,
'x'
,
h
,
'; pf ='
,
pf
num
=
0
try
:
while
1
:
try
:
tijd
=
loadframe
(
f
,
w
,
h
)
tijd
=
loadframe
(
f
,
w
,
h
,
pf
)
print
'
\t
'
,
tijd
,
num
=
num
+
1
if
num
%
8
=
0
:
...
...
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