Coder Social home page Coder Social logo

tt-to-subrip's Introduction

TimedText to SubRip

Simple tt to srt converter, in (g)awk.

screenshot

Overview

Converts subtitles in ttml (TimedText Markup Language) into subrip (srt) files. Requires gawk.

Install

$ git clone https://github.com/odinuge/tt-to-subrip/

Usage

Use it like any other awk file.

$ curl -s "$URL" | gawk -f tt-to-subrip.awk > sub.srt

FAQ

X is not working.

Feel free to submit an issue or send a pull request.

License

MIT © Odin Ugedal

tt-to-subrip's People

Contributors

odinuge avatar

Stargazers

Sunny avatar Wang Zhao avatar  avatar nwgat avatar

Watchers

James Cloos avatar nwgat avatar Wang Zhao avatar  avatar

tt-to-subrip's Issues

[Solved] Bad format with NBC.com subs

Hi,

Thanks for your work, it's very helpful.

When I use your script to convert NBC subs, I get this in SRT:

22
00:01:07:06 --> 00:01:07,190
Sub text

Instead of:

718
00:46:14,538 --> 00:46:16,005
Sub text

Looks identical, but the problem is NBC original subs are using time format "HH:MM:SS**:MILLS" (note the "colon") instead typical format from most subs "HH:MM:SS,**MILLS" (note the "comma").
Problem is actual video software is no capable to manage correctly subtitles with no comma.

There is any way to solve this?

Here's some raw subs from NBC.com, for clarification:

<p begin="00:00:06:00" end="00:00:06:19" region="rollup3" style="basic" tts:origin="20% 84.67%" tts:extent="50.63% 5.33%">>> Steve: FROM STUDIO 6B IN</p>
<p begin="00:00:06:19" end="00:00:07:19" region="rollup3" style="basic" tts:origin="20% 84.67%" tts:extent="58.13% 5.33%">ROCKEFELLER CENTER IN THE HEART</p>
<p begin="00:00:07:19" end="00:00:09:05" region="rollup3" style="basic" tts:origin="20% 84.67%" tts:extent="50.63% 5.33%">OF NEW YORK CITY, IT'S "THE</p>
<p begin="00:00:09:05" end="00:00:09:24" region="rollup3" style="basic" tts:origin="20% 84.67%" tts:extent="39.38% 5.33%">TONIGHT SHOW STARRING</p>
<p begin="00:00:09:24" end="00:00:18:04" region="rollup3" style="basic" tts:origin="20% 84.67%" tts:extent="26.25% 5.33%">JIMMY FALLON."</p>
<p begin="00:00:18:04" end="00:00:18:27" region="rollup3" style="basic" tts:origin="20% 84.67%" tts:extent="50.63% 5.33%">TONIGHT, JOIN JIMMY AND HIS</p>
<p begin="00:00:18:27" end="00:00:19:10" region="rollup3" style="basic" tts:origin="20% 84.67%" tts:extent="16.88% 5.33%">GUESTS --</p>

PS: I've used this in windows with awk port:
type subs.en.tt | awk -f tt-to-subrip.awk > subs.en.srt

Thanks for your time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.