video sink by window ID

Nicolas Dufresne nicolas at ndufresne.ca
Fri May 22 14:04:17 UTC 2020


Le vendredi 22 mai 2020 à 14:09 +0200, Peter Maersk-Moller a écrit :
> Hi
> 
> Is there a way to make a gstreamer video sink display video in another application using the X11 Window id as identifier pretty much the same way mplayer is using its '-wid' parameter to send video to another applications window/frame like a Tk frame. I think SDL can do it too, but probably only on X11 platforms.
> 
> And can it be made to work with CLI version of gst-launch-1.0 ?
> 
> I have checked the ximagesink, the xvimagesink and the glimagesink, but they do not have a window id parameter.
> 
> Google search on subject for GStreamer, but maybe I am looking for the wrong keywords.

It is not possible from gst-launch-1.0, here's a python example, though I'm not sure what is needed to make sure foreign window render will work.


import gigi.require_versions({"Gst": "1.0", "GstVideo": "1.0"})from gi.repository import Gst, GstVideoimport time

Gst.init(None)p = Gst.parse_launch("videotestsrc ! ximagesink name=sink")s = p.get_by_name("sink")
GstVideo.VideoOverlay.set_window_handle(s, 0x1000022)p.set_state(Gst.State.PLAYING)time.sleep(10)p.set_state(Gst.State.NULL)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200522/7dfcf97b/attachment-0001.htm>


More information about the gstreamer-devel mailing list