[gst-devel] Simple example of a video filter

Aki Suihkonen aki.suihkonen at symbio.com
Wed Feb 2 07:58:38 CET 2011


Hi,

The effectv filters in gst-plugins good may form the starting
point you need; Even though they don't implement anything
particularly advanced, such as dealing with different
input/output rates, different input/output formats or frame sizes,
they still contain a rather big amount of interfaces and glue
to the gstreamer infrastructure.

You would basically have to locate the function
xxxx_transform( GstBaseTransform *trans, GstBuffer *in, GstBuffer *out)
{
  GST_OBJECT_LOCK(object)

  GST_OBJECT_UNLOCK(object)
}

and write your transform function inbetween the LOCK/UNLOCK statements.
such as
for (i=0;i<number_of_y_pixels;i++) *dst++=*src++ + 1;

(or + 0x40 to actually see a difference)

The extra stuff is basically there to parse the caps / mimetypes
and get the necessary formats/widths/heights in order to know
how many bytes to process.

> I've been looking through the sources for a simple element that I can
> use as a basis for a filter that I want to write.
> I don't have much experience in video streams, so I'm intimidated at all
> of the plumbing needed to implement a lot of the functions of a normal
> element.  Functions like seeking, resetting, etc.  I've looked at the
> Pango text overlay, and the Theora encoder, as well as a few others.
> When I get into the video chains and such, I get lost in the amount of
> detail.
>
> I have also created a new node with the boilerplate, and compiled it,
> and verified that it runs in the pipeline, but then am lost in finding a
> good example on how to get from there to modification of the video stream.
>
> I would like to start simple.  Not so simple from boilerplate, and not
> so complicated as the two I mentioned above.  I figure a good start
> would be to modify a video stream.  For an I420 stream, I want to
> increment each pixel of the Y plane.  Once I get to that point, I know I
> can get the rest of the filter implemented.
>
> Is there any documentation, or simple app notes closer to what I am
> looking for?
>
> ------------------------------------------------------------------------------
> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
> Finally, a world-class log management solution at an even better
> price-free!
> Download using promo code Free_Logger_4_Dev2Dev. Offer expires
> February 28th, so secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsight-sfd2d
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>






More information about the gstreamer-devel mailing list