--- a/trunk/tubetutor/ffmpeg.py +++ b/trunk/tubetutor/ffmpeg.py @@ -20,8 +20,10 @@ if platform.system() == "Linux": grabber="-video_size 1920x1080 -f x11grab -framerate 20 -i :0.0 -f pulse -i 1" + audio=True else: grabber="-f gdigrab -framerate 20 -i desktop" + audio=False # # The following helper functions will retrieve the pathnames for the ffmpeg tools @@ -200,12 +202,15 @@ start(filename, params) wait() - def mux(self, filename, audiofile): + def mux(self, filename, audiofile, replace=False): print("*** mux(%s, %s)" % (filename, audiofile)) duration = video_duration(self.lastfilename) params = " -i %s -i %s -y" % (self.lastfilename, audiofile) params += " -t %d" % (int(duration)+1) - params += " -filter_complex \"[0:a][1:a]amerge,afade=out:st=%f:d=3\"" % (duration-3.0) + if replace: + params += " -af \"afade=out:st=%f:d=3\"" % (duration-3.0) + else: + params += " -filter_complex \"[0:a][1:a]amerge,afade=out:st=%f:d=3\"" % (duration-3.0) params += " -map 0:v:0 -map 1:a:0" params += self.qfilter self.lastfilename = filename