本文整理汇总了Python中video.Video.calc_duration方法的典型用法代码示例。如果您正苦于以下问题:Python Video.calc_duration方法的具体用法?Python Video.calc_duration怎么用?Python Video.calc_duration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类video.Video
的用法示例。
在下文中一共展示了Video.calc_duration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Model
# 需要导入模块: from video import Video [as 别名]
# 或者: from video.Video import calc_duration [as 别名]
class Model(GObject.GObject):
__gsignals__ = { 'audio-ready': (GObject.SIGNAL_RUN_LAST, None, ()) }
video = None
audio = None
subtitles = Subtitles()
voReference = cVOReference()
ready = False
voFilename = ""
subFilename = ""
peakFilename = ""
projectFilename = ""
def __init__(self):
super(Model, self).__init__()
Gst.init(None)
self.video = Video()
self.audio = None
self.subtitles = Subtitles()
self.voReference = cVOReference()
self.ready = False
# File Names
self.voFilename = ""
self.subFilename = ""
self.peakFilename = ""
self.projectFilename = ""
def setup_audio(self, buffers):
self.audio = Audio(*buffers)
self.ready = True
self.emit("audio-ready")
def get_waveform(self):
if self.peakFilename == "":
return
f = open(self.peakFilename.decode('utf-8'), 'rb')
dataFile = load(f)
hiAudio = dataFile['arr_0']
lowAudio = dataFile['arr_1']
f.close()
self.audio = Audio(hiAudio, lowAudio)
self.video.calc_duration()
self.ready = True
self.emit("audio-ready")