[FFmpeg-devel] [PATCH v8 08/13] avfilter/overlay_textsubs: Add overlay_textsubs and textsubs2video filters

Soft Works softworkz at hotmail.com
Wed Sep 22 10:44:11 EEST 2021



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Nicolas
> George
> Sent: Wednesday, 22 September 2021 09:17
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v8 08/13] avfilter/overlay_textsubs: Add
> overlay_textsubs and textsubs2video filters
> 
> Soft Works (12021-09-21):
> > - overlay_textsubs {VS -> V)
> >   Overlay text subtitles onto a video stream.
> >
> > - textsubs2video {S -> V)
> >   Converts text subtitles to video frames
> >
> > Signed-off-by: softworkz <softworkz at hotmail.com>
> > ---
> >  configure                         |   2 +
> >  doc/filters.texi                  |  69 ++++
> >  libavfilter/Makefile              |   2 +
> >  libavfilter/allfilters.c          |   2 +
> >  libavfilter/avfilter.c            |  18 +-
> >  libavfilter/vf_overlay_textsubs.c | 615 ++++++++++++++++++++++++++++++
> >  6 files changed, 703 insertions(+), 5 deletions(-)
> >  create mode 100644 libavfilter/vf_overlay_textsubs.c
> 
> This code does not ensure synchronization between its inputs.

Yes, this is intentional, because the synchronization is done by the
ass renderer: you tell the ass renderer for which exact point in time
it should create the overlay images.


The feeding of text events into the ass library is totally independent
from this. You can feed them all at once, incrementally and even in 
reverse order. That doesn't matter as long as your not feeding an event 
before its display time.

In case of ass animations, you'll also want to create new ass overlay
images each time when there's a change - could  even mean for every video
frame (at least at time when animations are to be displayed).


For text textsubs2video that is a bit more difficult as there is not
video input. That's why it has a framerate parameter which determines 
the frequency at which frames are emitted. When there's no change
to the ass pictures, a frame with the previous images is sent, otherwise
it generates a new image for the output frame.









More information about the ffmpeg-devel mailing list