How to add text on gstreamer except textoverlay ?

Gary Metalle Gary.Metalle at rvl.co.uk
Mon Sep 14 07:34:24 UTC 2020


Hi

You need to set the caps further downstream not on the frameratefilter, but on say the overlay. You have set the caps to indicate that the source is RGBA but this will only work if the source is actually RGBA. I would try something like this...

g_object_set(G_OBJECT(frameratefilter), "caps",
gst_caps_from_string("video/x-raw,width=1280,height=720,framerate=(fraction)30/1"),
NULL);

g_object_set(G_OBJECT(overlay), "caps",
gst_caps_from_string("video/x-raw,width=1280,format=(string)RGBA,height=720,framerate=(fraction)30/1"),
NULL);

This way you are telling the videoconvert that you want RGBA format going into the overlay block and if the format from the source is NV12 or anything other than RBGA, then it will convert it for you (otherwise it will pass the buffers through untouched).

________________________________________
From: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> on behalf of ToanVnET <toanrd.vnet at gmail.com>
Sent: 12 September 2020 02:42
To: gstreamer-devel at lists.freedesktop.org
Subject: Re: How to add text on gstreamer except textoverlay ?

Unfortunately, It's not working in my case. This is how I set:

g_object_set(G_OBJECT(frameratefilter), "caps",
gst_caps_from_string("video/x-raw,format=(string)RGBA,width=1280,height=720,framerate=(fraction)30/1"),
NULL);
...
this is my pipeline:

source -> frameratefilter -> videoconvert -> overlay -> encoder -> filesink

One things I agree with your opinion, If I change the format type, the CPU
usage will be changed also. And seem like NV12 is the format which take  CPU
less than other types.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list