Message ID | 20210502210201.25045-1-oneric@oneric.de |
---|---|
State | Accepted |
Commit | 3300625c6f148455b08d641597d54b5be4c0f76a |
Headers | show |
Series | [FFmpeg-devel] avfilter/vf_subtitles: allow using embedded fonts | expand |
Context | Check | Description |
---|---|---|
andriy/x86_make | success | Make finished |
andriy/x86_make_fate | success | Make fate finished |
andriy/PPC64_make | success | Make finished |
andriy/PPC64_make_fate | success | Make fate finished |
On Sun, May 02, 2021 at 23:02:02 +0200, Oneric wrote: > ASS subtitles can have encoded fonts embedded into the subtitle file > itself. Allow libass to load those, to render subs as intended. > --- > libavfilter/vf_subtitles.c | 1 + > 1 file changed, 1 insertion(+) pinging for review
On Sun, May 02, 2021 at 23:02:02 +0200, Oneric wrote: > ASS subtitles can have encoded fonts embedded into the subtitle file > itself. Allow libass to load those, to render subs as intended. > --- > libavfilter/vf_subtitles.c | 1 + > 1 file changed, 1 insertion(+) pinging again
On Sun, May 02, 2021 at 23:02:02 +0200, Oneric wrote: > ASS subtitles can have encoded fonts embedded into the subtitle file > itself. Allow libass to load those, to render subs as intended. > --- > libavfilter/vf_subtitles.c | 1 + > 1 file changed, 1 insertion(+) another ping
On 2021-05-28 23:26, Oneric wrote: > On Sun, May 02, 2021 at 23:02:02 +0200, Oneric wrote: >> ASS subtitles can have encoded fonts embedded into the subtitle file >> itself. Allow libass to load those, to render subs as intended. >> --- >> libavfilter/vf_subtitles.c | 1 + >> 1 file changed, 1 insertion(+) > another ping I'll test this and apply. Gyan
On 2021-05-29 11:07, Gyan Doshi wrote: > > > On 2021-05-28 23:26, Oneric wrote: >> On Sun, May 02, 2021 at 23:02:02 +0200, Oneric wrote: >>> ASS subtitles can have encoded fonts embedded into the subtitle file >>> itself. Allow libass to load those, to render subs as intended. >>> --- >>> libavfilter/vf_subtitles.c | 1 + >>> 1 file changed, 1 insertion(+) >> another ping > > I'll test this and apply. Pushed as 3300625c6f148455b08d641597d54b5be4c0f76a Gyan
On 2021-05-29 11:51, Gyan Doshi wrote: > > > On 2021-05-29 11:07, Gyan Doshi wrote: >> >> >> On 2021-05-28 23:26, Oneric wrote: >>> On Sun, May 02, 2021 at 23:02:02 +0200, Oneric wrote: >>>> ASS subtitles can have encoded fonts embedded into the subtitle file >>>> itself. Allow libass to load those, to render subs as intended. >>>> --- >>>> libavfilter/vf_subtitles.c | 1 + >>>> 1 file changed, 1 insertion(+) >>> another ping >> >> I'll test this and apply. > > Pushed as 3300625c6f148455b08d641597d54b5be4c0f76a Would it make sense to allow users to not load embedded fonts? Gyan
On Sat, May 29, 2021 at 11:53:24 +0530, Gyan Doshi wrote: > On 2021-05-29 11:51, Gyan Doshi wrote: > > On 2021-05-29 11:07, Gyan Doshi wrote: > > > I'll test this and apply. > > > > Pushed as 3300625c6f148455b08d641597d54b5be4c0f76a > > Would it make sense to allow users to not load embedded fonts? Thanks! I can't think of a reason not to load embedded fonts in ffmpeg; they are required to render subs as intended by the sub author. Without them some fallback font from the system or mkv-attachments will be used instead (which if the requested font doesn't by chance happen to also be available on the system or as a container-attachment, will be some, more or less random font). VLC always enables this unconditionally, but mplayer and mpv have an option for this defaulting to embedded fonts enabled, but as before I don't know why anyone would want to disable this. Oneric
On 2021-05-29 22:14, Oneric wrote: > On Sat, May 29, 2021 at 11:53:24 +0530, Gyan Doshi wrote: >> On 2021-05-29 11:51, Gyan Doshi wrote: >>> On 2021-05-29 11:07, Gyan Doshi wrote: >>>> I'll test this and apply. >>> Pushed as 3300625c6f148455b08d641597d54b5be4c0f76a >> Would it make sense to allow users to not load embedded fonts? > Thanks! > I can't think of a reason not to load embedded fonts in ffmpeg; they are > required to render subs as intended by the sub author. Without them some > fallback font from the system or mkv-attachments will be used instead > (which if the requested font doesn't by chance happen to also be available > on the system or as a container-attachment, will be some, more or > less random font). > VLC always enables this unconditionally, but mplayer and mpv have an option > for this defaulting to embedded fonts enabled, but as before I don't know why > anyone would want to disable this. Security reasons? Regards, Gyan
On Sat, May 29, 2021 at 22:54:44 +0530, Gyan Doshi wrote: > On 2021-05-29 22:14, Oneric wrote: > > On Sat, May 29, 2021 at 11:53:24 +0530, Gyan Doshi wrote: > > > Would it make sense to allow users to not load embedded fonts? > > > > I can't think of a reason not to load embedded fonts in ffmpeg; they are > > required to render subs as intended by the sub author. Without them some > > fallback font from the system or mkv-attachments will be used instead > > (which if the requested font doesn't by chance happen to also be available > > on the system or as a container-attachment, will be some, more or > > less random font). > > VLC always enables this unconditionally, but mplayer and mpv have an option > > for this defaulting to embedded fonts enabled, but as before I don't know why > > anyone would want to disable this. > > Security reasons? If one expects processing a font file to expose (relevantly) more attack surface, or be more dangerous than the rest of untrusted ASS files, than perhaps yes. Otherwise, I at least can't think of something right now. Cheers Oneric
diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c index 493eb5f424..ab32e1b7f3 100644 --- a/libavfilter/vf_subtitles.c +++ b/libavfilter/vf_subtitles.c @@ -111,6 +111,7 @@ static av_cold int init(AVFilterContext *ctx) ass_set_message_cb(ass->library, ass_log, ctx); ass_set_fonts_dir(ass->library, ass->fontsdir); + ass_set_extract_fonts(ass->library, 1); ass->renderer = ass_renderer_init(ass->library); if (!ass->renderer) {