[FFmpeg-devel] [RFC] Talk about subtitles

Clément Bœsch ubitux at gmail.com
Sat Nov 26 12:23:37 CET 2011


On Fri, Nov 25, 2011 at 07:48:42PM +0100, Reimar Döffinger wrote:
[...]
> >  - hardsub: I would see a -vf subtitles=f=inputsub.srt:... just like the
> >    proposed vf_ass. That filter would actually decode any kind of
> >    subtitles (SRT included) and burn them with the appropriate settings.
> >    To decode the subtitles and get the bitmap it would use libass, but
> >    through the API.
> 
> Unless it is a source filter a filter has no business messing with files
> directly. And I don't see why you should need or want any other filter
> than src_movie, which already will have to handle subtitles anyway.
> You then have AVSubtitle structs you can pass around - and they will
> only have one of bitmap, ASS or plaintext - having a whole library
> just for converting between those seems a bit like overkill.
> By making the reading, decoding and hardsubbing a single filter you
> destroy any possibility of doing any kind of processing without having
> to implement it twice, once for soft- and once for hardsub.
> E.g. adjusting the aspect of the subs, delaying it, adjusting
> contrast/brightness, coloring them, ...
> 
> > In order to write the filter, we need to have an API that decode almost
> > every subtitles and get the bitmap (and also deal with the fonts, that is
> > an issue I forgot to mention earlier). How would that filter work? I guess
> > it could call avformat/avcodec open routines, and decode it just like
> > ffmpeg.c does, then just update the frame when the pts match.
> 
> src_movie should handle the opening and decoding, hopefully with not
> much additional code.

Ah, excellent idea the use of src_movie, it should solve a few things. So
maybe we would "just" move the libass code (from vf_ass) to src_movie, and
use overlay filter to burn the subtitles?

I guess that should do the trick, even though it will complicate the usage
a bit (that's what was worrying me after Nicolas' mail). I'll look more in
that direction, thanks!

-- 
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/20111126/431093f7/attachment.asc>


More information about the ffmpeg-devel mailing list