summaryrefslogtreecommitdiffstats
path: root/convert2mp4
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2009-10-11 15:15:45 +0200
committerFlorian Pritz <bluewind@xssn.at>2009-10-11 15:15:45 +0200
commit90a0fcf1741d99da597aaa53b53e2221201bfc51 (patch)
treea1ffeb4727afe6024aefa1d78400c608dc4da6fe /convert2mp4
parent578af9df6bf801d42a5b8cd1604550b8cfa342bb (diff)
downloadbin-90a0fcf1741d99da597aaa53b53e2221201bfc51.tar.gz
bin-90a0fcf1741d99da597aaa53b53e2221201bfc51.tar.xz
convert2mp4: add 2 pass support
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'convert2mp4')
-rwxr-xr-xconvert2mp442
1 files changed, 25 insertions, 17 deletions
diff --git a/convert2mp4 b/convert2mp4
index 9035572..90bf736 100755
--- a/convert2mp4
+++ b/convert2mp4
@@ -67,23 +67,31 @@ def main():
p1 = subprocess.Popen(["echo", "-n", name], stdout=subprocess.PIPE)
p2 = subprocess.Popen(["sed", "s/\(.*\)\..*/\\1/"], stdin=p1.stdout, stdout=subprocess.PIPE)
name_mp4 = p2.communicate()[0] + ".mp4"
- subprocess.Popen(merge(
- [["ffmpeg", "-i", name,
- "-vcodec", "libx264",
-# "-r", "25",
-# "-g", "250", "-keyint_min", "25",
- "-vpre", "hq",
-# "-coder", "ac", "-me_range", "16",
-# "-subq", "5", "-sc_threshold", "40",
- "-acodec", "libfaac",
-# "-ar", "44100",
-# "-cmp", "+chroma", "-partitions", "+parti4x4+partp8x8+partb8x8",
-# "-i_qfactor", "0.71", "-b_strategy", "1",
- "-threads", "0",
-# "-crf", "30",
- "-y"],
- ffmpeg_args, [name_mp4]]
- )).communicate()[0]
+ for encpass in ["1", "2"]:
+ if encpass == "1":
+ filename = "/dev/null"
+ else:
+ filename = name_mp4
+ subprocess.Popen(merge(
+ [["ffmpeg", "-i", name,
+ "-vcodec", "libx264",
+# "-r", "25",
+# "-g", "250", "-keyint_min", "25",
+ "-vpre", "hq",
+# "-coder", "ac", "-me_range", "16",
+# "-subq", "5", "-sc_threshold", "40",
+ "-acodec", "libfaac",
+# "-ar", "44100",
+# "-cmp", "+chroma", "-partitions", "+parti4x4+partp8x8+partb8x8",
+# "-i_qfactor", "0.71", "-b_strategy", "1",
+ "-threads", "0",
+ "-pass", encpass,
+ "-f", "mp4",
+# "-crf", "30",
+ "-y"],
+ ffmpeg_args, [filename]]
+ )).communicate()[0]
+
subprocess.Popen(["qt-faststart", name_mp4, "done_"+name_mp4]).communicate()[0]
def merge(seq):