How to crop video on Android/Gstreamer with glimagesink

Nicolas Dufresne nicolas at ndufresne.ca
Sun Feb 2 02:17:06 UTC 2020


Le samedi 01 février 2020 à 13:21 -0800, Gregoire Gentil a écrit :
> Hello,
> 
> I would like to crop the rendering of a video playback in Android which 
> uses glimagesink.
> 
> I can do the job by inserting a videocrop element before glimagesink but 
> I would like to achieve the same goal by using the "render-rectangle" 
> property of glimagesink - the objective is that the crop operation is 
> done by the GPU, not the CPU. That doesn't work. 
> gst_video_overlay_set_render_rectangle doesn't work either.
> 
> Am I missing something?

Unfortunatly, glimagesink does not implement crop meta. You could use
glvideomixer to simulate it, but that's not ideal.
gst_video_overlay_set_render_rectangle() is meant to position the
render rectangle within a your window, the content is expected to be
scaled.

You can also do that using your own shader and glshader element.

> 
> Thanks in advance,
> 
> Grégoire
> _______________________________________________
> 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