[FFmpeg-devel] [PATCH] new codec id for SSA/ASS subtitles

Aurelien Jacobs aurel
Sat Dec 29 21:49:45 CET 2007


On Sat, 29 Dec 2007 22:51:01 +0300
Evgeniy Stepanov <eugeni.stepanov at gmail.com> wrote:

> On Saturday 29 December 2007 22:32:56 Aurelien Jacobs wrote:
> > On Sat, 29 Dec 2007 18:42:46 +0300
> >
> > Evgeniy Stepanov <eugeni.stepanov at gmail.com> wrote:
> > > Hi,
> > >
> > > current matroska demuxer mangles SSA/ASS subtitles by stripping 8 leading
> > > fields from each line in an effort to make them look like plaintext
> > > subtitles. I believe that conversion between different formats is not a
> > > dexumer's job.
> >
> > I agree. That was just a simple way to get those subtitles at least
> > partly working. Right now, MPlayer display them properly as plain text.
> >
> > > With this patch, SSA/ASS subtitles are kept unchanged. To distinguish
> > > them from simple plaintext subtitles, a new codec id is added.
> >
> > That's something desirable. And I'm willing to apply this patch.
> > But this will break playback of those subtitles in MPlayer.
> > Do you plan to improve MPlayer's demux_lavf so that it supports
> > SSA subtitles ?
> 
> I do.

Great. I can't wait to see this.
=> Patch applied.

> > Also I gave one more look at SSA specs, and I think we may need
> > to append the following text to the extradata so that a clean
> > SSA decoder can decode packets payload without having to guess
> > fields contents:
> >
> > [Events]
> > Format: ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect,
> > Text
> >
> > At least that's what I deduced from:
> > http://www.matroska.org/technical/specs/subtitles/ssa.html
> > Do you agree with this ?
> 
> I think this document is outdated. There are files that require this, but they 
> are quite rare. All of them seem to have been created with some old version 
> of mkvmerge. Newer mkvmerge versions, as well as libass, add these lines if 
> they are not already present.

Oh, indeed, I've only checked with one very old mkv file.

> So, this is a workaround for some ancient files. It probably belongs in 
> demuxer. But this lines should only be added if they are not already present. 
> Also, notice that they differ for SSA and ASS (see libass/ass.c:715). And, at 
> least with libass, this is not required.

Well, this workaround can be added later. Not a problem for now.

Aurel




More information about the ffmpeg-devel mailing list