<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>I'm trying to find a correct way to stop a pipeline that mixes
two streams of different lengths after the shorter one finished
playing. I encountered this problem while trying to fix an old
pygst tutorial that uses <tt>videomixer</tt> to overlay a PNG
image shown with <tt>imagefreeze</tt> on a video file. I see only
two approaches to stop the running pipeline when the video ended:</p>
<p><b>a)</b> change the <tt>num-buffers</tt> property of <tt>imagefreeze</tt>
to match the video file length but I see no obvious way to convert
video file duration to the number of buffers</p>
<p><b>b)</b> look for EOS event in the probe on video decoder source
pad and send it down to <tt>videomixer</tt> from <tt>imagefreeze</tt>
(either with <tt>gst_element_send_event</tt> or with <tt>gst_pad_push_event</tt>
from src pad) but I'm not sure that this doesn't have any
synchronization issues<br>
</p>
<p>I decided to model use case with two streams of different lengths
with two <tt>videotestsrc</tt> and approach <b>b</b> works
perfectly fine. When I replaced "infinite" <tt>videotestsrc</tt>
with <tt>imagefreeze</tt> for PNG image I found out that
application doesn't receive EOS message: <tt>gst_element_send_event(</tt><tt>imagefreeze,
gst_event_new_eos())</tt> returns false while <tt>gst_pad_push_event(gst_element_</tt><tt>get_static_pad(imagefreeze,
"src"), gst_event_new_eos())</tt> pad never returns at all. I've
attached Python code that uses approach <b>b</b> to stop pipeline
with pair of <tt>videotestsrc</tt> and with <tt>videotestsrc+</tt><tt>imagefreeze</tt>
and PNG file if someone will need to run the code.</p>
<p>I doubt that this is due to some bug in <tt>imagefreeze</tt>, so
the question is what I'm doing wrong and how to solve this problem
correctly?<br>
<tt></tt></p>
<pre class="moz-signature" cols="72">--
Best regards,
Vladislav Glinsky</pre>
</body>
</html>