Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100524320
gavi2mp4
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jan 31, 11:08
Size
1 KB
Mime Type
text/x-python
Expires
Sun, Feb 2, 11:08 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
23982694
Attached To
rPNBODY pNbody
gavi2mp4
View Options
#!/usr/bin/env python
from
optparse
import
OptionParser
import
os
,
sys
,
string
####################################################################################
def
parse_options
():
####################################################################################
usage
=
"usage: %prog [options] file"
parser
=
OptionParser
(
usage
=
usage
)
parser
.
add_option
(
"--fps"
,
action
=
"store"
,
dest
=
"fps"
,
type
=
"int"
,
default
=
24
,
help
=
"frame per seconds"
)
(
options
,
args
)
=
parser
.
parse_args
()
if
len
(
args
)
==
0
:
print
"you must specify at least a filename"
sys
.
exit
(
0
)
return
args
,
options
####################################################################################
#
# MAIN
#
####################################################################################
files
,
opt
=
parse_options
()
for
file
in
files
:
print
file
# bname
bname
=
os
.
path
.
splitext
(
file
)[
0
]
if
os
.
path
.
exists
(
"
%s
.h264"
%
(
bname
)):
os
.
remove
(
"
%s
.h264"
%
(
bname
))
if
os
.
path
.
exists
(
"
%s
.mp4"
%
(
bname
)):
os
.
remove
(
"
%s
.mp4"
%
(
bname
))
cmd
=
"mplayer
%s
.avi -dumpvideo -dumpfile
%s
.h264"
%
(
bname
,
bname
)
os
.
system
(
cmd
)
cmd
=
"mp4creator -create=
%s
.h264 -r
%d
%s
.mp4"
%
(
bname
,
opt
.
fps
,
bname
)
os
.
system
(
cmd
)
cmd
=
"mp4creator -list
%s
.mp4"
%
(
bname
)
os
.
system
(
cmd
)
os
.
remove
(
"
%s
.h264"
%
(
bname
))
Event Timeline
Log In to Comment