Open statik opened 5 years ago
Same issue here, looking for vtt.py as described.
Looking through the commit logs, neither srt.py
nor vtt.py
were included since those lines in the README were authored.
I suspect that the references to srt.py
and vtt.py
are misleading (and possibly a mistake).
Another potential mistake, is that src/srtUtils.py and tools/srtUtils.py are duplicates. This makes me wonder if this sample is actively maintained.
@EddieGoynesAmazon , would you be able to provide feedback on my comments above?
srtUtils.py
contains the writeTranscriptToSRT function. An example usage of this can be found in translatevideo.py#L85. A description of this example can be found in the the blog post.
I used this to create the following snippet -- which replicates the behavior ascribed to srt.py
in the README.
# srt.py
import sys
from srtUtils import *
input_file = sys.argv[1]
output_file = sys.argv[2]
with open(input_file", "r") as f:
data = writeTranscriptToSRT(f.read(), 'en', output_file )
I recommend looking at these more elaborate serverless examples:
The below really works. That is the code I am using right now.
import sys
from srtUtils import *
input_file = sys.argv[1] output_file = sys.argv[2]
with open(input_file, "r") as f: data = writeTranscriptToSRT(f.read(), 'en', output_file )
========================================================
import sys
from webvttUtils import *
input_file = sys.argv[1] output_file = sys.argv[2]
with open(input_file, "r") as f: data = writeTranscriptToWebVTT(f.read(), 'en', output_file )
Hi! I'm interested in using these tools, but I don't see the srt.py file mentioned in the README.