[FFmpeg-devel] [PATCH][RFC] ASS decoder/encoder

Reimar Döffinger Reimar.Doeffinger
Tue Aug 10 15:51:12 CEST 2010


On Mon, Aug 09, 2010 at 03:58:06PM +0200, Aurelien Jacobs wrote:
> On Sun, Aug 08, 2010 at 11:55:56AM +0200, Reimar D?ffinger wrote:
> > On Sun, Aug 08, 2010 at 02:26:55AM +0200, Aur?lien Jacobs wrote:
> > > So third patch tries to implement this by passing extradata untouched
> > > from decoder to encoder through a new field in AVCodecContext.
> > > I'm not sure it is the best way to do this, but that's the only working
> > > way I found.
> > 
> > And how is that supposed to work if someone wants to encode data
> > that was not decoded first?
> 
> I not sure to understand what you mean by "not decoded first" (the data
> has to come from somewhere, right ?). But if I try to imagine, I would
> say it would work exactly the same as for a video encoder. You have to
> feed the encoder with parameters plus raw frames. In the case of
> subtitles, it practically mean fead the encoder with a subtitle_header
> plus valid AVSubtitle.
> What problem do you see with this ?

Well, if an application wants to generate some rather simple subtitles
(e.g. from plain text) and allow exporting it in all kinds of formats,
it seems it would like this need to know and support the "header" format
for each subtitle format.
I guess for this case just generating one if none was given would work,
but e.g. what if an application would just want to change the colour?
With your example:

> [V4 Styles]
> Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding
> Style: Ichigo, Verdana, 32, &Hffd5ff, &Hffffff, &H000000, &H000000, -1, 0, 1, 1, 1, 2, 30, 30, 15, 0, 0
> Style: Girls, Verdana, 32, &Haaffaa, &Hffffff, &H000000, &H000000, -1, 0, 1, 1, 1, 2, 30, 30, 15, 0, 0
> Style: Miwa, Verdana, 32, &H80cfff, &Hffffff, &H000000, &H000000, -1, 0, 1, 1, 1, 2, 30, 30, 15, 0, 0
> Style: Default, Verdana, 32, &Hffffaa, &Hffffff, &H000000, &H000000, -1, 0, 1, 1, 1, 2, 30, 30, 15, 0, 0
> Style: KaraRomaji, Times New Roman, 36, &Ha0f1a0, &Hffffff, &H366c00, &H366c00, -1, -1, 1, 1, 0, 6, 10, 10, 15, 0, 0
> Style: Moe, Verdana, 32, &H80ffff, &Hffffff, &H000000, &H000000, -1, 0, 1, 1, 1, 2, 30, 30, 15, 0, 0

It couldn't do that either without knowing the specifics of
each subtitle format either.
And no, I don't have a solution, thus I don't say "no" to your
suggestion, but I do say I don't think it is a good solution
(without claiming whether or not a better one exits).



More information about the ffmpeg-devel mailing list