3

I know how to transform .srt file format to webvtt format in javascript , I want to know how to do the same with .ass & .ssa subtitles files formats to be able to parse them and transform to webvtt format on the fly without using file stream using javascript .

Ahmed Maher
  • 1,521
  • 17
  • 22
  • Do you have the .ass files as a source? Why don't you want to use some parser https://www.npmjs.com/package/ass-parser or https://www.npmjs.com/package/ass-to-vtt And if you need just a text and timestamps and don't need fancy features like colors, fonts, position, etc. it could be extracted quite easy. I'm not sure what do you mean 'on the fly'. Line by line? Or just without saving an output files? – Yuri Khristich Nov 08 '20 at 09:27
  • ass-to-vtt uses file stream and I want to get it done on the fly as stated in the question, i send xhr request to grab the text from a file and store it in a string. ass parser doesn't transform .ass to .srt or .webvtt directly . – Ahmed Maher Nov 10 '20 at 08:20

1 Answers1

3

After a deep search I found what I asked for in an underrated Github repo online named subsrt, can be found here for whoever encounters the same request or similar. it transforms between the following subtitles formats :

MicroDVD SUB (.sub), SubRip (.srt), SubViewer (.sbv), WebVTT (.vtt), SubStation Alpha (.ssa and .ass), SAMI (.smi) aka Synchronized Accessible Media Interchange, LRC (.lrc) aka LyRiCs, JSON (.json)

Ahmed Maher
  • 1,521
  • 17
  • 22