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

Aurelien Jacobs aurel
Mon Aug 9 15:58:06 CEST 2010


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 ?

> In theory (reality often means a compromise is better) the extradata
> should be decoded by the decoder into individual fields that then
> can be set via normal command-line options for the encoder.

I thought about this too. But in this precise case, it seems really
unpractical. Here is a simple example I have handy (it often gets much
bigger than this):

[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

Aurel



More information about the ffmpeg-devel mailing list