A PHP port of SubtitleEdit's subtitle conversion.