[FFmpeg-devel] DVD subtitles
Wed Feb 27 19:13:16 CET 2008
Erik Slagter wrote:
> Vitor Sessak wrote:
>>> As the AVFilter framework got merged recently,
>> Well, not yet completely. There is still graph parsing and ffmpeg.c
>> integration missing...
> Hmmm, hurry up then ;-)
>>> it looks to me a perfect basis for a hardsub filter, it looks like
>>> there doesn't exist something like that yet(?).
>> Actually, it shouldn't be too hard to add subtitles filtering support
>> to avfilter. For the hardsub filter implementation, there is quite a
>> bit of code that can be copied from ffplay.c.
> > I'm wondering if this would be a nice qualification task for 2008 SoC
> > (unless, of course, if you want to give it a try before).
> IMHO it's very easy to make such a filter with the filter example
> ("negate") as a basis, although at the moment actually I don't have a
Actually, the negate filter read the input frame and put the negated
frame in a new frame as output. For a hardsub filter, that would be a
needless memcpy. It would be better to use the drawbox filter as a
template (yes, it is not even in the SoC tree yet, I'll put it there soon).
> clue how the decoded pixel data from the av subtitle struct(s) should
> end up in the filter. I am very much hoping for an all-encapsulating
> struct, which the filter has access to (AVContext? I did not check yet),
> that has pointers that point the subtitle data. Otherwise it might get
For doing this you should modify the avfilter framework to filter also
subtitles (now, it only work for video but subtitle and audio is planned
for the future). It means making CODEC_TYPE_SUBTITLE as a valid value
for AVFilterPad.type while keeping the framework sane. That will be the
hardest part. Then you can make a filter that has one video stream and
one subtitle stream as input and one video stream as output.
> Also, like M?ns mentioned, the colours might be wrong without IFO
> information, but that's fine for me.
Yes, it'll be a bit problematic, but one thing at a time...
More information about the ffmpeg-devel