[FFmpeg-devel] [PATCH] RealText demuxer and decoder.

Clément Bœsch ubitux at gmail.com
Thu Jun 28 00:01:11 CEST 2012


On Sun, Jun 17, 2012 at 02:43:39PM -0700, Philip Langdale wrote:
> On Sat, 16 Jun 2012 22:13:42 +0200
> Clément Bœsch <ubitux at gmail.com> wrote:
> 
> > +static int realtext_decode_frame(AVCodecContext *avctx,
> > +                                 void *data, int *got_sub_ptr,
> > AVPacket *avpkt) +{
> > +    AVSubtitle *sub = data;
> > +    const char *ptr = avpkt->data;
> > +    AVBPrint buf;
> > +
> > +    av_bprint_init(&buf, 0, 4096);
> > +    if (ptr && avpkt->size > 0 && !rt_event_to_ass(&buf, ptr))
> > +        ff_ass_add_rect(sub, buf.str, avpkt->pts, avpkt->duration,
> > 0);
> 
> Don't you need to rescale the pts and duration? I know I had to for
> mov_text.
> 

Oh, I almost missed this comment, sorry. Do you have an example where I
would need it?

Note that it's not done in SubRip (which served as a base for JacoSUB,
SAMI or RT). Maybe there is something to fix, but I can't figure out in
what case it would be necessary, since we set a constant value for the PTS
info in the demuxer (this is not the case for MicroDVD for instance, and
there are indeed some rescale in the decoder).

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120628/c911c8f9/attachment.asc>


More information about the ffmpeg-devel mailing list