Set partial pixel to be transparent in video

Peter Maersk-Moller pmaersk at gmail.com
Tue Sep 27 09:00:24 UTC 2016


Hi Sean.

See comments inline.

On Tue, Sep 27, 2016 at 6:46 AM, Sean <csosmo at hotmail.com> wrote:

> Hi, Peter,
> Thanks for the detailed comment. I saw the GREEN pixel from from the
> encoded
> test.ts file via a player. I also tried 4 possible offset (0, 1, 2, 3) of
> the Alpha byte-position. The result is the same (GREEN pixel at at
> (row,col)=(0,4), (0,8)...).


Well, if you were using the pipeline you original posted, you are not
cahnging the alpha value of pixels but rather creating invalid values of
YUV before encoding as H.264 which correctly replaces invalid YUV values
with a colour of green.


> It seems that the Alpha information is dropped
> during x264enc


Yes all alpha information is dropped before video encoding. That is
according to specs. Nearly no video codec support preserving the alpha
information.
The ones that do, you quite likely will not want to use. See
https://www.digitalrebellion.com/blog/posts/list_of_video_formats_supporting_alpha_channels

and in your modified pipeline, the input format of x264enc is
> I420, the Alpha information is lost as well.


As according to specs.


> So, is there any way keep the
> Alpha information after encoding?
>

No. Plain and simple.


> I checked this link
> (https://fossies.org/linux/gst-plugins-good/tests/check/elements/alpha.c).
> The RGBA format is the same as you mentioned. But I tried 4 possible Alpha
> offset, no one works. Thanks a lot.
>

As I said, with your original pipeline you just create invalid YUV values,
with my modified pipeline you correctly change the alpha value, however
when converted to be encoded, alpha values are thrown away.

You can pseudo stream using png still images preserving alpha information
costing bandwidth and CPU.

The questions are
a) What are you trying to do?
b) Why ?


>
>
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.
> n4.nabble.com/Set-partial-pixel-to-be-transparent-in-
> video-tp4679769p4679803.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160927/71f94cb9/attachment.html>


More information about the gstreamer-devel mailing list