YUV Channel extraction.

Nicolas Dufresne nicolas.dufresne at collabora.com
Fri Jul 18 16:30:36 PDT 2014


Le vendredi 18 juillet 2014 à 15:31 -0700, Jordan Johnson a écrit :
> I have a YUV frame for testing, and wish to extract the Y, U, and V
> channels separately. Is gstreamer capable of this? If so, how do I do
> it? If not, how do I go about it?

YUV frame is vague, what flavour of YUV is this ? If it's I420, you
could simply write a program is C, that creates a GstBuffer (e.g.
gst_buffer_new_wrapped (data, size)). Then if you have special
stride/offset, use gst_buffer_add_video_meta_full(), and finally, you'll
be able to map the buffer in order to access it's 3 planes, see
gst_video_frame_map ().

If it's not planar, you might want wrap your buffer into a GstSample,
see gst_sample_new() (segment and info can be NULL), then use
gst_video_convert_sample() passing I420 caps. Then you can map the new
buffer the way I described earlier.

cheers,
Nicolas




More information about the gstreamer-devel mailing list