do_opt = partial(append_cmd, cmd)
if o.deinterlace:
- cmd += ["-vf-add", "yadif"]
+ cmd += ["-vf-pre", "yadif"]
if o.noskip:
cmd += ["-noskip"]
if o.skipkb:
do_opt("-chapter", o.chapter)
do_opt("-aid", o.audioid)
do_opt("-sid", o.subtitleid)
- do_opt("-vf-add", o.vfilters)
+ do_opt("-vf", o.vfilters)
do_opt("-af-add", o.afilters)
cmd += ["-vo", "yuv4mpeg:file=video.y4m"]
cmd += ["-ao", "pcm:waveheader:file=audio.wav"]
insert_mplayer_options(cmd, self.opts)
- cmd += self.profile.extra
+ cmd += self.profile.mplayeropts
self.do_exec(cmd, wait=False)
cmd += ["-ovc", "copy", "-oac", "copy"]
cmd += ["-of", "rawaudio", "-o", "audio.ac3"]
insert_mplayer_options(cmd, self.opts)
- cmd += self.profile.extra
self.do_exec(cmd)
self.do_exec(cmd, wait=False)
-class SwallowAudio(Command):
- def run(self):
- self.do_exec(["dd", "if=audio.wav", "of=/dev/null"], wait=False)
-
-
class Mencoder(Command):
codec2opts = {
"xvid": "-xvidencopts",
cmd += ["-oac", p.acodec]
if p.aopts:
cmd += [self.codec2opts[p.acodec], p.aopts]
- cmd += self.profile.extra
+ cmd += self.profile.mplayeropts
cmd += ["-o", self.opts.output + ".avi"]
self.do_exec(cmd)
class Profile(object):
def __init__(self, commands, **kwargs):
- self.extra = []
self.commands = commands
self.__dict__.update(kwargs)
"x264/lame" :
Profile(
commands=[MPlayer, X264, Lame, Wait, MKVMerge],
+ mplayeropts=[],
x264opts=["--preset", "veryslow", "--crf", "20"],
lameopts=["--preset", "medium"],
),
"x264/copyac3" :
Profile(
- commands=[MPlayer, X264, SwallowAudio, Wait, MencoderCopyAC3, MKVMerge],
+ commands=[MPlayer, X264, Wait, MencoderCopyAC3, MKVMerge],
+ mplayeropts=["-nosound"],
x264opts=["--preset", "veryslow", "--crf", "20"],
lameopts=["--preset", "medium"],
),
"xvid/lame" :
Profile(
commands=[Mencoder],
+ mplayeropts=["-ffourcc", "DX50"],
vcodec="xvid",
vopts="fixed_quant=2:vhq=4:autoaspect",
acodec="mp3lame",
"apple-quicktime" :
Profile(
commands=[MPlayer, X264, Faac, Wait, MP4Box],
+ mplayeropts=[],
x264opts=["--crf", "20", "--bframes", "1"],
faacopts=["-q", "100", "--mpeg-vers", "4"],
),
"nokia-n97" :
Profile(
commands=[Mencoder, MencoderDemux, MP4Box],
+ mplayeropts=["-vf-add", "scale=640:-10"],
vcodec="xvid",
- vopts="bitrate=256:vhq=4:autoaspect:max_bframes=0",
+ vopts="bitrate=384:vhq=4:autoaspect:max_bframes=0",
acodec="faac",
aopts="br=64:mpeg=4:object=2",
- extra=["-vf-add", "scale=640:-10"],
),
}