GST Video overlay

Stephane Cerveau scerveau at gmail.com
Mon Oct 31 18:49:13 UTC 2022


Dear Phil,

In GTK4 I have been using the Gtk4paintablesink to achieve what you are 
trying to implement  :

https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio/-/blob/main/src/gps/player.rs

Regards.

Stéphane.

On 31/10/22 19:07, Nicolas Dufresne via gstreamer-devel wrote:
> Le samedi 29 octobre 2022 à 16:20 +0100, yPhil via gstreamer-devel a écrit :
>> Hi,
>>
>>
>> I'm trying to get a video to display in a Gtk.Box() that I put in a
>> paned container.
>>
>> I'm passing the window handle - I'm getting it from the widget in the
>> realize callback - to the player class:
>>
>>       def __on_sync_message(self, bus: Gst.Bus, message: Gst.Message) ->
>> None:
>>           if message.get_structure().get_name() == "prepare-window-handle":
>>               image_sink = message.src
>>               image_sink.set_property("force-aspect-ratio", True)
>>               image_sink.set_window_handle(self.__xid)
>>
>> But that creates an overlay that covers the *whole* window
>>
>> Is there a way to avoid the creation of the overlay ?
> To compose a video with Gtk, the only option is to use the widget provided by
> the gtksink/gtkglsink elements. Due to GTK3 doing software render, be aware that
> the final render will be done in software.
>
> There is also some effort to get GTK4 support, I'll leave to the others the task
> of explaining, as I have never used it myself (other then through an already
> written application).
>
>> There seems to be a way to explicitly create a videosink then wait for a
>> buffer signal to somehow direct the playbin to it, then get a Gtk
>> container to display it "directly" and I'd really like to know how to do
>> that.
>>
>> But if the overlay is mandatory, and maybe it is (my app needs to be
>> able to display the video in - real - full screen so it probably is)
>> then how can I prevent it to cover the whole window (not just the paned
>> container, the other widgets as well)?
>>
>> I hope I'm making sense, thank you for you patience.
>>
>>
>> Phil
>>


More information about the gstreamer-devel mailing list