Beispiel #1
0
    def open(self, path):
        """Open input file."""
        ss = gizmo.Demux(path).getStreamsInfo()
        streams = {s.no: s for s in ss}

        for t in ['video', 'audio', 'subtitle/text']:
            if t in [s.type for s in ss]:
                self.filetype = t
                break

        self.path = path
        self.streams = streams
        self.no = None
        self.lang = None
        self.enc = None
        self.channels = ChannelsMap.auto()
        self.fps = None

        for stream in ss:
            if stream.frameRate:
                self.fps = stream.frameRate
                break

        if len(streams) > 0:
            self.selectFirstMatchingStream()
Beispiel #2
0
    def __init__(self, stream):
        self.demux = gizmo.Demux(stream.path)
        self.extractor = gizmo.Extractor(self.demux)

        self.duration = self.demux.getDuration()
        self.timeWindow = [0, self.duration]

        self.done = False
Beispiel #3
0
    def __init__(self, stream, runCb=None):
        self.demux = gizmo.Demux(stream.path, runCb)
        self.extractor = gizmo.Extractor(self.demux)

        self.duration = self.demux.getDuration()
        self.timeWindow = [0, self.duration]

        self.done = False
        self.eosCallback = lambda: None

        def eos():
            logger.info('job terminated')
            self.done = True
            self.eosCallback()

        self.extractor.connectEosCallback(eos)
Beispiel #4
0
    def open(self, path):
        ss = gizmo.Demux(path).getStreamsInfo()
        streams = {
            s.no: s
            for s in ss if self.types == None or s.type in self.types
        }

        self.path = path
        self.streams = streams
        self.no = None
        self.lang = None
        self.enc = None
        self.channels = channels.AutoChannelsMap()
        self.fps = None

        for stream in ss:
            if stream.frameRate:
                self.fps = stream.frameRate
                break

        if len(streams) > 0:
            self.selectFirstMachingStream()
Beispiel #5
0
    def __init__(self, stream, runCb=None):
        self.demux = gizmo.Demux(stream.path, runCb)
        self.extractor = gizmo.Extractor(self.demux)

        self.duration = self.demux.getDuration()
        self.timeWindow = [0, self.duration]