+class MPlayer(Command):
+ def init(self):
+ self.check_command("mplayer")
+ self.check_no_file("video.y4m")
+ self.check_no_file("audio.wav")
+
+ def run(self):
+ os.mkfifo("video.y4m")
+ os.mkfifo("audio.wav")
+ cmd = []
+ cmd += ["mplayer", self.opts.input]
+ cmd += ["-benchmark", "-noconsolecontrols", "-noconfig", "all"]
+ cmd += ["-vo", "yuv4mpeg:file=video.y4m"]
+ cmd += ["-ao", "pcm:waveheader:file=audio.wav"]
+ insert_mplayer_options(cmd, self.opts)
+ cmd += self.profile.extra
+ self.do_exec(cmd, wait=False)
+
+
+class MencoderCopyAC3(Command):
+ def init(self):
+ self.check_command("mplayer")
+ self.check_no_file("audio.ac3")
+ self.profile.audio_tmp = "audio.ac3"
+
+ def run(self):
+ cmd = []
+ cmd += ["mencoder", self.opts.input]
+ cmd += ["-noconfig", "all"]
+ 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)
+
+
+class X264(Command):
+ def init(self):
+ self.check_command("x264")
+ self.profile.video_tmp = "video.h264"
+
+ def run(self):
+ p = self.profile
+ cmd = []
+ cmd += ["x264", "--no-progress"]
+ cmd += p.x264opts
+ cmd += ["-o", p.video_tmp]
+ cmd += ["video.y4m"]
+ self.do_exec(cmd, wait=False)
+
+
+class Lame(Command):
+ def init(self):
+ self.check_command("lame")
+ self.profile.audio_tmp = "audio.mp3"
+
+ def run(self):
+ p = self.profile
+ cmd = []
+ cmd += ["lame", "--quiet"]
+ cmd += p.lameopts
+ cmd += ["audio.wav"]
+ cmd += [p.audio_tmp]
+ self.do_exec(cmd, wait=False)
+
+
+class Faac(Command):
+ def init(self):
+ self.check_command("faac")
+ self.profile.audio_tmp = "audio.aac"
+
+ def run(self):
+ p = self.profile
+ cmd = []
+ cmd += ["faac"]
+ cmd += ["-o", p.audio_tmp]
+ cmd += p.faacopts
+ cmd += ["audio.wav"]
+ self.do_exec(cmd, wait=False)
+
+
+class SwallowAudio(Command):
+ def run(self):
+ self.do_exec(["dd", "if=audio.wav", "of=/dev/null"], wait=False)
+