SRT⟷ASS Converter
Convert SRT file to ASS file and vise versa.
Author: Panji Kusuma (epanji@gmail.com)
- Detail timing will change due to milliseconds and centiseconds different.
- Information such as title, style and some modifiers will loss due to conversion.
- Only bold, italic, underline,
strikeoutand colors will be preserve. - Global styles did not preserve like local modifiers.
Convert file.srt to file.ass with adjustment options:
SANVERTER> (convert-srt-to-ass #p"bad-source.srt" :output #p"tmp.ass" :title "Temporary" :primary-colour "blue violet")
#P"tmp.ass"
Convert file.ass to file.srt with optional output:
SANVERTER> (convert-ass-to-srt #p"bad-source.ass" :output #p"tmp.srt")
#P"tmp.srt"
Parsing SRT format:
SANVERTER> (parse-subrip #p"bad-source.srt")
Parsing VTT format:
SANVERTER> (parse-subrip #p"bad-source.vtt")
Parsing ASS format:
SANVERTER> (parse-subass #p"bad-source.ass")
Printing SRT format:
SANVERTER> (print-subrip #p"bad-source.srt")
Printing VTT format:
SANVERTER> (print-subrip #p"bad-source.vtt" "en")
Printing ASS format:
SANVERTER> (print-subass #p"bad-source.ass")
Printing SRT format:
SANVERTER> (print-subrip #p"bad-source.ass")
SANVERTER> (print-subrip #p"bad-source.vtt")
Printing VTT format:
SANVERTER> (print-subrip #p"bad-source.ass" "en")
SANVERTER> (print-subrip #p"bad-source.srt" "en")
Printing ASS format:
SANVERTER> (print-subass #p"bad-source.srt")
SANVERTER> (print-subass #p"bad-source.vtt")
Printing from bad source will be corrected.
Before | After |
---|---|
|
|
|
|
This is SANVERTER when running with ABCL (Armed Bear Common Lisp) in JVM (Java Virtual Machine)
This is command line interface build with ECL (Embeddable Common Lisp).
Conversions
$ ./sanverter -f vtt ../bad-source.srt
Success converting ../bad-source.srt to ../bad-source.vtt.
$ ./sanverter -f srt ../bad-source.vtt
File ../bad-source.srt already exists.
$ ./sanverter -e nil -f srt ../bad-source.vtt
1
00:00:00,000 --> 00:01:20,000
Hello world!
2
00:01:20,000 --> 00:02:40,000
<font color="#1A2B3C">Hello <b>world</b>!</font>
3
00:02:40,000 --> 00:04:00,000
<font color="#AABBCC">Hello <b>world!
Hello world!</b></font>
Corrections
$ ./sanverter -f srt ../bad-source.srt
Convert nothing for ../bad-source.srt with option '-f srt' or '--format srt'.
If you are sure about this, add option '-c' or '--corrections'.
$ ./sanverter -c -f srt ../bad-source.srt
Success converting ../bad-source.srt to ../bad-source-rev.srt.
For more options:
$ ./sanverter --help