Drakx
September 4th, 2005, 09:44 AM
Hi
as you know i'm trying my hardest to give quickrip life again ive fixed all seeable bugs just one section of code to do with mplayer/mencoder as im not too familiar with mencoder/mplayer im hoping some one will help me out till i get the hang of mencoder/mplayer the code that is not working is below:
# Clean up output dir in case QuickRip crashed out there
os.popen("".join(["rm ", self.outdir, "frameno.avi 2>/dev/null"]))
lameopts = "".join(["cbr=", str(self.track['abr']), str(self.vol)])
if self.config['videocodec'] is 1:
ovc = "xvid"
ovc_opts_type = "-xvidencopts"
ovc_opts = "".join(["4mv:me_quality=6:mod_quant:quant_range=1-31/1-31:bitrate=", str(int(self.track['vbr']))])
else:
ovc = "lavc"
ovc_opts_type = "-lavcopts"
ovc_opts = "".join(["vcodec=mpeg4:vhq:vbitrate=", str(int(self.track['vbr']))])
vop = "".join(["scale,crop=",self.track['crop']])
if int(self.config['deinterlacing']) is not 0:
vop = "".join([vop, ",", self.dio[self.config['deinterlacing']]])
#############From here not working proerly############
if self.config['passes'] is 1:
all_pass = [str(self.config['mencoder']), "-dvd", str(self.track['id']), "-alang", self.aLanguage, \
"-oac", "mp3lame", "-lameopts", lameopts, "-ovc", ovc, ovc_opts_type, ovc_opts, "-vop", vop, "-zoom", \
"-xy", resolution, "-o", self.output, "2>/dev/null"]
if int(self.config['aspectratio']) is not 0:
all_pass.insert(3, "-aspect")
all_pass.insert(4, self.aro[self.config['aspectratio']])
if self.sLanguage is not "None":
all_pass.insert(3, "-slang")
all_pass.insert(4, self.sLanguage)
# Uncomment to test command
# string = ""
# for bit in all_pass:
# bit = "".join([" ", bit])
# string = "".join([string, bit])
# print all_pass
# print string
# sys.exit(1)
self.runPass("audio", all_pass)
elif not self.config['passes'] or self.config['passes'] is 2:
audio_pass = [str(self.config['mencoder']), "-dvd", str(self.track['id']), "-alang", self.aLanguage, \
"-oac", "mp3lame", "-lameopts", lameopts, "-ovc", "frameno", "-o", \
"".join([self.outdir, "frameno.avi"]), "2>/dev/null"]
# added nice -n 3
video_pass = [str(self.config['mencoder']),"-dvd", str(self.track['id']), "-alang", self.aLanguage, \
"-sws", "2", "-oac", "copy", "-ovc", ovc, ovc_opts_type, "-vop", vop, "-zoom", "-xy", resolution, \
"-o", self.output, "2>/dev/null"]
if int(self.config['aspectratio']) is not 0:
video_pass.insert(3, "-aspect")
video_pass.insert(4, self.aro[self.config['aspectratio']])
if self.sLanguage is not "None":
video_pass.insert(3, "-slang")
video_pass.insert(4, self.sLanguage)
# # Uncomment to test command
# string1 = ""
# string2 = ""
# for bit in audio_pass:
# bit = "".join([" ", str(bit)])
# string1 = "".join([string1, bit])
# for bit in video_pass:
# bit = "".join([" ", str(bit)])
# string2 = "".join([string2, bit])
# print string1
# print string2
# sys.exit(1)
self.runPass("audio", audio_pass)
self.runPass("video1", video_pass)
os.popen("rm divx2pass.log 2>/dev/null")
os.popen("".join(["rm ", self.outdir, "frameno.avi 2>/dev/null"]))
elif self.config['passes'] is 3:
audio_pass = [str(self.config['mencoder']), "-dvd", str(self.track['id']), "-alang", self.aLanguage, \
"-oac", "mp3lame", "-lameopts", lameopts, "-ovc", "frameno", "-o", \
"".join([self.outdir, "frameno.avi"]), "2>/dev/null"]
video_pass1 = [str(self.config['mencoder']), "-dvd", str(self.track['id']), "-alang", self.aLanguage, \
"-sws", "2", "-oac", "copy", "-ovc", ovc, ovc_opts_type, "".join([ovc_opts, ":vpass=1"]), "-vop", vop, \
"-zoom", "-xy", resolution, "-o", self.output, "2>/dev/null"]
video_pass2 = [str(self.config['mencoder']), "-dvd", str(self.track['id']), "-alang", self.aLanguage, \
"-sws", "2", "-oac", "copy", "-ovc", ovc, ovc_opts_type, "".join([ovc_opts, ":vpass=2"]), "-vop", vop, \
"-zoom", "-xy", resolution, "-o", self.output, "2>/dev/null"]
########## To here????##########################
if int(self.config['aspectratio']) is not 0:
video_pass1.insert(3, "-aspect")
video_pass1.insert(4, self.aro[self.config['aspectratio']])
video_pass2.insert(3, "-aspect")
video_pass2.insert(4, self.aro[self.config['aspectratio']])
if self.sLanguage is not "None":
video_pass1.insert(3, "-slang")
video_pass1.insert(4, self.sLanguage)
video_pass2.insert(3, "-slang")
video_pass2.insert(4, self.sLanguage)
self.runPass("audio", audio_pass)
self.runPass("video1", video_pass1)
self.runPass("video2", video_pass2)
os.popen("rm divx2pass.log 2>/dev/null")
os.popen("".join(["rm ", self.outdir, "frameno.avi 2>/dev/null"]))
os.chdir(self.cwd)
self.int_finishRipping()
the section that is not working is
########### text #####################
########## text ######################
thanks
as you know i'm trying my hardest to give quickrip life again ive fixed all seeable bugs just one section of code to do with mplayer/mencoder as im not too familiar with mencoder/mplayer im hoping some one will help me out till i get the hang of mencoder/mplayer the code that is not working is below:
# Clean up output dir in case QuickRip crashed out there
os.popen("".join(["rm ", self.outdir, "frameno.avi 2>/dev/null"]))
lameopts = "".join(["cbr=", str(self.track['abr']), str(self.vol)])
if self.config['videocodec'] is 1:
ovc = "xvid"
ovc_opts_type = "-xvidencopts"
ovc_opts = "".join(["4mv:me_quality=6:mod_quant:quant_range=1-31/1-31:bitrate=", str(int(self.track['vbr']))])
else:
ovc = "lavc"
ovc_opts_type = "-lavcopts"
ovc_opts = "".join(["vcodec=mpeg4:vhq:vbitrate=", str(int(self.track['vbr']))])
vop = "".join(["scale,crop=",self.track['crop']])
if int(self.config['deinterlacing']) is not 0:
vop = "".join([vop, ",", self.dio[self.config['deinterlacing']]])
#############From here not working proerly############
if self.config['passes'] is 1:
all_pass = [str(self.config['mencoder']), "-dvd", str(self.track['id']), "-alang", self.aLanguage, \
"-oac", "mp3lame", "-lameopts", lameopts, "-ovc", ovc, ovc_opts_type, ovc_opts, "-vop", vop, "-zoom", \
"-xy", resolution, "-o", self.output, "2>/dev/null"]
if int(self.config['aspectratio']) is not 0:
all_pass.insert(3, "-aspect")
all_pass.insert(4, self.aro[self.config['aspectratio']])
if self.sLanguage is not "None":
all_pass.insert(3, "-slang")
all_pass.insert(4, self.sLanguage)
# Uncomment to test command
# string = ""
# for bit in all_pass:
# bit = "".join([" ", bit])
# string = "".join([string, bit])
# print all_pass
# print string
# sys.exit(1)
self.runPass("audio", all_pass)
elif not self.config['passes'] or self.config['passes'] is 2:
audio_pass = [str(self.config['mencoder']), "-dvd", str(self.track['id']), "-alang", self.aLanguage, \
"-oac", "mp3lame", "-lameopts", lameopts, "-ovc", "frameno", "-o", \
"".join([self.outdir, "frameno.avi"]), "2>/dev/null"]
# added nice -n 3
video_pass = [str(self.config['mencoder']),"-dvd", str(self.track['id']), "-alang", self.aLanguage, \
"-sws", "2", "-oac", "copy", "-ovc", ovc, ovc_opts_type, "-vop", vop, "-zoom", "-xy", resolution, \
"-o", self.output, "2>/dev/null"]
if int(self.config['aspectratio']) is not 0:
video_pass.insert(3, "-aspect")
video_pass.insert(4, self.aro[self.config['aspectratio']])
if self.sLanguage is not "None":
video_pass.insert(3, "-slang")
video_pass.insert(4, self.sLanguage)
# # Uncomment to test command
# string1 = ""
# string2 = ""
# for bit in audio_pass:
# bit = "".join([" ", str(bit)])
# string1 = "".join([string1, bit])
# for bit in video_pass:
# bit = "".join([" ", str(bit)])
# string2 = "".join([string2, bit])
# print string1
# print string2
# sys.exit(1)
self.runPass("audio", audio_pass)
self.runPass("video1", video_pass)
os.popen("rm divx2pass.log 2>/dev/null")
os.popen("".join(["rm ", self.outdir, "frameno.avi 2>/dev/null"]))
elif self.config['passes'] is 3:
audio_pass = [str(self.config['mencoder']), "-dvd", str(self.track['id']), "-alang", self.aLanguage, \
"-oac", "mp3lame", "-lameopts", lameopts, "-ovc", "frameno", "-o", \
"".join([self.outdir, "frameno.avi"]), "2>/dev/null"]
video_pass1 = [str(self.config['mencoder']), "-dvd", str(self.track['id']), "-alang", self.aLanguage, \
"-sws", "2", "-oac", "copy", "-ovc", ovc, ovc_opts_type, "".join([ovc_opts, ":vpass=1"]), "-vop", vop, \
"-zoom", "-xy", resolution, "-o", self.output, "2>/dev/null"]
video_pass2 = [str(self.config['mencoder']), "-dvd", str(self.track['id']), "-alang", self.aLanguage, \
"-sws", "2", "-oac", "copy", "-ovc", ovc, ovc_opts_type, "".join([ovc_opts, ":vpass=2"]), "-vop", vop, \
"-zoom", "-xy", resolution, "-o", self.output, "2>/dev/null"]
########## To here????##########################
if int(self.config['aspectratio']) is not 0:
video_pass1.insert(3, "-aspect")
video_pass1.insert(4, self.aro[self.config['aspectratio']])
video_pass2.insert(3, "-aspect")
video_pass2.insert(4, self.aro[self.config['aspectratio']])
if self.sLanguage is not "None":
video_pass1.insert(3, "-slang")
video_pass1.insert(4, self.sLanguage)
video_pass2.insert(3, "-slang")
video_pass2.insert(4, self.sLanguage)
self.runPass("audio", audio_pass)
self.runPass("video1", video_pass1)
self.runPass("video2", video_pass2)
os.popen("rm divx2pass.log 2>/dev/null")
os.popen("".join(["rm ", self.outdir, "frameno.avi 2>/dev/null"]))
os.chdir(self.cwd)
self.int_finishRipping()
the section that is not working is
########### text #####################
########## text ######################
thanks