[FFmpeg-devel] [PATCH] SubRip decoder

Alexander Strange astrange
Thu Dec 9 23:46:32 CET 2010

On Dec 8, 2010, at 5:41 PM, Aurelien Jacobs wrote:

> On Wed, Dec 08, 2010 at 02:03:48AM -0500, Alexander Strange wrote:
>> On Dec 4, 2010, at 9:58 AM, Aurelien Jacobs wrote:
>>> On Sun, Nov 28, 2010 at 05:53:04PM -0500, Alexander Strange wrote:
>>>> On Nov 28, 2010, at 5:31 PM, Aurelien Jacobs wrote:
>>>>> Hi,
>>>>> $subject
>>>>> This SubRip decoder supports all the SubRip features that I know about.
>>>>> It especially support everything tested by the sample files from
>>>>> http://ale5000.altervista.org/subtitles.htm
>>>> [...]
>>>>> +    snprintf(header, sizeof(header),
>>>>> +             "[Script Info]\r\n"
>>>>> +             "ScriptType: v4.00+\r\n"
>>>>> +             "\r\n"
>>>>> +             "[V4+ Styles]\r\n"
>>>> Watch out for the weird default PlayRes* values.
>>> The default is 384x288.
>>> Do you think I should choose another default value ?
>> If you're happy with the current font size, I guess it's OK.
>> But actually there's another problem - this sets a hardcoded style
>> named Default,
> Yes.
>> so players will render with that style.
> No. At least that's not what the ASS spec says:
> 5. Dialogue event lines, [Events] section
> [...]
> Field 4: Style
>         Style name. If it is "Default", then your own *Default style
>         will be subtituted.
>         However, the Default style used by the script author IS stored
>         in the script even though SSA ignores it - so if you want to
>         use it, the information is there - you could even change the
>         Name in the Style definition line, so that it will appear in
>         the list of "script" styles.
> So we store the Default style of the "authoring software" in the script,
> as a reference (or for non-compilant software) but the player should
> ignore it and use its own default style.

Well, usually ass-spec.doc isn't too far wrong, but VSFilter doesn't do this at all.
It sets a style named "Default" before loading the file, and then sets the styles in the file over that. It ignores * as the first character of all style name definitions(!) but doesn't otherwise have a style named *Default.

>> I think it's expected that srt should be rendered with the "default"
>> style of the player.
> Yes,and that's exactly how the generated ASS should be rendered too.
>> How about not emitting a Style: line at all, and setting the style
>> of each subtitle to "*Default" (IIRC what the built-in default ASS
>> style is called)?
> I'm pretty certain this would break some renderer.

Looks like the style per-subtitle should be Default with no Style: line. That definitely works with VSFilter, and therefore every other renderer (which is just Perian and libass).

More information about the ffmpeg-devel mailing list