a/trunk/tubetutor/ffmpeg.py | b/trunk/tubetutor/ffmpeg.py | ||
---|---|---|---|
... |
... |
||
148 | self.add_image(image, duration) |
148 | self.add_image(image, duration) |
149 | return content |
149 | return content |
150 | 150 | ||
151 | def add_image(self, filename, duration=5, fadein=True): |
151 | def add_image(self, filename, duration=5, fadein=True): |
152 | print(self.tmppath) |
152 | print(self.tmppath) |
153 | tmpimage = os.path.join(self.tmppath, os.path.basename(filename) + ".png") |
||
153 | tmpfilename = os.path.join(self.tmppath, os.path.basename(filename) + ".mkv") |
154 | tmpfilename = os.path.join(self.tmppath, os.path.basename(filename) + ".mkv") |
154 | params = " -y -loop 1 -t %d -i %s" % (duration, filename) |
155 | params = " -scale %s!" % self.vidresolution.replace(":", "x") |
156 | convert_image(filename, tmpimage, params) |
||
157 | |||
158 | params = " -y -loop 1 -t %d -i %s" % (duration, tmpimage) |
||
155 | if fadein: |
159 | if fadein: |
156 | params += " -filter_complex \"fade=in:0:d=1[v];[v]fade=out:st=%f:d=2\"" % ((duration-2)) |
160 | params += " -filter_complex \"fade=in:0:d=1[v];[v]fade=out:st=%f:d=2\"" % ((duration-2)) |
157 | else: |
161 | else: |
158 | params += " -filter_complex \"fade=out:st=%f:d=1\"" % ((duration-3)) |
162 | params += " -filter_complex \"fade=out:st=%f:d=1\"" % ((duration-3)) |
159 | params += self.qfilter |
163 | params += self.qfilter |