ts2mkv.py

changeset 18
91cf8d348c74
parent 17
842120f00078
child 19
3a9fd72717df
equal deleted inserted replaced
17:842120f00078 18:91cf8d348c74
289 "-f null", "-" # no output file 289 "-f null", "-" # no output file
290 ] 290 ]
291 p = subprocess.Popen(shlex.split(" ".join(cmd)), \ 291 p = subprocess.Popen(shlex.split(" ".join(cmd)), \
292 stdout=subprocess.PIPE, stderr=subprocess.PIPE) 292 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
293 out, err = p.communicate() 293 out, err = p.communicate()
294 with self.info["msg_ffmpeg"] as msg: 294 self.info["msg_ffmpeg"] = out + "\n" + err
295 msg = out + "\n" + err 295 self.info["msg_ffmpeg"] = self.info["msg_ffmpeg"][self.info["msg_ffmpeg"].find("Input #0"):]
296 msg = msg[msg.find("Input #0"):]
297 296
298 def get_ffmpeg_command(self): 297 def get_ffmpeg_command(self):
299 """ 298 """
300 Too complex to describe, this does all the magic 299 Too complex to describe, this does all the magic
301 output: produces internal ffmpeg command list (empty command list on error) 300 output: produces internal ffmpeg command list (empty command list on error)
460 parser.add_argument('-f', action='store_true', default=False, \ 459 parser.add_argument('-f', action='store_true', default=False, \
461 help='force overwrite of existing file') 460 help='force overwrite of existing file')
462 461
463 args = parser.parse_args() 462 args = parser.parse_args()
464 processor = ts2mkv(crf=args.crf, tune=args.tune) 463 processor = ts2mkv(crf=args.crf, tune=args.tune)
465 with processor.config as c: 464 processor.config["scaledown"] = not args.ns
466 c["scaledown"] = not args.ns 465 processor.config["rename"] = args.rename
467 c["rename"] = args.rename 466 processor.config["overwrite"] = args.f
468 c["overwrite"] = args.f
469 467
470 for srcstr in args.input: 468 for srcstr in args.input:
471 src = glob.glob(srcstr) 469 src = glob.glob(srcstr)
472 for srcfile in src: 470 for srcfile in src:
473 print "Processing: %s" % srcfile 471 print "Processing: %s" % srcfile

mercurial