render fixes, encode vides in render command

This commit is contained in:
j 2023-10-09 20:29:11 +01:00
commit 5075394318
4 changed files with 35 additions and 7 deletions

View file

@ -5,6 +5,7 @@ import lxml.etree
import uuid
import os
_CACHE = {}
_IDS = defaultdict(int)
def get_propery(element, name):
@ -12,6 +13,7 @@ def get_propery(element, name):
class KDEnliveProject:
def to_xml(self):
@ -316,7 +318,10 @@ class KDEnliveProject:
return prefix + self.get_counter(prefix)
def get_chain(self, file, kdenlive_id=None):
out = subprocess.check_output(['melt', file, '-consumer', 'xml'])
if file in _CACHE:
out = _CACHE[file]
else:
out = _CACHE[file] = subprocess.check_output(['melt', file, '-consumer', 'xml'])
chain = lxml.etree.fromstring(out).xpath('producer')[0]
chain.tag = 'chain'
chain.attrib['id'] = self.get_id('chain')