Gstreamer tkinter x error failed request
WisdomPill
anas.el.amraoui at live.com
Fri Sep 8 08:48:22 UTC 2017
I'm trying to display different gstreamer pipelines output in the same window
with tkinter. I tried to create my own Frame that adds the gstreamer
pipeline. I supposed I can subclass
frames.py
from tkinter import Frame, NW
import gi
# Needed for set_window_handle():
gi.require_version('GstVideo', '1.0')
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject, GstVideo
class GstFrame(Frame):
def __init__(self, gst_launch_string, x, y, width, height,
master=None, cnf=dict(), **kwargs):
super(GstFrame, self).__init__(master=master, cnf=cnf, **kwargs)
self.place(relx=x, rely=y, anchor=NW, relwidth=width,
relheight=height)
self.frame_id = self.winfo_id()
self.player = Gst.parse_launch(gst_launch_string)
self.player.set_state(Gst.State.PLAYING)
self.bus = self.player.get_bus()
self.bus.enable_sync_message_emission()
self.bus.connect('sync-message::element', self.set_frame_handle)
def play(self):
self.player.set_state(Gst.State.PLAYING)
def set_frame_handle(self, bus, message):
if message.get_structure().get_name() ==
'prepare-window-handle':
frame = message.src
frame.set_property('force-aspect-ratio', True)
frame.set_window_handle(self.frame_id)
class SensorStreamFrame(GstFrame):
def __init__(self, stream, master=None, cnf=dict(), **kwargs):
gstreamer_launch_string = 'tcpclientsrc host={} port={} !
gdpdepay ! '\
'rtph264depay ! avdec_h264 !
videoconvert ! '\
'autovideosink
sync=false'.format(stream.host, stream.port)
x = stream.x
y = stream.y
width = stream.width
height = stream.height
super(SensorStreamFrame, self).__init__(gstreamer_launch_string,
x, y, width, height, master, cnf, **kwargs)
utils.py
from lib.frames import SensorStreamFrame
def init_players(streams, window):
for stream in streams:
SensorStreamFrame(stream, window)
I get two kinds of error like
X Error of failed request: BadDrawable (invalid Pixmap or Window
parameter)
Major opcode of failed request: 150 (XVideo)
Minor opcode of failed request: 19 ()
Resource id in failed request: 0x5200006
Serial number of failed request: 384
Current serial number in output stream: 385
and
X Error of failed request: BadDrawable (invalid Pixmap or Window
parameter)
Major opcode of failed request: 150 (XVideo)
Minor opcode of failed request: 19 ()
Resource id in failed request: 0x5200006
Serial number of failed request: 536
Current serial number in output stream: 537
I don't know where to begin debugging this, and lots of research on google
didn't help. Can someone help me or explain what this error is?
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list