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__))
|
base = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
||||||
generator_template = '''<generatoritem id="Text">
|
generator_template = '''<generatoritem id="Text%(id)s">
|
||||||
<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 DV - PAL</name>
|
<name>Apple ProRes 422</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 DV - PAL</codecname>
|
<codecname>Apple ProRes 422</codecname>
|
||||||
<codectypename>DV - PAL</codectypename>
|
<codectypename>Apple ProRes 422</codectypename>
|
||||||
<codectypecode>dvcp</codectypecode>
|
<codectypecode>apcn</codectypecode>
|
||||||
<codecvendorcode>appl</codecvendorcode>
|
<codecvendorcode>appl</codecvendorcode>
|
||||||
<spatialquality>1023</spatialquality>
|
<spatialquality>1024</spatialquality>
|
||||||
<temporalquality>0</temporalquality>
|
<temporalquality>0</temporalquality>
|
||||||
<keyframerate>0</keyframerate>
|
<keyframerate>0</keyframerate>
|
||||||
<datarate>0</datarate>
|
<datarate>0</datarate>
|
||||||
|
@ -294,6 +294,7 @@ 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:
|
||||||
|
@ -329,8 +330,10 @@ class Fcp:
|
||||||
})
|
})
|
||||||
|
|
||||||
def sub(self, start, end, text):
|
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 % {
|
return generator_template % {
|
||||||
|
'id': self.gid,
|
||||||
'start': start,
|
'start': start,
|
||||||
'end': end,
|
'end': end,
|
||||||
'duration': end-start,
|
'duration': end-start,
|
||||||
|
|
Loading…
Reference in a new issue