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

Nicolas George nicolas.george at normalesup.org
Thu Jul 26 21:04:49 CEST 2012

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,

> 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.

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

What do you mean "what should be done"?

> 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.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120726/5c9ea2b4/attachment.asc>

More information about the ffmpeg-devel mailing list