<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hello,<div><br></div><div><div>I’m putting together a python app that receives video data and pops an overlay on top of it, rendered using Cairo. The general idea seems to be to use appsrc, and to watch for 'need-data' and then render and push a buffer.</div><div><br></div><div>Little demonstration app: <a href="https://gist.github.com/michaeltyson/9302751">https://gist.github.com/michaeltyson/9302751</a></div><div><br></div><div>This appears to work, sorta-kinda, but:</div><div><br></div><div>1. The buffer fill() call takes *ten seconds* at 720p</div><div>2. The whole thing only works with a really basic pipeline (appsrc | whatevervideosink)</div><div><br></div><div>Two questions:</div></div><div><br></div><div>1. Gst.Buffer.fill takes 10 seconds for 720p. What can I do about that? I’d imagine allocating a buffer/buffer pool in advance and rendering straight into the buffer’s memory would be better, but Gst.MapInfo (as returned from Gst.Buffer.map()) has a ‘data’ field of type int, as opposed to some kind of byte array! What’s with that??</div><div><br></div><div>2. How do I get this contraption to function with videomixer? When I run the above script, I see two of the following:</div><div><br></div><div>    (test.py:9818): GStreamer-CRITICAL **: gst_segment_to_running_time: assertion 'segment->format == format’ failed</div><div><br></div><div>    Running with GST_DEBUG=6 shows a bunch of this nonsense once the pipeline’s up and running: <a href="https://gist.github.com/michaeltyson/b004988e428d423ec27d">https://gist.github.com/michaeltyson/b004988e428d423ec27d</a> (tl;dr: "gst_videomixer2_sink_clip:<mix:sink_0> Timestamped buffers required!” / "gst_base_src_do_sync:<overlay> we have no clock")</div><div><br></div><div>In response to the message about timestamped buffers I’ve attempted to:</div><div><br></div><div>1. Set format=time on appsrc (this stops those GStreamer-CRITICAL errors showing up, but that’s all)</div><div>2. Explicitly add timestamps to the buffer, like:</div><div><div>        self.buffer.timestamp = self.time</div><div>        self.buffer.duration = Gst.SECOND * self.OVERLAY_FRAME_DURATION</div><div>        self.time += self.buffer.duration</div></div><div>3. Add/remove do-timestamp=true to appsrc.</div><div>4. Combinations of the above</div><div><br></div><div>Any pointers whatsoever would be greatly appreciated.</div><div><br></div><div>Best,</div><div>Michael</div><div><br></div><div><br></div></body></html>