OpenGL texture as input
Matthew Waters
ystreet00 at gmail.com
Mon Jul 21 08:13:33 PDT 2014
On 21/07/14 19:39, Dušan Poizl wrote:
> Hello,
Hi,
> with release of gstreamer 1.4 and merging plugins-gl plugins to
> plugins-bad if it is possible to use OpenGL texture as input to encoding
> pipeline.
>
> Now I have this simplified pipeline.
>
> OpenGL RGB texture -> appsrc -> videoconvert -> x264enc -> mux -> filesink
>
> What I want to get rid of is videocovnert element or replace it with
> OpenGL accelerated one. I want to avoid unnecessary copy of texture so
> it is possible to use my existing texture in gstreamer-gl?
>
Sure, that's possible.
The basic flow is as follows:
Some time during setup:
1. Set up a GstGLContext. Currently you have little choice but to create
a wrapped context using gst_gl_context_new_wrapped for your already
existing GL context as well as a real context using gst_gl_context_new
(using the wrapped context to share with) due to the current API and
implementation.
2. Create and set the video format on a GstGLDownload. This will create
a GstGLColorConvert that will convert from RGBA to your chosen video
format using GLSL.
On each input buffer,
1. Map the output buffer using GstVideoFrame.
2. Wrap your texture into a GstGLMemory using
gst_gl_memory_texture_wrapped().
3. Add that memory to a buffer and do a
gst_gl_download_perform_with_data() on it and the mapped GstVideoFrame data.
4. Unmap the output video frame and push the buffer to x264enc.
5. Profit.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140722/bf20f84d/attachment.sig>
More information about the gstreamer-devel
mailing list