Compare commits

..

No commits in common. "f550f92f64f3b886512a224c2b490f10f2e992cd" and "b43e9f64e3e8508a8ac183c5822e5eac601e2011" have entirely different histories.

2 changed files with 9 additions and 12 deletions

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python3 #!/usr/bin/env python
from __future__ import division from __future__ import division
import lxml import lxml
@ -39,5 +39,5 @@ for g in tree.xpath('//generatoritem'):
'in': _start/fps, 'out': (_end-1)/fps, 'value': value 'in': _start/fps, 'out': (_end-1)/fps, 'value': value
}) })
with open(target, 'wb') as f: with open(target, 'w') as f:
f.write(ox.srt.encode(data)) f.write(ox.srt.encode(data))

View file

@ -18,7 +18,7 @@ from PIL import Image
base = os.path.abspath(os.path.dirname(__file__)) base = os.path.abspath(os.path.dirname(__file__))
generator_template = '''<generatoritem id="Text%(id)s"> generator_template = '''<generatoritem id="Text">
<name>Text</name> <name>Text</name>
<duration>3000</duration> <duration>3000</duration>
<rate> <rate>
@ -219,18 +219,18 @@ sequence_template = '''
</rate> </rate>
<colordepth>24</colordepth> <colordepth>24</colordepth>
<codec> <codec>
<name>Apple ProRes 422</name> <name>Apple DV - PAL</name>
<appspecificdata> <appspecificdata>
<appname>Final Cut Pro</appname> <appname>Final Cut Pro</appname>
<appmanufacturer>Apple Inc.</appmanufacturer> <appmanufacturer>Apple Inc.</appmanufacturer>
<appversion>7.0</appversion> <appversion>7.0</appversion>
<data> <data>
<qtcodec> <qtcodec>
<codecname>Apple ProRes 422</codecname> <codecname>Apple DV - PAL</codecname>
<codectypename>Apple ProRes 422</codectypename> <codectypename>DV - PAL</codectypename>
<codectypecode>apcn</codectypecode> <codectypecode>dvcp</codectypecode>
<codecvendorcode>appl</codecvendorcode> <codecvendorcode>appl</codecvendorcode>
<spatialquality>1024</spatialquality> <spatialquality>1023</spatialquality>
<temporalquality>0</temporalquality> <temporalquality>0</temporalquality>
<keyframerate>0</keyframerate> <keyframerate>0</keyframerate>
<datarate>0</datarate> <datarate>0</datarate>
@ -294,7 +294,6 @@ class Fcp:
fontsize = 18 fontsize = 18
font = 'Courier New' font = 'Courier New'
#font = 'Lucida Grande' #font = 'Lucida Grande'
gid = 0
def __init__(self, size=None, font=None): def __init__(self, size=None, font=None):
if size is not None: if size is not None:
@ -330,10 +329,8 @@ class Fcp:
}) })
def sub(self, start, end, text): def sub(self, start, end, text):
self.gid += 1 text = xml.sax.saxutils.escape('\n'.join(text).strip()).replace('\n', '&#13;&#10;')
text = xml.sax.saxutils.escape('\n'.join(text).strip()).replace('\n', '&#13;')
return generator_template % { return generator_template % {
'id': self.gid,
'start': start, 'start': start,
'end': end, 'end': end,
'duration': end-start, 'duration': end-start,