use ProRes, use unique textid
This commit is contained in:
parent
a40ccbaac9
commit
f550f92f64
1 changed files with 10 additions and 7 deletions
17
srt2fcp.py
17
srt2fcp.py
|
@ -18,7 +18,7 @@ from PIL import Image
|
|||
|
||||
base = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
generator_template = '''<generatoritem id="Text">
|
||||
generator_template = '''<generatoritem id="Text%(id)s">
|
||||
<name>Text</name>
|
||||
<duration>3000</duration>
|
||||
<rate>
|
||||
|
@ -219,18 +219,18 @@ sequence_template = '''
|
|||
</rate>
|
||||
<colordepth>24</colordepth>
|
||||
<codec>
|
||||
<name>Apple DV - PAL</name>
|
||||
<name>Apple ProRes 422</name>
|
||||
<appspecificdata>
|
||||
<appname>Final Cut Pro</appname>
|
||||
<appmanufacturer>Apple Inc.</appmanufacturer>
|
||||
<appversion>7.0</appversion>
|
||||
<data>
|
||||
<qtcodec>
|
||||
<codecname>Apple DV - PAL</codecname>
|
||||
<codectypename>DV - PAL</codectypename>
|
||||
<codectypecode>dvcp</codectypecode>
|
||||
<codecname>Apple ProRes 422</codecname>
|
||||
<codectypename>Apple ProRes 422</codectypename>
|
||||
<codectypecode>apcn</codectypecode>
|
||||
<codecvendorcode>appl</codecvendorcode>
|
||||
<spatialquality>1023</spatialquality>
|
||||
<spatialquality>1024</spatialquality>
|
||||
<temporalquality>0</temporalquality>
|
||||
<keyframerate>0</keyframerate>
|
||||
<datarate>0</datarate>
|
||||
|
@ -294,6 +294,7 @@ class Fcp:
|
|||
fontsize = 18
|
||||
font = 'Courier New'
|
||||
#font = 'Lucida Grande'
|
||||
gid = 0
|
||||
|
||||
def __init__(self, size=None, font=None):
|
||||
if size is not None:
|
||||
|
@ -329,8 +330,10 @@ class Fcp:
|
|||
})
|
||||
|
||||
def sub(self, start, end, text):
|
||||
text = xml.sax.saxutils.escape('\n'.join(text).strip()).replace('\n', ' ')
|
||||
self.gid += 1
|
||||
text = xml.sax.saxutils.escape('\n'.join(text).strip()).replace('\n', ' ')
|
||||
return generator_template % {
|
||||
'id': self.gid,
|
||||
'start': start,
|
||||
'end': end,
|
||||
'duration': end-start,
|
||||
|
|
Loading…
Reference in a new issue