Pure alpha Video + Text

Angel Martin amartin at vicomtech.org
Mon May 9 07:35:59 PDT 2011


Dear all,

I had gst-plugins-base 0.10.32-2 debian testing version in my computer.

I've just download from the git the version 0.10.32, compile it and install
libgstpango.so (textoverlay) and it works!

Best,

Angel


2011/5/5 Angel Martin <amartin at vicomtech.org>

> Dear all,
>
> Any idea about how to get a pure alpha video except for the textoverlay
> area?
>
> Best,
>
> Angel
>
>
> 2011/4/29 Angel Martin <amartin at vicomtech.org>
>
>> Dear all,
>>
>> I want to mix (videomixer) a multimedia source (video or image) with a
>> text (textoverlay) with gnlcomposition to insert the text in the proper
>> time.
>>
>> 1) At the beginning I used a gnloperation to insert the textoverlay inside
>> a bin with a textoverlay. But problems arised when I had a lot of images and
>> texts. It was not possible to get a desired layout. Because to get a correct
>> functionality the priority has to be low and unique (according to my tests).
>>
>> 2) So, I am trying to insert each text as a video with an alpha channel.
>>
>> I achieved it with a gnlsource with a bin that contains a videotestsrc
>> with green pattern and an alpha element to remove the green part with an
>> alpha channel but in some borders of the image there is a residual line.
>> videotestsrc pattern=5 ! ffmpegcolorspace ! textoverlay text="HELLOWORLD"
>> ! *alpha prefer-passthrough=TRUE method=1* ! video/x-raw-yuv,
>> framerate=\(fraction\)25/1, format=\(fourcc\)AYUV, width=640, height=480 !
>> ffmpegcolorspace
>>
>>
>> And for example in this case: textoverlay text="HELLOWORLD"
>> color=4278255360 (0xff00ff00) The text is also "alphaed". So not completely
>> solved yet. Moreover, the alpha module inserts a residual line and
>> computational waste.
>>
>> 3) So I want a pure alpha video with a text to mix it with an image.
>>
>> This is a test pipeline where the videotestsrc has directly a 0x00000000
>> (ARGB value = pure alpha black = transparent) with a text overlay with color
>> 0xff00ff00 (ARGB value = solid green).
>>
>> gst-launch videomixer name=mix sink_0::zorder=3 sink_1::zorder=2 !
>> ffmpegcolorspace ! timeoverlay ! autovideosink videotestsrc pattern=17
>> foreground-color=0 ! textoverlay text="HELLOWORLD" color=4278255360
>> shaded-background=TRUE ! video/x-raw-yuv, framerate=\(fraction\)25/1,
>> format=\(fourcc\)AYUV, width=640, height=480 ! ffmpegcolorspace ! mix.sink_0
>> filesrc location=~/image.jpg ! decodebin ! queue ! ffmpegcolorspace !
>> videoscale ! imagefreeze2 ! alpha prefer-passthrough=TRUE ! video/x-raw-yuv,
>> framerate=\(fraction\)25/1, format=\(fourcc\)AYUV, width=640, height=480 !
>> ffmpegcolorspace ! mix.sink_1
>>
>> However the textoverlay plugin doesn't overwrite its alpha value and the
>> text doesn't appear anyplace. It seems the text inherits the alpha value of
>> the videotestsrc.
>>
>> If a change the videotestsrc to get semitransparent color=2147483648
>> (0x80000000) (ARGB semitransparent black) the text appears but again It
>> seems the text inherits the alpha value of the videotestsrc.
>>
>> gst-launch videomixer name=mix sink_0::zorder=3 sink_1::zorder=2 !
>> ffmpegcolorspace ! timeoverlay ! autovideosink videotestsrc pattern=17
>> foreground-color=2147483648 ! textoverlay text="HELLOWORLD" color=4278255360
>> shaded-background=TRUE ! video/x-raw-yuv, framerate=\(fraction\)25/1,
>> format=\(fourcc\)AYUV, width=640, height=480 ! ffmpegcolorspace ! mix.sink_0
>> filesrc location=~/image.jpg ! decodebin ! queue ! ffmpegcolorspace !
>> videoscale ! imagefreeze2 ! alpha prefer-passthrough=TRUE ! video/x-raw-yuv,
>> framerate=\(fraction\)25/1, format=\(fourcc\)AYUV, width=640, height=480 !
>> ffmpegcolorspace ! mix.sink_1
>>
>> I tryed to insert alphacolor elements and introduce different schemes of
>> ffmpegcolorspaces and capsfilter, and I also checked that the zorder of the
>> videomixer is right, but I haven't achieved the expected result.
>>
>> Any ideas?
>>
>> Thank you in advance.
>>
>> Best Regards.
>>
>
>
>


-- 

Ángel Martín Navas
Investigador / Researcher
Televisión Digital y Servicios Multimedia / Digital TV & Multimedia Services

Vicomtech - Visual Interaction Communication Technologies
Mikeletegi Pasealekua, 57 - Parque Tecnológico
20009 Donostia - San Sebastián - Spain
Tel: +[34] 943 30 92 30
Fax: +[34] 943 30 93 93
e-mail: amartin at vicomtech.org
www.vicomtech.org

*** member of IK4 Research Alliance ****
www.ik4.es
*** member of GraphicsMedia.net ****
www.graphicsmedia.net



-----------------------------------------------------
Vicomtech is an ISO 9001:2000 certified institute
-----------------------------------------------------

Este mensaje se dirige exclusivamente a su destinatario.
La información incluida en el presente correo es confidencial sometida a
secreto profesional, especialmente en lo que respecta a los datos de
carácter personal, cuya divulgación está prohibida, en virtud de la
legislación vigente. Si usted no es el destinatario legítimo y lo ha
recibido por error o tiene conocimiento del mismo por cualquier motivo,
le rogamos que nos lo comunique por este medio y proceda a destruirlo o
borrarlo. En todo caso abstengase de utilizar, reproducir, alterar,
archivar o comunicar a terceros el presente mensaje así como los ficheros
anexos, todo ello bajo pena de incurrir en responsabilidades legales.
Cualquier opinión contenida en este correo es exclusiva de su autor y no
representa necesariamente la opinión de ASOCIACIÓN CENTRO DE TECNOLOGÍAS
DE INTERACCIÓN VISUAL Y COMUNICACIONES VICOMTECH (en adelante Vicomtech-IK4)
El emisor no garantiza la integridad, rapidez o seguridad del presente correo,
ni se responsabiliza de posibles perjuicios derivados de la captura,
incorporaciones de virus o cualesquiera otras manipulaciones
efectuadas por terceros.
Con motivo de la entrada en vigor de la Ley 34/2002, de 11 de julio, de
Servicios de la Sociedad de la Información y de Comercio Electrónico, le
informamos que pueden revocar en cualquier momento, de forma sencilla
y gratuita,
el consentimiento para la recepción de mensajes de vicomtech.org en
info.lopd at vicomtech.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110509/1c644760/attachment-0001.htm>


More information about the gstreamer-devel mailing list