From 703ccfd29eef2cb5e5553842c9973590398b8760 Mon Sep 17 00:00:00 2001 From: James Bunton Date: Sun, 11 Jul 2010 22:44:14 +1000 Subject: [PATCH] Added high quality x264 encoding profile --- encode.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/encode.py b/encode.py index 29daa95..28767bf 100755 --- a/encode.py +++ b/encode.py @@ -65,6 +65,20 @@ class MP4Box(Command): self.do_exec(["rm", "-f", video, audio, input]) + +class MKVMerge(Command): + def check(self): + self.check_command("mkvmerge") + self.check_no_file(self.opts.output + ".mkv") + + def run(self): + input = self.opts.output + ".avi" # From Mencoder command + output = self.opts.output + ".mkv" + self.do_exec(["mkvmerge", "-o", output, input]) + self.do_exec(["rm", "-f", input]) + + + class Mencoder(Command): codec2opts = { "lavc": "-lavcopts", @@ -161,6 +175,15 @@ profiles = { aopts="br=%(abitrate)d:mpeg=4:object=2", ), + "x264" : + Profile( + commands=[Mencoder, MKVMerge], + vcodec="x264", + vopts="pass=%(vpass)d:bitrate=%(vbitrate)d:subq=6:frameref=6:me=umh:partitions=all:bframes=4:b_adapt:qcomp=0.7:keyint=250:threads=2", + acodec="mp3lame", + aopts="abr:br=%(abitrate)d", + ), + "xvid" : Profile( commands=[Mencoder], -- 2.39.2