def midentify(source, field):
process = subprocess.Popen(
- ["mplayer", "-frames", "0", "-identify", source],
+ [
+ "mplayer", source,
+ "-ao", "null", "-vo", "null",
+ "-frames", "0", "-identify",
+ ],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
def __init__(self, profile, opts):
self.profile = profile
self.opts = opts
+ self.init()
self.audio_tmp = "audio." + self.codec2exts[profile.acodec]
self.video_tmp = "video." + self.codec2exts[profile.vcodec]
-
+
+ def init(self):
+ pass
+
def print_install_message(self):
print >>sys.stderr, "Problem with command: %s", self.name
if self.package:
"mp3lame": "-lameopts",
}
+ def init(self):
+ if self.opts.copyac3:
+ self.profile.acodec = "copyac3"
+ self.profile.aopts = None
+
def insert_options(self, cmd):
def try_opt(opt, var):
if var is not None:
if self.opts.detelecine:
self.opts.ofps = "24000/1001"
cmd += ["-vf-add", "pullup,softskip"]
+ if self.opts.copyac3:
+ cmd += ["-noskip", "-mc", "0"]
try_opt("-fps", self.opts.ifps)
try_opt("-ofps", self.opts.ofps)
try_opt("-ss", self.opts.startpos)
p = self.profile
acodec = p.acodec
- if self.opts.copyac3:
+ if acodec == "copyac3":
acodec = "copy"
- p.acodec = "copyac3"
- p.aopts = None
cmd = []
cmd += ["mencoder", self.opts.input]
Profile(
commands=[Mencoder, MP4Box],
default_opts={
- "vbitrate": 800,
- "abitrate": 96,
+ "vbitrate": 256,
+ "abitrate": 64,
},
vcodec="xvid",
vopts="pass=%(vpass)d:bitrate=%(vbitrate)d:vhq=4:autoaspect:max_bframes=0",
return opts
def main():
+ os.nice(1)
+
opts = parse_args()
# Find our profile