bino-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bino-list] SubTitles?


From: Martin Lambers
Subject: Re: [Bino-list] SubTitles?
Date: Sun, 20 Mar 2011 13:58:07 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8

Hi Joe!

On 17/03/11 01:16, Joe wrote:
> On Tuesday 15 March 2011 21:15:23 Martin Lambers wrote:
>>> Yes, we need a high level library that hides all those messy system
>>> dependent details, and ideally also takes care of any character encoding
>>> issues for us.
>>>
>>> I agree that we should avoid adding too many dependencies. Pango
>>> actually does not seem to be too much of a problem in this regard: it
>>> does depend on glib, but not on GTK, and on my system (Ubuntu 10.10)
>>> libqt4gui also depends on glib (to allow using the glib mainloop), so
>>> the number of additional dependencies would be limited to pango+cairo.
>>> Still, there might be better choices than pango.
>>>
>>> Maybe we should just use Qt, but I really would like to have subtitles
>>> working with Equalizer, too. From a quick look at the code, Equalizer
>>> itself seems to only support crappy old-style X11 fonts on Linux, and
>>> only in US-ASCII encoding.
>>
>> On second thought, there is probably no real advantage in using Pango
>> over Qt. It looks like one would need to use QPainter on a QImage to
>> draw the text, and then upload the QImage as a texture to the GPU. No
>> additional libraries would be required.
>>
>> If we keep the subtitle rendering code a little bit separated from the
>> rest, we can probably figure out a way to use this from within Equalizer
>> later.
>>
>> Martin
> 
> I got rid of FTGL and reimplemented font rendering in QT. Everything looks 
> much cleaner now - system font selection dialog, all the fancy options and 
> now 
> there is subtitles text encoding selection.
> 
> I'm drawing subtitles into argb buffer and I managed to print it directly 
> into 
> left/right textures, so finally I can implement depth of subtitles (paralax 
> is 
> correct name?). However I need help with alpha blending of two textures. I'm 
> using  glTexSubImage right now to copy the subtitle image directly into 
> left/right texture, but that does not do alpha blending. I hope you will find 
> the time to implement proper blending/overlaying of those textures.
> 
> https://github.com/cuchac/bino has fresh sources and the code should be ready 
> for testing.

Many thanks for your work, it is highly appreciated!

Your code does not yet work for me: I get OpenGL errors and video
playback stops before the first subtitle is shown.

Nevertheless, I'm beginning to merge your work into Bino, since I'm sure
the OpenGL problems can be fixed later.

I would like to make a few conceptual changes if that's ok with you:
- Keep subtitles and video frames separate in the media data. Just
provide simple individual subtitle boxes from the media object, and do
all buffering of subsequent subtitles (that may be stored in the same
packet) in the media object. (This is similar to the way audio data is
handled now.)
- The subtitle reading/decoding is separated into threads just like
video and audio reading/decoding.
- I have changed the decoding of subtitles based on my (limited)
understanding of the FFmpeg subtitle API.

See the attached patch (against current Bino in git) as a proposal. This
code compiles, but it is *untested* (i.e. broken). Its purpose is just
to give an idea of the proposed subtitle input and management;
everything else is not yet included.

Do you agree to these changes? Do you have other suggestions?

Best regards,
Martin

Attachment: subtitles_part_0.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]