Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
TTML to SRT conversion error #7608
Comments
|
This video is gone. Do you have other examples? |
|
I've saved it:
|
|
Sorry to dig this one up again. I'm trying to convert a TTML file to a SRT file because neither MPC-HC nor VLC will play the TTML files. Is there a way to just use the subtitle converter without downloading anything to YouTube but use a local file? Like yan12125 used the demo file posted here. From what I read in the documentation it only works with YT URIs. |
|
Currently no simple way. You can write a Python wrapper: from youtube_dl.utils import dfxp2srt
with open('xxx.ttml') as f:
srt_data = dfxp2srt(f.read())
with open('yyy.srt') as f:
f.write(srt_data) |
|
Bumpity. On that python wrapper: How do I actually make use of it? I.e. -- if I have a directory with .mp4's and corresponding .ttml files, and I want to convert them, either with the same basename and a new format/extension, or actually embedded into the mp4 file, how would I do it? The goal here is either "everything in this directory", or the command, "convert_srt *.ttml". |
|
@keybounce: you can use |
When running the command:
The video and subtitle download fine but the TTML to SRT conversion errors out with: