convertfps.pl

Perl script to convert SubRip subtitles' (.srt) file speed
download the script convertfps.pl

convertfps.pl is a Perl script intended to change the displaying speed of subtitles' files in the SubRip (.srt) format.
Current version is 1.0.

This script is released under the CC-GNU-GPL license.
This means that you can use, distribute and modify it freely, as long it always keeps the CC-GNU-GPL license.
More details by clicking on the above link.

You need to install the Getopt::Simple module to run this script.
This Perl script aims at changing the speed of a subtitles' SubRip (.srt) file.
The speed at which subtitles appear is expressed in 'fps', frames per second.
This script asks for the current fps of the .srt file ('infps') and for the desired fps after conversion ('outfps').
For example, if a subtitle appears at 10 seconds in a file at 25 fps, the destination file desired at 20 fps will show that subtitle at (10 x 25) / 20 = 12 seconds 500 msec.
If you have no idea of the current and desired fps, you're bound to try and guess.

Common fps for movies are around 24 - 25 fps. The ratio outfps/infps tells you the "acceleration" you submit your subtitles to (1.0 being the statu quo, of course).


Usage: convertfps.pl [-in inFile -out outFile | -alldir] - infps input_fps -outfps output_fps
No option is mandatory. If you don't specify any, you will be asked for inFile, outFile, input_fps and output_fps.
There are two modes : one file conversion, and all files in the directory conversion.
If you specify -alldir in the command line, you set the "all files" mode. In any other case, you are in the "one file" default mode.

-in inFile : the input subtitles file you want to convert. No control on the name, but if it's not in valid SubRip format, undefined behavior will happen.
-out outFile : the output file to be created ; will be overwritten if it already exists. outFile MUST be different from inFile.
-alldir : if this is set, any specified inFile or outFile value will not be taken into account. ALL files from the current directory (the one where you run this script) ending in '.srt' will be converted and OVERWRITTEN. Be careful to operate on a COPY OF THE ORIGINAL FILES, because your data will be modified without backup and the correct behavior of this script is not guaranteed.
-infps input_fps : estimated fps rate of the movie with which the inFile subtitles' file has been created
-outfps output_fps : desired fps rate for the outFile, ie estimated fps rate of YOUR copy of the movie


Any feedback : contact.

dernière modification : 15.11.2005
manur made this with a text editor in 2005 • contactpage valide XHTML 1.0 et CSS 2.0