示例#1
0
    def __init__(self, timeseq, filelist, audiomap, logdir, ffmpeg_url):
        """
        Replace /dev/null with NUL on Windows.

        self.status: None, if nothing error,
                     'str error' if errors.
        self.data: it is a tuple containing the list of audio volume
                   parameters and the self.status of the output error,
                   in the form:
                   ([[maxvol, medvol], [etc,etc]], None or "str errors")
        """
        self.filelist = filelist
        self.time_seq = timeseq
        self.audiomap = audiomap
        logdir = logdir
        self.ffmpeg_url = ffmpeg_url
        self.status = None
        self.data = None
        self.nul = 'NUL' if platform.system() == 'Windows' else '/dev/null'
        self.logf = os.path.join(logdir, 'volumedected.log')
        write_log('volumedected.log', logdir)
        # set initial file LOG

        Thread.__init__(self)
        """initialize"""
        self.start()  # start the thread (va in self.run())
    def topic_thread(self, panel, varargs, duration):
        """
        Thread redirection
        varargs: type tuple data object
        duration: total duration or partial if set timeseq
        """
        self.previus = panel  # stores the panel from which it starts

        if varargs[0] == 'console view only':
            self.button_stop.Enable(False)
            self.button_close.Enable(True)
            return

        self.OutText.Clear(), self.labPerc.SetLabel('')
        self.logname = varargs[8]  # example: Videomass_VideoConversion.log
        time_seq = self.parent.time_seq  # a time segment

        write_log(self.logname, LOGDIR)  # set initial file LOG

        if varargs[0] == 'onepass':  # from Audio/Video Conv.
            self.PARENT_THREAD = OnePass(
                varargs,
                duration,
                self.logname,
                time_seq,
            )
        elif varargs[0] == 'twopass':  # from Video Conv.
            self.PARENT_THREAD = TwoPass(varargs, duration, self.logname,
                                         time_seq)
        elif varargs[0] == 'two pass EBU':  # from Audio/Video Conv.
            self.PARENT_THREAD = Loudnorm(varargs, duration, self.logname,
                                          time_seq)
        elif varargs[0] == 'savepictures':
            self.PARENT_THREAD = PicturesFromVideo(varargs, duration,
                                                   self.logname, time_seq)
        elif varargs[0] == 'youtube_dl python package':  # as import youtube_dl
            self.ckbx_text.Hide()
            self.PARENT_THREAD = Ydl_DL_Pylib(varargs, self.logname)

        elif varargs[0] == 'youtube-dl executable':  # as youtube-dl exec.
            self.ckbx_text.Hide()
            self.PARENT_THREAD = Ydl_DL_Exec(varargs, self.logname)
示例#3
0
    def __init__(self, filepath, timeseq, param, logdir, ffplay_url,
                 ffplay_loglev):
        """
        The self.FFPLAY_loglevel has flag 'error -hide_banner' by default,
        see videomass.conf for details.
        WARNING Do not use the "-stats" option as it does not work here.

        """
        self.filename = filepath  # file name selected
        self.time_seq = timeseq  # seeking
        self.param = param  # additional parameters if present
        logdir = logdir
        self.ffplay = ffplay_url
        self.ffplay_loglev = ffplay_loglev
        self.logf = os.path.join(logdir, 'ffplay.log')
        write_log('ffplay.log', logdir)
        # set initial file LOG

        Thread.__init__(self)
        ''' constructor'''
        self.start()