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: Mon, 21 Mar 2011 16:37:05 +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 21/03/11 12:45, Joe wrote:
>>> 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.
> Can you please debug it a bit? I added only one opengl call
> "glTexSubImage2D" to copy subtitle bitmap to left/right texture. Is the
> opengl call causing a problem or there is a bug in subtitle
> processing/rendering? For me the example videos I posted are working
> well. Have you tried them?

I get an OpenGL error (0x0501: Invalid value), so the problem is
probably not in subtitle processing, but in rendering. It might also be
a problem in the existing rendering code that was not triggered before,
or a problem with my OpenGL driver. I currently cannot debug this due to
lack of time.

>> 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.)
> I hope I keep subtitles and video separated. I just added one pointer to
> video frame that says whether video frame has or has not a subtitle
> attached. Where do you see the mixture?

Exactly there ;)  I did not see that this pointer is just a flag, I
thought it held the complete subtitle data.

> I agree with breaking subtitle list into subtitle_box that will hold
> only one subtitle and will be buffered in the same way as video or audio
> frames/blobs.
>> - The subtitle reading/decoding is separated into threads just like
>> video and audio reading/decoding.
> I will redo your patch on top of my branch and unify processing of
> audio, vide and subtitles. I will also move font rendering from
> video_output to subtitles decoding thread. Is it what you want?

That's not necessary; my patch was just a rough sketch. The font
rendering should stay in video_output, it should not go into a separate
thread.

>> - 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?
>>
> Is it possible to point me to same example how to alpha-blend two
> textures? I dont know how to replace glTexSubImage2D - see
> https://github.com/cuchac/bino/blob/master/src/video_output.cpp#L375. I
> have ARGB memory buffer with subtitles and I need to blend it with the
> video frame texture. glTexSubImage2D does just simple replacing, not
> blending.

Once you have the subtitle rendered (with Qt) into a buffer, you can
create a texture from this buffer. Both the buffer and the texture
should have an alpha channel. Then, the subtitle texture should be
rendered into the _color_srgb_tex textures with blending enabled (in the
function display_current_frame).

Martin



reply via email to

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