1
0
Fork 0
Commit Graph

13 Commits

Author SHA1 Message Date
rcombs 7bf1b9b357 lavf/assenc: normalize line endings to \n
Previously, we produced output with either \r\n or mixed line endings.
This was undesirable unto itself, but also made working with patches affecting
FATE output particularly challenging, especially via the mailing list.

Everything that consumes the SSA/ASS format is line-ending-agnostic,
so \n is selected to simplify git/ML usage in FATE.

Extra \r characters at the end of a packet are dropped. These are always
ignored by the renderer anyway.
2024-02-11 17:01:07 -08:00
Oneric b6f5a7ce0c avcodec/ass: specify a permissive encoding
The Encoding field (and the \fe tag) allows to limit font selection to
only those fonts declaring support for the specified codepage in their
OS/2's table "Code Page Character Range" field.
Particularly, Encoding=0 means only font's declaring support for "ANSI",
or rather "Latin (Western European)", are allowed to be selected.
Specifying Encoding=1 allows all fonts to be considered.
We do not want to limit font selection, so specify Encoding=1.

NB: at the time of writing libass only partially supports this field,
thus hiding the issue in any libass-based renderer. A VSFilter-based
DirectShow filter or XySubFilter will reveal the issue when a font not
declaring support for latin characters is specified in a style.
2022-12-03 19:08:44 +01:00
Oneric 95115fcc18 avcodec/ass: accurately preserve colours
Colour values used in ASS files without a "YCbCr Matrix" header set to
"None" are subject to colour mangling, due to how ASS was historically
conceived. A more in-depth description can be found in the documetation
inside libass' public ass_types.h header. The important part is, if this
header is not set to "None", the final output colours can deviate from
the literal value specified in the file. When converting from non-ASS
formats we do not want any colour shift to happen, so let's set the
appropiate header.

NB: ffmpeg's subtitle filter, does not follow libass' documentation
regarding colour mangling, thus hiding the bug. Anything based on
VSFilter, XySubFilter or e.g. mpv do and might show the issue.
(Of course native ASS subs, which _do_ rely on colour mangling won't
 work properly with the subtitle filter, but this can be fixed another
 time)
2022-12-03 19:08:39 +01:00
Oneric e6dcb6a0db avcodec/ass: explicitly set ScaledBorderAndShadow
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-23 00:26:38 +02:00
Clément Bœsch f0f8da545d lavc/htmlsubtitles: improve handling broken garbage
This commit switches off forced correct nesting of tags and only keeps
it for font tags. See long explanations in the code for the rationale.

This results in various FATE changes which I'll explain here:

- various swapping in font attributes, this is mostly noise due to the
  old reverse stack way of printing them. The new one is more correct as
  the last attribute takes over the previous ones.

- unrecognized tags disappears

- invalid tags that were previously displayed aren't anymore (instead,
  we have a warning). This is better for the end user

The main benefit of this commit is to be more tolerant to error, leading
to a better handling of badly nested tags or random wrong formatting for
the end user.
2017-08-01 15:50:00 +02:00
Clément Bœsch 5c219e289e avcodec/srtdec: attempt to correct SubRip positioning
The positioning was completely wrong. First, the coordinates are
expressed in ASS playback resolution (which is by default 384x288).
Secondly, the coordinates define a drawing rectangle, not a moving area.
The previous code was making subtitles move from a random position to
another random position.

Here we rescale assuming the video resolution is a DVD one (720x480). We
can't really do anything better so far, but since this positioning
information is often from a DVD rip we can consider them relatively
safe.
2015-05-14 12:11:34 +02:00
Clément Bœsch 52b0a0ecaa avcodec/ass: add FFmpeg signature 2014-10-15 19:25:06 +02:00
Clément Bœsch 40b9f28641 avcodec/ass: output missing fields in AVSubtitles and output files
Fixes Ticket #3207
2014-10-15 19:25:06 +02:00
Clément Bœsch 8022bb1d92 fate: make subtitles tests output to stdout instead of md5
This makes tracking subtitles changes simpler.
2014-10-15 19:24:39 +02:00
Clément Bœsch 88514378ba avcodec/ass: move playres parameters below scripttype
Suggested-by: wm4
2014-06-18 18:43:36 +02:00
Clément Bœsch 5039aadf68 avcodec/ass: explicit PlayRes[XY]
This avoids the following libass warning when using the subtitles
filter: "Neither PlayResX nor PlayResY defined. Assuming 384x288"

Subtitles tests change because the output is ASS and the PlayRes[XY]
ends up in the output.
2014-06-18 18:22:40 +02:00
Clément Bœsch 0e7782c08e lavc/ass: honor Default style.
The "Default" style written in the header is ignored unless you explicit
it in the Dialogue events (it was valid, just ignored). This requires an
update of the SubRip test since the ASS output obviously changes.
2012-06-29 20:20:02 +02:00
Aurelien Jacobs 2c77c90684 add SubRip decoder
Originally committed as revision 26119 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-28 23:52:53 +00:00