Overlay peak value on video

Paul Barber paul.barber at oncology.ox.ac.uk
Mon Mar 9 03:11:32 PDT 2015


Hi Tim,
Thanks for the suggestion. You said that:
 > In the simplest case the element just knows about the bin and the 
textoverlay and can just set the property directly.

That sounds good to me, but I do not understand why the bin is needed.
Is there a good way for the element to know about another element?
Can it have a property that can be the name, or handle, or pointer to 
the other element?
The only way I can see is to pass the GObject pointer, so that the new 
element can use gst_util_set_object_arg() or g_object_set().

Cheers,
Paul.

On Fri, 2015-03-06 at 11:30 +0000, Paul Barber wrote:
Hey Paul,
>> What do you think would be the best way to write an element that makes
>> some measurement on the video buffer (say the peak RGB values) and then
>> overlays that measurement onto the video itself?
>>
>> Making the measurement is no problem. I have used the template filter
>> plugin, access the buffer and detect the peak values in the video chain
>> function.
>> I am also aware of the textoverlay element which will overlay static
>> text or via the text sink .
>> Can I make an element that will act as a text src for the textoverlay
>> text sink?
>> Can I push text out on a text src pad from within the video chain function?
>> Or is there a better way?
> Perhaps something like this:
>
>   - make a bin, and into the bin you put your measurement element into
> that bin
>
>   - add a sink ghostpad to the bin and point it to the sink pad of your
> element
>
>   - add a textoverlay element to the bin and link it with your
> measurement element (put it after your measurement element)
>
>   - add a src ghostpad to the bin and point it to the src pad of the
> textoverlay element
>
> Then what you need is a mechanism for your measurement element to put
> the result as "text" property on the textoverlay. In the simplest case
> the element just knows about the bin and the textoverlay and can just
> set the property directly. Alternatively you could subclass GstBin,
> override the handle_message vfunc, and have the measurement element post
> a message with the measurement, and then intercept that in the bin and
> set the right string on textoverlay (which will be done just before the
> buffer is pushed to it).
>
> Cheers
>   -Tim
>

-- 
Dr Paul R Barber
CRUK/MRC Oxford Institute for Radiation Oncology
Gray Laboratories
Department of Oncology
University of Oxford
Old Road Campus Research Building,
Roosevelt Drive, Oxford OX3 7DQ
Tel: 01865 617404 (Oxford); 0207 848 6314 or 6421 (KCL)
Fax: 01865 617334
Email: paul.barber at oncology.ox.ac.uk
http://users.ox.ac.uk/~raob0009
http://users.ox.ac.uk/~atdgroup



More information about the gstreamer-devel mailing list