From: <te...@us...> - 2004-03-07 23:59:56
|
Update of /cvsroot/quickrip/ng In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2782 Modified Files: README base.py config.py Log Message: - I never committed the README for 0.9-alpha - Added methods to rip wav audio and encode as ogg - Made various bug fixes to accomodate new methods in base.py - Added 'mpeg2' to list of audio codecs in config.py Index: README =================================================================== RCS file: /cvsroot/quickrip/ng/README,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** README 1 Mar 2004 17:00:39 -0000 1.1.1.1 --- README 7 Mar 2004 23:36:03 -0000 1.2 *************** *** 1,3 **** ! QuickRip v0.7 README ------------------- --- 1,3 ---- ! QuickRip v0.9-cvs README ------------------- *************** *** 17,20 **** --- 17,23 ---- but I don't promise anything. + THIS IS AN ALPHA. It only comes with a command line interface (CLI) and may + be very buggy. Please report all bugs. + THIS COMES WITH NO WARRANTY! Check the LICENSE file to find out more about the GNU General Public License under which this is released. *************** *** 23,34 **** 2. INSTALLATION: ---------------- ! Ensure you have Python (>= 2.2), Qt (>= 3.1), PyQt (>= 3.5), Mplayer and ! Transcode installed. The installation script will check that you've got these ! components, so don't worry if you're not sure. ! Mplayer will also need to be compiled with libmp3lame support. Transcode ! should be compiled with libdvdcss support. This is accomplished in both ! instances by compiling MPlayer or Transcode after you've compiled and ! installed libmp3lame and libdvdcss. Once you've satisfied Quickrip's dependencies, you simply do this: --- 26,35 ---- 2. INSTALLATION: ---------------- ! Ensure you have Python (>= 2.2), mmpython and Mplayer installed. The ! installation script will check that you've got these components, so don't ! worry if you're not sure. ! Mplayer will also need to be compiled with libmp3lame, libdvdread and ! libdvdcss support. Once you've satisfied Quickrip's dependencies, you simply do this: *************** *** 42,46 **** hostname$ mkdir -p /usr/share/quickrip ! hostname$ cp *.py *.ui LICENSE README quickriprc /usr/share/quickrip hostname$ ln -sf /usr/share/quickrip/quickrip.py /usr/bin/quickrip --- 43,47 ---- hostname$ mkdir -p /usr/share/quickrip ! hostname$ cp *.py LICENSE README /usr/share/quickrip hostname$ ln -sf /usr/share/quickrip/quickrip.py /usr/bin/quickrip *************** *** 54,58 **** Usage: /usr/bin/quickrip [options] ! Options: (with none, runs PyQt GUI mode) -h, --help print this help message -c, --cli run in command line interface mode --- 55,59 ---- Usage: /usr/bin/quickrip [options] ! Options: (with none, runs CLI mode) -h, --help print this help message -c, --cli run in command line interface mode *************** *** 60,77 **** the terminal is resized (small performance hit) - Hopefully it's very easy and obvious to use GUI QuickRip - that is the main purpose - afterall. Basically, you "Scan DVD", wait until it's finished, then select the tracks - you want to rip, and set the options for how they will be ripped. Each track will - have its own set of options, so you need to select each track and set its options - in turn. You can change the names of tracks by right-clicking on their name at - present (by default: 01, 02, etc.) - - Once you're ready, hit the "Rip DVD" button, and then click on "Start". You can - stop and start the process at any time, but at present you cannot resume the - process, so stopping and starting will make the process start all over again. - - To run with the command line interface (CLI), simply run as "quickrip -cli" and - follow the on-screen instructions to rip your DVD :) - For a more thorough user guide, consult the online documentation at: http://quickrip.sf.net/docs.shtml --- 61,64 ---- Index: base.py =================================================================== RCS file: /cvsroot/quickrip/ng/base.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** base.py 5 Mar 2004 16:15:51 -0000 1.7 --- base.py 7 Mar 2004 23:36:03 -0000 1.8 *************** *** 65,69 **** 'mplayer': ['paths', self.findProgram("mplayer")], \ 'mencoder': ['paths', self.findProgram("mencoder")], \ ! 'transcode': ['paths', self.findProgram("transcode")], \ 'ogmmerge': ['paths', self.findProgram("ogmmerge")], \ 'outputdir': ['paths', os.path.expanduser("~")], \ --- 65,69 ---- 'mplayer': ['paths', self.findProgram("mplayer")], \ 'mencoder': ['paths', self.findProgram("mencoder")], \ ! 'oggenc': ['paths', self.findProgram("oggenc")], \ 'ogmmerge': ['paths', self.findProgram("ogmmerge")], \ 'outputdir': ['paths', os.path.expanduser("~")], \ *************** *** 257,260 **** --- 257,266 ---- os.popen("".join(["rm ", self.config['outputdir'], "/frameno.avi", \ " 2>/dev/null"])) + os.popen("".join(["rm ", self.config['outputdir'], "/audio.wav", \ + " 2>/dev/null"])) + os.popen("".join(["rm ", self.config['outputdir'], "/audio.ogg", \ + " 2>/dev/null"])) + os.popen("".join(["rm ", self.config['outputdir'], "/video.avi", \ + " 2>/dev/null"])) self.notify_newTitle(title['name'], i, self.numrips, title['vbr']) *************** *** 275,288 **** # Rip title ! self.ripMp3Audio(title) ! while self.state == 'ripping': ! sleep(1) ! self.ripVideo(title) ! while self.state == 'ripping': ! sleep(1) ! #if self.config['audiocodec'] == 'ogg': #self.ogmMerge(title) ! #while self.state == 'ripping': ! # sleep(1) self.notify_finishRipping() --- 281,308 ---- # Rip title ! if self.config['videocodec'] == 'mpeg2': ! self.ripSVCD(title) ! while self.state == 'ripping': ! sleep(1) ! elif self.config['audiocodec'] == 'ogg': ! self.ripWavAudio(title) ! while self.state == 'ripping': ! sleep(1) ! self.oggEnc(title) ! while self.state == 'ripping': ! sleep(1) ! #self.ripVideo(title) ! #while self.state == 'ripping': ! # sleep(1) #self.ogmMerge(title) ! #while self.state == 'ripping': ! # sleep(1) ! else: ! self.ripMp3Audio(title) ! while self.state == 'ripping': ! sleep(1) ! self.ripVideo(title) ! while self.state == 'ripping': ! sleep(1) self.notify_finishRipping() *************** *** 306,311 **** --- 326,372 ---- title['crop'] = common_crop + + def ripSVCD(self, title): + """Rip a DVD title for an SVCD""" + self.notify_newPass("svcd") + self.state = "ripping" + + # Work out filename + output = os.path.join(self.config['outputdir'], str(title['name'])) + output = ''.join([output, ".mpeg"]) + + ## Assemble basic command + # I tried transcode, but failed to understand it + # I'll look into mencvcd (in mplayer source tarball in mplayer/TOOLS) + + + def ripWavAudio(self, title): + """Rip the audio in wav format""" + self.notify_newPass("audio") + self.state = "ripping" + # Work out options to send to mplayer + arguments = ["-dvd", str(title['id']), "-alang", title['alang'], \ + "-ao", "pcm", "-vo", "null", "-vc", "dummy", "-aofile", \ + os.path.join(self.config['outputdir'], "audio.wav")] + # Run mplayer + self.run('mplayer', arguments, self.pipeFinished, self.mplayerProgress, \ + flushbuffer=100, data=("audio",title)) + + + def oggEnc(self, title): + """Encode a wav into an ogg""" + self.notify_newPass("oggenc") + self.state = "ripping" + # Work out options to send to mplayer + arguments = [''.join(["-b", str(title['abr'])]), ''.join(["-o", \ + os.path.join(self.config['outputdir'], "audio.ogg")]), \ + os.path.join(self.config['outputdir'], "audio.wav")] + # Run mplayer + self.run('oggenc', arguments, self.pipeFinished, self.oggencProgress, \ + flushbuffer=100, data=("oggenc",title)) + def ripMp3Audio(self, title): + """Rip the audio in mp3 format""" self.notify_newPass("audio") self.state = "ripping" *************** *** 320,325 **** os.path.join(self.config['outputdir'], "frameno.avi")] # Run mencoder ! self.run('mencoder', arguments, self.mencodeFinished, self.mencodeProgress, \ ! flushbuffer=1, data="audio") --- 381,386 ---- os.path.join(self.config['outputdir'], "frameno.avi")] # Run mencoder ! self.run('mencoder', arguments, self.pipeFinished, self.mencodeProgress, \ ! flushbuffer=100, data=("audio",title)) *************** *** 372,381 **** arguments.insert(5, title['slang']) # Go for it! ! self.run('mencoder', arguments, self.mencodeFinished, self.mencodeProgress, \ ! flushbuffer=1, data="video") ! def mencodeProgress(self, line, passtype): ! """Run mencoder with given arguments and report progress""" perc = 0 trem = 0 --- 433,442 ---- arguments.insert(5, title['slang']) # Go for it! ! self.run('mencoder', arguments, self.pipeFinished, self.mencodeProgress, \ ! flushbuffer=100, data=("video",title)) ! def mencodeProgress(self, line, (passtype,title)): ! """Report progress of mencoder pass""" perc = 0 trem = 0 *************** *** 385,396 **** trem = re_progress.search(line).group(2) self.notify_updateProgress(perc, trem, passtype) ! def mencodeFinished(self, lines, passtype): ! """Finish off odds and ends after rip""" self.notify_finishTitle(passtype) sleep(2) self.state = "still" ## INHERIT THE CLASS AND SUBSTITUE THESE CLASS METHODS WITH YOUR ## OWN UI HOOKS --- 446,478 ---- trem = re_progress.search(line).group(2) self.notify_updateProgress(perc, trem, passtype) + + + def mplayerProgress(self, line, (passtype,title)): + """Report progress of mplayer pass""" + perc = 0 + re_progress = re.compile('A:\s*(\d+)\.\d .*') + if re_progress.search(line): + progress = re_progress.search(line).group(1) + perc = int((float(progress) / float(title['length']) * 100)) + self.notify_updateProgress(perc, None, passtype) + + + def oggencProgress(self, line, (passtype,title)): + """Report progress of oggenc pass""" + perc = 0 + re_progress = re.compile('\[\s*(\d*\.\d)\%\] \[[ ](\d*m\d*s)') + if re_progress.search(line): + perc = float(re_progress.search(line).group(1)) + trem = re_progress.search(line).group(2) + self.notify_updateProgress(perc, trem, passtype) ! def pipeFinished(self, lines, passtype): ! """Finish off odds and ends after pipe""" self.notify_finishTitle(passtype) sleep(2) self.state = "still" + ## INHERIT THE CLASS AND SUBSTITUE THESE CLASS METHODS WITH YOUR ## OWN UI HOOKS *************** *** 451,458 **** self.lock.acquire() ! #if DEBUG: ! # print self.command ! ! self.pipe = popen2.Popen3(self.command, 1) pid = self.pipe.pid totallines = [] --- 533,537 ---- self.lock.acquire() ! self.pipe = popen2.Popen4(self.command) pid = self.pipe.pid totallines = [] *************** *** 460,464 **** try: if self.flushbuffer: ! line = self.pipe.fromchild.read(100) else: line = self.pipe.fromchild.readline() --- 539,543 ---- try: if self.flushbuffer: ! line = self.pipe.fromchild.read(self.flushbuffer) else: line = self.pipe.fromchild.readline() Index: config.py =================================================================== RCS file: /cvsroot/quickrip/ng/config.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** config.py 5 Mar 2004 00:57:18 -0000 1.4 --- config.py 7 Mar 2004 23:36:03 -0000 1.5 *************** *** 28,32 **** # Options for options :) video_codecs = ['divx', 'xvid', 'mpeg2'] ! audio_codecs = ['mp3', 'ogg'] aspect_ratios = ['Default', '4:3', '16:9', '2.35:1'] audio_bitrates = ['32', '48', '64', '96', '128', '160', '192', '256', '350'] --- 28,32 ---- # Options for options :) video_codecs = ['divx', 'xvid', 'mpeg2'] ! audio_codecs = ['mp3', 'ogg', 'mpeg2'] aspect_ratios = ['Default', '4:3', '16:9', '2.35:1'] audio_bitrates = ['32', '48', '64', '96', '128', '160', '192', '256', '350'] |