[MPlayer-dev-eng] Re: [PATCH] SSA/ASS subtitles support

Evgeniy Stepanov eugeni.stepanov at gmail.com
Wed Jul 5 17:53:33 CEST 2006


On Wednesday 05 July 2006 14:48, 陆然 wrote:
> Hi,
>
> On Wednesday 05 July 2006 15:54, Evgeniy Stepanov wrote:
> > Sure. I've attached a small function for converting subdata to ass_track.
> > This way, every subtitle format supported by subreader can be displayed
> > with libass. Something like this can be done for mp4 timed text, too.
>
> All right. So all I need is to extract all the subtitles in a file and feed
> them to a ass_read_subdata? That's great.

You won't be able to get multicolored subtitles this way. It is better to 
write your own function using ass_read_subdata as an example.

> BTW, I see the old sub system read a subtitle embeded in the ogg/mkv files
> only when it is needed to be displayed, and the new ssa code in mkv reads
> the subtitles once and for all. Is there any reason for this difference?

Not exactly. New system adds events to ass_track as they are found in the 
stream and keeps them forever. The old system only keeps the latest event, 
which is clearly not enough with ssa.

You can't extract _all_ subtitles in a file until it is completely demuxed. So 
you should allocate an ass_track for each mp4 subtitle track, and update it 
with subs coming from the demuxer. In matroska/ssa case it is implemented in 
ass_process_chunk() and ass_process_line().



More information about the MPlayer-dev-eng mailing list