migrate srt2fcp to python3
This commit is contained in:
parent
00521c3dc4
commit
9c8d1ffabd
1 changed files with 11 additions and 9 deletions
20
srt2fcp.py
20
srt2fcp.py
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
from __future__ import division
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import os
|
||||
from optparse import OptionParser
|
||||
|
@ -8,15 +8,17 @@ import shutil
|
|||
import math
|
||||
import time
|
||||
import json
|
||||
import urllib
|
||||
import urllib.request
|
||||
import urllib.parse
|
||||
import urllib.error
|
||||
import xml.sax.saxutils
|
||||
|
||||
import ox
|
||||
import Image
|
||||
from PIL import Image
|
||||
|
||||
base = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
generator_template = u'''<generatoritem id="Text">
|
||||
generator_template = '''<generatoritem id="Text">
|
||||
<name>Text</name>
|
||||
<duration>3000</duration>
|
||||
<rate>
|
||||
|
@ -175,12 +177,12 @@ generator_template = u'''<generatoritem id="Text">
|
|||
</generatoritem>
|
||||
'''
|
||||
|
||||
fcp_header = u'''<?xml version="1.0" encoding="UTF-8"?>
|
||||
fcp_header = '''<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE xmeml>
|
||||
<xmeml version="5">'''
|
||||
fcp_footer = u'''</xmeml>'''
|
||||
fcp_footer = '''</xmeml>'''
|
||||
|
||||
sequence_template = u'''
|
||||
sequence_template = '''
|
||||
<sequence id="%(id)s ">
|
||||
<uuid>72DC4146-6224-4400-BAAC-2AB6E0D3D292</uuid>
|
||||
<updatebehavior>add</updatebehavior>
|
||||
|
@ -306,7 +308,7 @@ class Fcp:
|
|||
start = int(s['in'] * fcp.fps)
|
||||
end = int(s['out'] * fcp.fps)
|
||||
if start < duration:
|
||||
print "warning", start, '<', duration, value
|
||||
print("warning", start, '<', duration, value)
|
||||
start = duration
|
||||
duration = end
|
||||
|
||||
|
|
Loading…
Reference in a new issue