Hi Gerwin,

It's a bit of a tricky situation. The actual content of the alpha
channel mainly depends on FFmpeg implementation (and not osg). If I
remember correctly, the obsolete colour conversion routines set the
alpha value to 1 when the video was only RGB, while the libswscale
routines set it to 0. As both paths are still used, you cannot know for
sure the content of the alpha channel.

Note that most movies do not feature transparency. In fact, only FLV
files with transparency are supported. To know if a movie supports
transparency, you can call osg::ImageStream::isImageTranslucent(). The
FFmpeg osg plugin will return true if the movie features a meaningful
alpha channel. If it returns false, I suggest you treat the content of
the alpha channel as undefined.

I do not suggest modifying the plugin to enforce the alpha value, as
this would impact performance.


Cheers,

Tanguy


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Gerwin
de Haan
Sent: 04 August 2009 09:23
To: [email protected]
Subject: [osg-users] [osgPlugins] ffmpeg plugin and transparency

Hi all,

I've been toying with the ffmpeg plugin and osg 2.9.5. As I was hoping,
this is definitely a great improvement over the buggy xine plugin. I'm
currently adding more playback controls, such as seek and pausing
support. 

I did notice a surprising effect when using a regular (non-transparent)
movie with a transparent StateSet. Apparently, the alpha value in the
rgba texture remain at 0 by default, resulting in a fully transparent
texture. It took me a while to figure this one out, but when I used a
fragmentshader to override the alpha value, the movie becomes visible
again. This behavior is not the case with regular images or when using
xine.

Is this behavior by design, am I missing something or should we add code
to correctly set the alpha value for non-transparent movies?

Cheers,
Gerwin

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15759#15759





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to