def handleWatermark(this):
     fps=None
     if this.eparams.watermarkFile<>"":
         path=Config.CONFIGDIR+"/"+this.eparams.watermarkFile
     elif this.eparams.watermarkAsset<>"":
         slist=LocalStoreList()
         store=slist.getByUuid(this.eparams.watermarkStore)
         (ext, fps)=store.decodeAssetType(this.eparams.watermarkAssetType)
         path=getFFPath(store, this.eparams.watermarkAsset, this.eparams.watermarkAssetType)
     else: return []
     if fps==None: return this.handleSingleWatermark(path)
     else: return this.handleAnimatedWatermark(path, fps)
    def __init__(self,reporter, workflow,task):
        super(EncoderExecutor, self).__init__(reporter, workflow, task)
        elist=EncodersList()
        self.eparams=elist.getByUuid(task.attributes["encoder"]) 
        if self.eparams==None: raise Exception("No encoder with guid "+task.attributes["encoder"])
        if self.eparams.type=="ffmpeg_0612": self.encoder=FFmpegEncoder(self)
        else:  raise Exception("Unknown encoder type "+self.eparams.type)
        slist=LocalStoreList()
        self.frames=1
        self.overwrite=False
        if task.attributes.has_key("overwrite"): self.overwrite=(task.attributes["overwrite"].lower()=="true")
        dstAsset=task.attributes["srcAssetItem"]
        if task.attributes.has_key("destAssetItem"): dstAsset=task.attributes["destAssetItem"]

        srcstore=slist.getByUuid(task.attributes["srcStore"])
        (ext, self.srcFps)=srcstore.decodeAssetType(task.attributes["srcAssetItemType"])
        self.srcfile=getFFPath(srcstore, task.attributes["srcAssetItem"], task.attributes["srcAssetItemType"])
        targetdir=slist.getByUuid(task.attributes["destStore"]).findAsset(dstAsset)
        if not os.path.exists(targetdir): os.makedirs(targetdir)
        self.outfile=slist.getByUuid(task.attributes["destStore"]).findAssetFile(dstAsset, self.eparams.outputtype)