Exemplo n.º 1
0
 def __init__(self, targetContext):
     """
     targetContext's transcoding config should
     have the following attributes:
         videoEncoder
         videoFramerate
         videoPAR
         videoWidth
         videoHeight
         videoMaxWidth
         videoMaxHeight
         videoScaleMethod
         videoWidthMultiple
         videoHeightMultiple
         muxer
     """
     TranscodingTarget.__init__(self, targetContext)
     self._checkConfAttr("videoEncoder", True)
     self._checkConfAttr("muxer", True)
     self._checkConfAttr("videoFramerate")
     self._checkConfAttr("videoPAR")
     self._checkConfAttr("videoWidth")
     self._checkConfAttr("videoHeight")
     self._checkConfAttr("videoMaxWidth")
     self._checkConfAttr("videoMaxHeight")
     self._checkConfAttr("videoWidthMultiple")
     self._checkConfAttr("videoHeightMultiple")
     self._checkConfAttr("videoScaleMethod")
Exemplo n.º 2
0
 def __init__(self, targetContext):
     """
     targetContext's transcoding config should
     have the following attributes:
         audioEncoder
         audioRate
         audioChannels
         muxer
     """
     TranscodingTarget.__init__(self, targetContext)
     self._checkConfAttr("audioEncoder", True)
     self._checkConfAttr("muxer", True)
     self._checkConfAttr("audioRate")
     self._checkConfAttr("audioChannels")
Exemplo n.º 3
0
 def __init__(self, targetContext):
     """
     The filename may contain template variables:
         %(frame)d  => frame number (starting at 1)
         %(keyframe)d  => key-frame number (starting at 1)
         %(index)d  => index of the thumbnail (starting at 1)
         %(timestamp)d => timestamp of the thumbnail
         %(time)s => composed time of the thumbnail,
                     like %(hours)02d:%(minutes)02d:%(seconds)02d
         %(hours)d => hours from start
         %(minutes)d => minutes from start
         %(seconds)d => seconds from start
     Transcoding config should contains the attributes:
         periodValue
         periodUnit (seconds, frames or percent)
         maxCount
         thumbsWidth
         thumbsHeight
         outputFormat Enum(jpg, png)
     """
     TranscodingTarget.__init__(self, targetContext)
     self._pipeline = None
     self._bus = None
     self._thumbSink = None
     self._thumbSrc = None
     self._fileSink = None
     self._working = False
     self._finalizing = False
     self._pending = []  # [(gst.Buffer, Variables)]
     self._thumbnails = {}  # {filename: None}
     self._waiters = PassiveWaiters("Thumbnailer Finalization")
     self._prerollTimeout = None
     self._playErrorTimeout = None
     self._startLock = threading.Lock()
     self._checkConfAttr("periodValue")
     self._checkConfAttr("periodUnit")
     self._checkConfAttr("maxCount")
     self._checkConfAttr("thumbsWidth")
     self._checkConfAttr("thumbsHeight")
     self._checkConfAttr("outputFormat")