<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hello,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have an interesting problem that I hope you can help me with. I’m working on an application that will overlay custom graphics onto a live video stream in real time. Ultimately, I’m planning on using a udpsrc and the appropriate decoders
 to process the video stream and cairooverlay to generate the custom graphics (we already have the cairo part done from a previous project, so that part is easy). I’ve been experimenting with several different combinations of plugins to achieve the desired
 effect, but I’m running into two problems.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">First, the pipeline isn’t constructed until the udpsrc receives data. I think this can be overcome by using a videotestsrc in place of the udpsrc (and decoders) and a videoswitch to swap to the video stream once data is detected via a filter
 pad.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Second, if the video stream stops (or pauses), then so does the output of the pipeline. At first, I just had the cairooverlay on top of the uspsrc/decoder chain, and it makes sense that the pipeline will stop if the streaming video stops.
 My next thought was to use a video mixer to mix the cairooverlay atop a transparent videotestsrc with the live video stream. This approach sort of works, but with a live stream as an input to the video mixer, the pipeline still seems to stop if the video stream
 stops. Here is an example pipeline that demonstrates the issue:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">gst-launch-1.0 -v videotestsrc name=tstsrc0 is-live=true ! \<o:p></o:p></p>
<p class="MsoNormal">                  video/x-raw,width=1280,height=720,framerate=1/1 ! \<o:p></o:p></p>
<p class="MsoNormal">                  videomixer name=mix ! \<o:p></o:p></p>
<p class="MsoNormal">                  videoconvert ! \<o:p></o:p></p>
<p class="MsoNormal">                  ximagesink sync=false \<o:p></o:p></p>
<p class="MsoNormal">                  videotestsrc name=tstsrc1 pattern=ball background-color=0 ! \<o:p></o:p></p>
<p class="MsoNormal">                  video/x-raw,format=ARGB,width=1280,height=720,framerate=10/1 ! \<o:p></o:p></p>
<p class="MsoNormal">                  mix.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">You’ll notice that tstsrc0, which is the underlay, is running at 1 fps and tstsrc1, the overlay, is running at 10 fps. If is-live is set to false on tstsrc0, then the pipeline runs as expected with the ball moving at 10 fps and the underlay
 updating at 1 fps. However, when is-live is set to true (which requires the sync=false on the sink to prevent timing errors), the ball moves for about half a second and then stops for about half a second and then repeats.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For these tests, I originally started with GStreamer 0.10 as installed with openSUSE 12.1, but I have since updated to openSUSE 13.1 and am running the following versions:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">gstreamer 1.4.3-3.2<o:p></o:p></p>
<p class="MsoNormal">gstreamer-plugins-base 1.4.3-2.4<o:p></o:p></p>
<p class="MsoNormal">gstreamer-plugins-good 1.4.3-2.1<o:p></o:p></p>
<p class="MsoNormal">gstreamer-plugins-bad 1.4.3-5.7<o:p></o:p></p>
<p class="MsoNormal">gstreamer-plugins-bad-orig-addon 1.4.3-5.7 <o:p></o:p></p>
<p class="MsoNormal">gstreamer-plugins-ugly 1.4.3-2.2<o:p></o:p></p>
<p class="MsoNormal">gstreamer-plugins-ugly-orig-addon 1.4.3-2.2<o:p></o:p></p>
<p class="MsoNormal">gstreamer-plugins-libav 1.4.3-1.1<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Any ideas as to how I can get this working would be greatly appreciated.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thomas<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>