Bug #695

Subtitle Size differs between .srt and .ass

Added by Ca Ra over 9 years ago. Updated over 8 years ago.

Status:FixedStart date:09/11/2011
Priority:NormalDue date:
Assignee:Andreas Smas% Done:

100%

Category:Subtitles
Target version:4.0
Found in version:3.1.126 Platform:PS3

Description

First off, great work.

Most of the bugs/features I would like have already been mentioned or are planned.
But there is an issue (which I don't know if it is on purpose) with subtitles.
There is an option of subtitle size (don't know if this is the exact name)
which works great. The thing is, if you set it for a .srt, all of the films you watch
will have that same size. However, if you later watch a film with a simple (non styled)
.ass subtitle, the size will be bigger (still a bit). If you adjust the size to look smaller,
when you watch another with a .srt, they will look small.

What I would like is to know if this is on purpose, and if it's not,
if it would be possible to standardize the size option to all of the supported subtitle formats.

Thank you and keep up the good work!

Associated revisions

Revision 6f6ad04f
Added by Andreas Smas over 8 years ago

ass: If subtitle override is set, don't pick fontsize from styles

Fixes #695

Change included in version 3.99.524

History

#1 Updated by Jérôme S. over 9 years ago

are you sure your .ass does not contain any style definition, even a default one, which specify a size ?

#2 Updated by Ca Ra over 9 years ago

I don't know. It's not an anime release, so I don't think so.

I will test that when I have the chance.

If anyone wants to test it before I post the results here, this is what I'll do:
1. open any .srt subtitle with subtitle workshop.
2. save it as .ass
3. test them both

I can't test this now but when I do, I'll post the results here

#3 Updated by Jérôme S. over 9 years ago

Not only anime have styled sub. EVERY ass/ssa have style. That's why I asked you to check, even if I'm quite sure.
Look at your ass subtitle, you should have something like :

[V4 Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding
Style: Default,Sans,18,16777215,65535,30900,0,0,0,1,0,0,2,20,20,20,0,0

So here you can see font size at 18.
ASS/SSA are for styled sub.

#4 Updated by Ca Ra over 9 years ago

I should also have mentioned that I have the "ignore .ass specific stuff"
option enabled.

Like I said, I cannot test this right now.
I will and will put my results here.

#5 Updated by Andreas Smas over 9 years ago

  • Target version set to 33

#6 Updated by Andreas Smas over 9 years ago

  • Status changed from New to Accepted

#7 Updated by Ca Ra over 9 years ago

Now that I have a working DEV environment, I tried some changes.

this fix makes showtime prioritize external subtitles over internal (usually, if you have an external, you want to use that one)

file: fa_video.c
line: 110

  int scoreBonus = 0;
  if(subtitle_settings.always_select)
    scoreBonus +=999;

  TAILQ_FOREACH(fde, &fd->fd_entries, fde_link) {

    if(fde->fde_type == CONTENT_DIR && !strcasecmp(fde->fde_filename, "subs")) {
      fs_sub_scan_dir(prop, fde->fde_url, video);
      continue;
    }

    postfix = strrchr(fde->fde_filename, '.');
    if(postfix != NULL && !strcasecmp(postfix, ".srt")) {
      const char *lang = NULL;
      if(postfix - fde->fde_filename > 4 && postfix[-4] == '.') {
    char b[4];
    memcpy(b, postfix - 3, 3);
    b[3] = 0;
    lang = isolang_iso2lang(b);
      }

      int score = (video && fs_sub_match(video, fde->fde_url)) + scoreBonus;

      mp_add_track(prop, fde->fde_filename, fde->fde_url, "SRT", NULL, lang,
           NULL, _p("External file"), score);
    }
  }

It's not the best of fixes but I don't know the score interval or increments and I've tested this one and it's working good.

trying to fix this particular issue (size difference), I found that one could apply default size to the (style_override) option

 if(as == &ass_style_default || subtitle_settings.style_override) {

    ad_txt_append(ad, TR_CODE_SIZE_PX | 26);

    ad_txt_append(ad, TR_CODE_COLOR | subtitle_settings.color);
    ad_txt_append(ad, TR_CODE_OUTLINE_COLOR | subtitle_settings.outline_color);
    ad_txt_append(ad, TR_CODE_SHADOW_COLOR | subtitle_settings.shadow_color);

    ad_txt_append(ad, TR_CODE_SHADOW | subtitle_settings.shadow_displacement);
    ad_txt_append(ad, TR_CODE_OUTLINE | subtitle_settings.outline_size);

  } else {

    ad_txt_append(ad, TR_CODE_SIZE_PX | as->as_fontsize);

    ad_txt_append(ad, TR_CODE_COLOR | (as->as_primary_color & 0xffffff));
    ad_txt_append(ad, TR_CODE_ALPHA | (as->as_primary_color >> 24));
    ad_txt_append(ad, TR_CODE_OUTLINE_COLOR |(as->as_outline_color & 0xffffff));
    ad_txt_append(ad, TR_CODE_OUTLINE_ALPHA | (as->as_outline_color >> 24));
    ad_txt_append(ad, TR_CODE_SHADOW_COLOR | (as->as_back_color & 0xffffff));
    ad_txt_append(ad, TR_CODE_SHADOW_ALPHA | (as->as_back_color >> 24));

this fix didn't work on all the .ass I tested. Pointers on where this is done would be appreciated.

#8 Updated by Ca Ra over 9 years ago

PS: sorry, the last snippet is on
File: sub_ass.c
line: 460

#9 Updated by Andreas Smas almost 9 years ago

  • Target version changed from 33 to 4.0

#10 Updated by Andreas Smas over 8 years ago

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

Also available in: Atom PDF