Skip to content
Read, write and segment WebVTT caption files in Python.
Branch: master
Clone or download
Latest commit 9106321 Jan 14, 2020
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Update version, usage and history Nov 22, 2019
tests Merge branch 'master' of into fix_invalid… Jan 1, 2020
webvtt Merge branch 'master' of into fix_invalid… Jan 1, 2020
.travis.yml Drop Python3.3 Jun 8, 2018
LICENSE Add license. May 19, 2016 Exclude tests. May 20, 2016
README.rst Drop Python3.3 Jun 8, 2018
pytest.ini Switch to using pytest Sep 21, 2019
requirements.txt Refactor of BOM detection, saving as SRT and output writers Sep 16, 2017 Remove chardet dependency Sep 18, 2017
tox.ini Merge pull request #20 from drape-io/switch_to_pytest Jan 14, 2020


webvtt-py Documentation Status

webvtt-py is a Python module for reading/writing WebVTT caption files. It also features caption segmentation useful when captioning HLS videos.

Requires Python 3.4+.

Documentation is available at


$ pip install webvtt-py


import webvtt

for caption in'captions.vtt'):

Segmenting for HLS

import webvtt

webvtt.segment('captions.vtt', 'output/path')

Converting captions from other formats

Supported formats:

  • SubRip (.srt)
  • YouTube SBV (.sbv)
import webvtt

webvtt = webvtt.from_srt('')

# one liner if we just need to convert without editing


Caption segmentation is also available from the command line:

$ webvtt segment captions.vtt --output destination/directoy


Licensed under the MIT License.

You can’t perform that action at this time.