[FFmpeg-devel] [PATCH] avcodec/ccaption_dec: Make real-time latency configurable

Pavel Koshevoy pkoshevoy at gmail.com
Wed May 26 14:48:14 EEST 2021


On Wed, May 26, 2021, 00:18 Moritz Barsnick <barsnick at gmx.net> wrote:

> On Tue, May 25, 2021 at 20:16:29 -0600, Pavel Koshevoy wrote:
> > -        sub->pts > ctx->last_real_time + av_rescale_q(200, ms_tb,
> AV_TIME_BASE_Q)) {
> > +        sub->pts >= ctx->last_real_time +
> av_rescale_q(ctx->real_time_latency_msec, ms_tb, AV_TIME_BASE_Q)) {
> [...]
> > +    { "real_time_latency_msec", "minimum elapsed time between emitting
> real-time subtitle events", OFFSET(real_time_latency_msec),
> AV_OPT_TYPE_INT, { .i64 = 201 }, 0, 500, SD, "data_field" },
>
> So why now 201 instead of 200 ms?
>

Because it is >= now, instead of >.
I can leave it at 200, I don't really care -- I will personally only use it
at 0.
The problem with delaying realtime output by any amount is that it is
unknown when the next byte pair that would trigger output will happen. It
may be at 200ms, or it may be several seconds later -- that's not realtime
at all.

Do I need to bump any version numbers?

Thank you,
    Pavel


More information about the ffmpeg-devel mailing list