Giter VIP home page Giter VIP logo

convert-srt-vtt's Introduction

Srt to VTT converter

This script can be used to convert subtitles from Srt to VTT format.

Example workflow: Generate VTT subtitles for your own videos

Upload Video to YouTube and generate Closed Captions

  • Upload video: https://www.youtube.com/upload
  • Open with the (old) Creator Studio
  • Set video as unlisted (if this should not be public)
  • Once video is uploaded, select Subtitles/CC tab and wait until CCs are published (auto-generated)
  • Then Click on the Generated CC and download the subtitles in .srt format.

NOTE: YouTube supports downloading captions in VTT format as well. But the VTT format used is not supported by all players (e.g. Udemy).

Hence, this script was created to convert .srt to "simple" .vtt.

Convert

Run:

convert-srt-vtt.sh file.srt

This will output a file.srt.vtt file.

Batch convert

To convert all files in a given folder, run:

convert-all-srt-vtt.sh

Overlapping captions

When using .srt, the start and end times for each caption can overlap.

Example input file (notice how the end time of each caption is after the start time of the next caption):

1
00:00:00,030 --> 00:00:04,920
hello and welcome to my course on coding

2
00:00:02,730 --> 00:00:06,930
with flutter by taking this course you

3
00:00:04,920 --> 00:00:09,510
will learn how to use flutter to build

Unfortunately, not all players support overlapping captions.

So this script manipulates the timestamps, so that each caption starts exactly at the end of the previous one.

Example output file:

WEBVTT

00:00:00.030 --> 00:00:02.730
hello and welcome to my course on coding

00:00:02.730 --> 00:00:04.920
with flutter by taking this course you

00:00:04.920 --> 00:00:06.930
will learn how to use flutter to build

convert-srt-vtt's People

Contributors

bizz84 avatar

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.