How do I convert .vtt subtitle file into segments (.m3u8)?

419 Views Asked by At

I have acquired an m3u8 URL extracted from a website, and my current objective is to incorporate subtitles into it. Fortunately, the website offers subtitle files in .vtt format. However, there is a notable challenge: it seems that only a segmented version of the .vtt file can be imported.

Video m3u8 files and .vtt files can be accessed via the following links:

I've attempted to use the webvtt-py package for Python to convert the .vtt file into segments. However, when I imported the subtitles m3u8 file into the master playlist, the subtitles appeared as options, but selecting them didn't work.

Here is my master playlist:

#EXTM3U

#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=YES,AUTOSELECT=YES,FORCED=YES,LANGUAGE="en",URI="subs/en.m3u8"

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=600000,SUBTITLES="subs"
https://owt.webarchivecdn.com/_v10/fa70737f10c90fb9005bc60753a5b63cc58504583975167068e7e3923f789dcf8a0730a9efefae7749f75cad7614c651bb0378d7cbb39c9c0afbcb884e2de8c1a32fb328eb3458ab23bec1290196a67b02011a01df4a6324c5866132d42c412cb69ee880961b79baa7f92f84bc2f0702958f901f4720f9c3f174e1122957f9942bfa8cda2e60564d4a86af2f7de7faeb/360/index.m3u8

This is the code I used to convert the .vtt file to segments:

import webvtt

webvtt.segment("sub.vtt", "subs")

Could someone please let me know what's wrong?

Kind Regards, Sabbir

0

There are 0 best solutions below