[FFmpeg-devel] [PATCH] Text subtitle decoder
Peter Ross
pross
Sun Nov 28 12:52:23 CET 2010
On Sat, Nov 27, 2010 at 06:16:45PM +0100, Aurelien Jacobs wrote:
> On Sat, Nov 27, 2010 at 09:43:01PM +1100, Peter Ross wrote:
> > $subject (Purging my patch queue.)
> > diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> > index fbae0f6..3aa28b2 100644
> > --- a/libavcodec/allcodecs.c
> > +++ b/libavcodec/allcodecs.c
> > @@ -346,6 +346,7 @@ void avcodec_register_all(void)
> > REGISTER_ENCDEC (DVBSUB, dvbsub);
> > REGISTER_ENCDEC (DVDSUB, dvdsub);
> > REGISTER_DECODER (PGSSUB, pgssub);
> > + REGISTER_ENCDEC (TEXT, text);
>
> ENCDEC ???
Noted.
> > diff --git a/libavcodec/text.c b/libavcodec/text.c
> > new file mode 100644
> > index 0000000..5876a94
> > --- /dev/null
> > +++ b/libavcodec/text.c
> > @@ -0,0 +1,61 @@
> > + sub->end_display_time = pts + 500;
>
> Why pts + 500 ???
There is no 'end' time.
> More generally, what is this decoder useful for ?
> Currently, there are only 3 demuxers which produce CODEC_ID_TEXT streams:
> matroska, nut and ogm.
> For both matroska and ogm this is plain wrong to use CODEC_ID_TEXT, as
> those streams contains in fact SubRip formated text (including some html
> like formatting, like <b>, <font size="20">, etc...). I will fix both of
> them very soon now, so that they output CODEC_ID_SRT instead.
> So this will leave us with nut as the only demuxer producing
> CODEC_ID_TEXT. I don't know if this type of track is really used in
> actual files, and if it is a good idea to support this kind "codec"
> that is used nowhere else, but my gut feeling says that we should just
> drop CODEC_ID_TEXT entirely.
Its a toy, tested with some sample Matroska files containg UTF-8 text.
If nothing more, it highlights that CODEC_ID_TEXT is inadequate.
btw, have you had any thoughts one subtitle format conversion API,
e.g. converting SUBTITLE_ASS to SUBTITLE_BITMAP, for display in FFmpeg.
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101128/e21737a2/attachment.pgp>
More information about the ffmpeg-devel
mailing list