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 11d29277d6 tests/subtitles: fix microdvd crlf in ref 2015-04-27 18:23:32 +02:00
wm4 48f27b78f4 microdvd: do not export framerate hint as subtitle packet
MicroDVD has a "hack" for specifying the video framerate the subtitle
was authored against. The demuxer reads this hint correctly, but didn't
skip it correctly.

This was not noticed, because the exported packet has its duration set
to 0, making it invisible (depending on the API user's rendering logic).

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-08 20:58:25 +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 1f265f5205 microdvd: sanitize AVPackets.
Current MicroDVD AVPackets contain timing information and trailing line
breaks. The data is now only composed of the markup data. Doing this
consistently between text subtitles decoders allows to use different
codec for various formats. For instance, MicroDVD markup is sometimes
found in some VPlayer files. Also, generally speaking, the subtitles
text decoders have no use of these timings (and they must not use them
since it would break any user timing adjustment).

Technically, this is a major ABI break. In practice, a mismatching
lavf/lavc will now error out for MicroDVD decoding. Supporting both
formats requires unnecessary complex and fragile code.

FATE needs update because line breaks in the ASS file were "\n" (because
that's what is used in the original file). ASS format expect "\r\n" line
breaks; this commit fixes this issue. Also note that this "\r\n"
trailing need to be moved at some point from the decoders to the ASS
muxer.
2012-12-31 00:41:35 +01:00
Clément Bœsch e301f2f8c6 fate: add JacoSUB and MicroDVD subtitles tests. 2012-06-29 20:20:02 +02:00