
Video::Subtitle::SRT - manipulate SRT subtitle files

use Video::Subtitle::SRT;
my $subtitle = Video::Subtitle::SRT->new (\&callback);
$subtitle->parse ($fh);
sub callback {
my $data = shift;
# $data->{number}
# $data->{start_time}
# $data->{end_time}
# $data->{text}
}

Video::Subtitle::SRT is a callback based parser to parse SubRip subtitle files (.SRT). See "adjust-srt" in bin how to use this module to create subtitle delay adjusting tools.

Convert an SRT time into a time in milliseconds.
Convert a time in milliseconds into an SRT time.
Given a subtitle {data => 'Words', start_time => srt_time, end_time => srt_time} make that into an SRT subtitle time.
$srt->add ($data);
Add the line to the subtitles.
$srt->write_file ();
Write the file of subtitles to STDOUT.

Exports on request: "srt_time_to_milliseconds", "milliseconds_to_srt_time", "make_subtitle";


The module's creator is Tatsuhiko Miyagawa <miyagawa@bulknews.net>. The module is currently maintained by Ben Bullock <bkb@cpan.org>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.