diff --git a/fcp2srt.py b/fcp2srt.py index 9d49f70..c29b2c9 100755 --- a/fcp2srt.py +++ b/fcp2srt.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python from __future__ import division import lxml @@ -39,5 +39,5 @@ for g in tree.xpath('//generatoritem'): '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)) diff --git a/srt2fcp.py b/srt2fcp.py index 994e641..8396b67 100755 --- a/srt2fcp.py +++ b/srt2fcp.py @@ -18,7 +18,7 @@ from PIL import Image base = os.path.abspath(os.path.dirname(__file__)) -generator_template = ''' +generator_template = ''' Text 3000 @@ -219,18 +219,18 @@ sequence_template = ''' 24 - Apple ProRes 422 + Apple DV - PAL Final Cut Pro Apple Inc. 7.0 - Apple ProRes 422 - Apple ProRes 422 - apcn + Apple DV - PAL + DV - PAL + dvcp appl - 1024 + 1023 0 0 0 @@ -294,7 +294,6 @@ class Fcp: fontsize = 18 font = 'Courier New' #font = 'Lucida Grande' - gid = 0 def __init__(self, size=None, font=None): if size is not None: @@ -330,10 +329,8 @@ class Fcp: }) def sub(self, start, end, text): - self.gid += 1 - text = xml.sax.saxutils.escape('\n'.join(text).strip()).replace('\n', ' ') + text = xml.sax.saxutils.escape('\n'.join(text).strip()).replace('\n', ' ') return generator_template % { - 'id': self.gid, 'start': start, 'end': end, 'duration': end-start,