[FFmpeg-devel] [PATCH] ffmpeg: insert bitmap subtitles as video in filters.

Clément Bœsch ubitux at gmail.com
Thu Jul 26 22:13:43 CEST 2012

On Thu, Jul 26, 2012 at 09:04:49PM +0200, Nicolas George wrote:
> Le nonidi 9 thermidor, an CCXX, Clément Bœsch a écrit :
> > Will this be enough to drop the bitmap hardsub from ffplay?
> I do not think so. For one, ffplay does not support complex filters. Also,
> this method is very inefficient, as it builds a frame at the whole video
> size while subtitles usually occupy only a small part of the image.
> Furthermore, I am afraid vf_overlay reacts badly to seeks backwards.
> > I'm wondering: what about dropping the "Note" and...
> > ... change overlay into "burnsub" (or similar), just by making
> > (temporarily) burnsub an alias for overlay. The main benefit will be that
> > when we make the real burnsub filter, nothing will change for the user;
> > the hack is hidden from a user point of view.
> I don't know, I am not sure this is a good idea. We are too far from having
> real support for subtitles to know how things will work. The constraint to
> keep the final version compatible to this early hack may prove too annoying.
> Also, there are constructs that will necessarily change: adjusting the time
> is done with the setpts filter, it will be done with the ssetpts filter; if
> the canvas size (see below) needs to be set, it may be a different system,
> etc.


> > It might require to write a special init function to add a few sanity
> > checks; for example to prevent users from trying to hardsub a text
> > subtitles (print a message that make sense when he is trying to, and
> > eventually redirect him to a long text about the issue).
> There is already an error message if the subtitle is not a bitmap.

I wasn't sure it would have been triggered in case you'd followed my

> > Could you add a TODO/FIXME/XXX/whatever to describe a bit what should be
> > done?
> What do you mean "what should be done"?

Not much, just a message saying something like "FIXME: waiting for
libavfilter to support subtitles to remove this hack" or something like

> > I'm not familiar with bitmap subtitles so I can't comment much on the rest
> > of the patch.
> They are not very complex: you just have n PAL8 images with the coordinates
> of the corner. The catch is there is no information about the size of the
> frame they are supposed to be applied on, at least on DVD and DVB formats.
> For that, I used the largest video in the same file, but it may become
> necessary to make it an option.

Interesting, I was wondering about that when experimenting with ASS
hardsubbing. Will that work with resolution changes?


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/20120726/94fea223/attachment.asc>

More information about the ffmpeg-devel mailing list