Feature #1892

TMPlayer subtitles support

Added by Leonid Protasov about 7 years ago. Updated about 7 years ago.

Status:FixedStart date:01/29/2014
Priority:NormalDue date:
Assignee:Andreas Smas% Done:

100%

Category:Subtitles
Target version:4.6

Description

Example:
http://dl.opensubtitles.org/en/download/filead/src-api/vrf-8abcb803f7/1952162782.gz

00:04:26:- Niiic...|- Nie najlepiej? Myślałeś o mnie.

Format is self describing. '|' is new line mark.

Timestamp is HH:MM:SS of playtime.


Related issues

Related to Bug #2002: Strings beginning from '/' are not displayed as italic (T... Fixed 02/19/2014

Associated revisions

Revision df50f5da
Added by Andreas Smas about 7 years ago

Add support for TMPlayer subtitle format

Fixes #1892

Change included in version 4.5.81

History

#1 Updated by Andreas Smas about 7 years ago

  • Status changed from New to Accepted

I wonder for how long each subtitle should be displayed?

Not until the next one appears I suppose. Maybe 5 seconds or so.

#2 Updated by Leonid Protasov about 7 years ago

Looks like.

#3 Updated by Leonid Protasov about 7 years ago

  • Subject changed from TMP subtitles support to TMPlayer subtitles support

#4 Updated by Leonid Protasov about 7 years ago

It also uses {y:i} tags:

01:48:59:{y:i}Ведите себя тихо.

#5 Updated by Leonid Protasov about 7 years ago

  • Target version set to 4.6

#6 Updated by Leonid Protasov about 7 years ago

Andreas Öman wrote:

I wonder for how long each subtitle should be displayed?

Not until the next one appears I suppose. Maybe 5 seconds or so.

        public static double GetOptimalDisplayMilliseconds(string text)
        {
            return GetOptimalDisplayMilliseconds(text, Configuration.Settings.General.SubtitleOptimalCharactersPerSeconds);
        }

        public static double GetOptimalDisplayMilliseconds(string text, double charactersPerSecond)
        {
            double optimalCharactersPerSecond = charactersPerSecond;
            if (optimalCharactersPerSecond < 2 || optimalCharactersPerSecond > 100)
                optimalCharactersPerSecond = 14.7;
            double duration = (RemoveHtmlTags(text, true).Length / optimalCharactersPerSecond) * 1000.0;

            if (duration < Configuration.Settings.General.SubtitleMinimumDisplayMilliseconds)
                duration = Configuration.Settings.General.SubtitleMinimumDisplayMilliseconds;

            if (duration > Configuration.Settings.General.SubtitleMaximumDisplayMilliseconds)
                duration = Configuration.Settings.General.SubtitleMaximumDisplayMilliseconds;

            return duration;
        }

#7 Updated by Andreas Smas about 7 years ago

  • Status changed from Accepted to Fixed
  • % Done changed from 0 to 100

Applied in changeset git|commit:df50f5da3bd3bd574f7eff89a63840045536d37a.

Also available in: Atom PDF