<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hello, </p>
<p><br>
</p>
<p><span style="font-size:12pt">Don`t you need to use </span><br>
</p>
<p><span style="color:rgb(33,33,33); font-size:13.3333px">p1.set_state(Gst.State.<span>PAUSED</span>)</span></p>
<p><span style="color:rgb(33,33,33); font-size:13.3333px"><br>
</span></p>
<p><span style="color:rgb(33,33,33); font-size:13.3333px"><span style="font-family:Calibri,Arial,Helvetica,sans-serif,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">Just a guess. I can be
 wrong.</span><br>
</span></p>
<p><span style="color:rgb(33,33,33); font-size:13.3333px"><span style="font-family:Calibri,Arial,Helvetica,sans-serif,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px"><br>
</span></span></p>
<p><span style="color:rgb(33,33,33); font-size:13.3333px"><span style="font-family:Calibri,Arial,Helvetica,sans-serif,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">Mikl</span></span></p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> gstreamer-devel <gstreamer-devel-bounces@lists.freedesktop.org> on behalf of whoman@gmail.com <whoman@gmail.com><br>
<b>Sent:</b> Tuesday, January 10, 2017 7:27:59 PM<br>
<b>To:</b> gstreamer-devel@lists.freedesktop.org<br>
<b>Subject:</b> Why can't I replay the same video twice with python?</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hello,<br>
I want to play 3 video files, like a piano.<br>
<br>
I have it working, however it will only play each video one time...<br>
2nd time I press any of the 3 keys, the video does not start playing<br>
again.<br>
No error messages returned.  GST acts as if it's doing everything as expected.<br>
<br>
I'm using python....  Here's the pertinent parts of my code:<br>
<br>
p1 = Gst.parse_launch ("filesrc location=file1.mp4 ! qtdemux !<br>
h264parse ! vaapidecodebin ! videoconvert ! vaapisink<br>
fullscreen=true")<br>
p2 = Gst.parse_launch ("filesrc location=file2.mp4 ! qtdemux !<br>
h264parse ! vaapidecodebin ! videoconvert ! vaapisink<br>
fullscreen=true")<br>
p3 = Gst.parse_launch ("filesrc location=file3.mp4 ! qtdemux !<br>
h264parse ! vaapidecodebin ! videoconvert ! vaapisink<br>
fullscreen=true")<br>
<br>
def StopAllPipelines():<br>
    #Stop all other pipelines<br>
    p1.set_state(Gst.State.NULL)<br>
    p2.set_state(Gst.State.NULL)<br>
    p3.set_state(Gst.State.NULL)<br>
<br>
def PlayVideo1():<br>
    StopAllPipelines()<br>
    p1.set_state(Gst.State.PLAYING)<br>
<br>
def PlayVideo2():<br>
    StopAllPipelines()<br>
    p1.set_state(Gst.State.PLAYING)<br>
<br>
def PlayVideo3():<br>
    StopAllPipelines()<br>
    p1.set_state(Gst.State.PLAYING)<br>
<br>
I've tried deleting the pipeline variable references (p1 p2 and p3)<br>
and then recreating them, same result.<br>
I've tried setting p1 p2 and p3 to "None" and then recreating them, same result.<br>
<br>
The only thing I can think is that there's some kind of async issue,<br>
where my PlayVideo1() functions aren't waiting for StopAllPipelines()<br>
to finish, before trying to set the p1 state to PLAYING?<br>
I tried inserting a "p1.get_state(1)" in between, same result.<br>
Perhaps there's more that needs to be done between setting the states<br>
to NULL, then back to PLAYING<br>
<br>
Any ideas?<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
gstreamer-devel@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</div>
</span></font>
</body>
</html>