Esempio n. 1
0
    def get_stream_info(self):
        """
        Run eac3to and cache the output data.
        """
        if os.path.isfile(self["eac3to_txt_path"]):
            print "Use existing eac3to output from cache file '%s'..." % (
                self["eac3to_txt_path"])
            f = file(self["eac3to_txt_path"], "r")
            output = f.read()
            f.close()
        else:
            # run eac3to and save the output data into self["eac3to_txt_path"]
            cmd = [self.cfg["eac3to"], self["abs_path"]]
            print "run '%s'..." % " ".join(cmd)
            process, output = subprocess2(cmd)

            f = file(self["eac3to_txt_path"], "w")
            f.write(output)
            f.close()

        return output
Esempio n. 2
0
 def get_stream_info(self):
     """
     Run eac3to and cache the output data.
     """
     if os.path.isfile(self["eac3to_txt_path"]):
         print "Use existing eac3to output from cache file '%s'..." % (
             self["eac3to_txt_path"]
         )
         f = file(self["eac3to_txt_path"], "r")
         output = f.read()
         f.close()
     else:
         # run eac3to and save the output data into self["eac3to_txt_path"]
         cmd = [self.cfg["eac3to"], self["abs_path"]]
         print "run '%s'..." % " ".join(cmd)
         process, output = subprocess2(cmd)
         
         f = file(self["eac3to_txt_path"], "w")
         f.write(output)
         f.close()
         
     return output
Esempio n. 3
0
        videofile.parse_streaminfo(output)

        if videofile["streams"]:
            print "Streams found:", videofile["streams"]
        else:
            print "ERROR: No streams found!"
            continue
        


    stream_selection = select_streams(videofiles)
    print "selected streams:", stream_selection

    for videofile in videofiles:
        print videofile
        cmd = videofile.get_command(stream_selection)
        if cmd == None:
            print "No cmd -> Skip file."
            continue

        videofile.log("run: %s" % cmd)
        if DEBUG:
            print "DEBUG, skip real run..."
        else:
            process, output = subprocess2(cmd)
            videofile.log("eac2to output: %s" % output.lstrip("- "))

        videofile.close_log()
        print "-"*79

    print " -- END -- "
Esempio n. 4
0
        print "-" * 80
        videofile.log("eac2to analyse output: %s" % output.lstrip("- "))
        videofile.parse_streaminfo(output)

        if videofile["streams"]:
            print "Streams found:", videofile["streams"]
        else:
            print "ERROR: No streams found!"
            continue

    stream_selection = select_streams(videofiles)
    print "selected streams:", stream_selection

    for videofile in videofiles:
        print videofile
        cmd = videofile.get_command(stream_selection)
        if cmd == None:
            print "No cmd -> Skip file."
            continue

        videofile.log("run: %s" % cmd)
        if DEBUG:
            print "DEBUG, skip real run..."
        else:
            process, output = subprocess2(cmd)
            videofile.log("eac2to output: %s" % output.lstrip("- "))

        videofile.close_log()
        print "-" * 79

    print " -- END -- "