Dateiformat muss mit angegeben werden, wenn man /dev/null als Ausgabe nimmt

This commit is contained in:
Stefan Bethke 2010-01-24 14:46:13 +00:00
parent e26f5b4f5c
commit a0620f5aef

View file

@ -1,6 +1,6 @@
#!/usr/bin/python #!/usr/bin/python
# $Schlepperbande: src/tivomirror/tivomirror,v 1.11 2010/01/10 17:09:19 stb Exp $ # $Schlepperbande: src/tivomirror/tivomirror,v 1.12 2010/01/13 21:47:14 stb Exp $
# #
# Stefans Script, um die Sendungen vom Tivo runterzuladen und in MPEG4 # Stefans Script, um die Sendungen vom Tivo runterzuladen und in MPEG4
# zu transkodieren. # zu transkodieren.
@ -86,15 +86,17 @@ def transcode(file, passno, ar):
transcode_opts.extend(["-aspect", "4:3", "-i"]) transcode_opts.extend(["-aspect", "4:3", "-i"])
transcode_opts.append(tmpmp2) transcode_opts.append(tmpmp2)
if passno == 2: if passno == 1:
transcode_opts.extend(["-an"])
else:
transcode_opts.extend(["-acodec", "libfaac", "-ab", "96kb"]) transcode_opts.extend(["-acodec", "libfaac", "-ab", "96kb"])
transcode_opts.extend(["-pass", "%d" % passno]) transcode_opts.extend(["-pass", "%d" % passno])
transcode_opts.extend(["-vcodec", "libx264"]) transcode_opts.extend(["-vcodec", "libx264"])
if passno == 2: if passno == 1:
transcode_opts.extend(["-vpre", "fastfirstpass"]) transcode_opts.extend(["-vpre", "fastfirstpass"])
else: else:
transcode_opts.extend(["-vpre", "hq"]) transcode_opts.extend(["-vpre", "hq"])
transcode_opts.extend(["-threads", "0", "-b", "1024kb"]) transcode_opts.extend(["-threads", "0", "-b", "928k", "-bt", "928k"])
if ar == 43: if ar == 43:
transcode_opts.extend(["-croptop", "4", "-cropbottom", "4", "-cropleft", "6", "-cropright", "6"]) transcode_opts.extend(["-croptop", "4", "-cropbottom", "4", "-cropleft", "6", "-cropright", "6"])
transcode_opts.extend(["-aspect", "4:3"]) transcode_opts.extend(["-aspect", "4:3"])
@ -102,7 +104,11 @@ def transcode(file, passno, ar):
transcode_opts.extend(["-croptop", "60", "-cropbottom", "60", "-cropleft", "6", "-cropright", "6"]) transcode_opts.extend(["-croptop", "60", "-cropbottom", "60", "-cropleft", "6", "-cropright", "6"])
transcode_opts.extend(["-aspect", "16:9"]) transcode_opts.extend(["-aspect", "16:9"])
transcode_opts.extend(["-y", "-deinterlace"]) transcode_opts.extend(["-y", "-deinterlace"])
if passno == 1:
transcode_opts.extend(["-f", "mp4", "/dev/null"])
else:
transcode_opts.append(tmpmp4) transcode_opts.append(tmpmp4)
print " %s" % " ".join(transcode_opts) print " %s" % " ".join(transcode_opts)
subprocess.check_call(transcode_opts) subprocess.check_call(transcode_opts)
@ -112,7 +118,9 @@ def download_decode(file, url, mak, ar):
os.makedirs(dir) os.makedirs(dir)
except OSError: except OSError:
pass pass
if not os.path.exists(tmpmp2): if os.path.exists(tmpmp2):
print " reusing existing download file"
else:
print "--- dowloading \"%s\" (ar %s)" % (url, ar) print "--- dowloading \"%s\" (ar %s)" % (url, ar)
p_curl = subprocess.Popen(["curl", "--anyauth", "--fail", \ p_curl = subprocess.Popen(["curl", "--anyauth", "--fail", \
"--insecure", "--cookie", "tivo/.cookies.txt", \ "--insecure", "--cookie", "tivo/.cookies.txt", \