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, 03 Apr 2011 18:49:16 +0200
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!

Thank you again for your work, it is much appreciated.

On 01/04/11 04:15, Joe wrote:
> On Tuesday 22 March 2011 22:15:30 Martin Lambers wrote:
>> A little progress: with the attached patch (based on your code, but with
>> the aforementioned changes), subtitles are now read, decoded, and
>> assigned to the correct video frames. But they are not rendered yet,
>> just printed to the console for debugging.
> 
> I finally merged your patch and also reworked subtitles rendering according 
> to 
> your comments. So now there is _input_subtitle texture that is prepared in 
> prepare_next_frame and than blended into _color_srgb_tex in 
> display_current_frame. Hope this is what you wanted.

Yes, thank you. Most of your code is now merged into the Bino
repository. The main difference is that I added a subtitle renderer
based on libass, because I think it would be nice to support the full
SSA/ASS specification.

Currently, the subtitle stream can only be selected on the command line
using e.g. '-s 1' (subtitles are disabled by default even if available).
It is not yet possible to select the subtitle stream via GUI or keyboard
shortcuts, but I will merge your code for these things soon.

> Can you please test the new code and see if subtitles are rendered without 
> OpenGL errors now? The only problem I see is alpha blending of video and 
> subtitle textures - result is very dark.
> The problematic code seems to be here: 
> https://github.com/cuchac/bino/blob/master/src/video_output.cpp#L766
> 
> I think texture is created correctly in ARGB with transparent background and 
> problem is in blending function, but I don't know how to fix it.

One problem was that the color conversion shader was still used when
rendering the subtitles - this likely caused some problems. Another
problem was that the subtitle was only rendered into the left view, not
into the right view.

The merged version uses color textures without alpha component, and
'glBlendFunc(GL_SRC_ALPHA, GL_ONE)' to render the subtitle texture,
which contains proper alpha information. This seems to work fine here.
Does it work for you, too?


In summary, the current state of subtitle support is:
- Subtitles in plain text and SSA/ASS format can be decoded and rendered
(via libass) with support for alpha blending.
- Subtitles in bitmap format (mostly DVD subtitles) currently only
decode to the string '???'. Proper support will be added later.
- Subtitle selection is currently only possible via the command line,
but code for GUI selection and keyboard shortcuts is available in your
repository and will be merged soon.
- Subtitle parameters cannot yet be set. The most important parameter is
probably the subtitle depth for 3D video. Other parameters seem less
important because they can be easily adjusted in the subtitle file.


Martin



reply via email to

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