<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>When you set the state of a pipeline to (for example) NULL, it is
      a bit like pressing the button on a pedestrian crossing.</p>
    <p>You should not press the button and then immediately cross the
      road as doing so will be likely to drastically shorten your life -
      instead, you press the button and then wait for the traffic to
      stop.</p>
    <p>When you set the state of a pipeline, you need to wait for a
      signal from the pipeline that it has done what you ask - and only
      then try to make another change.</p>
    <p>I assume that it is a transcription error that you set p1 to
      PLAYING in each of your 3 cases.</p>
    <p>You may want to SEEK to the beginning as each pipeline may
      remember that it has reached the end of the clip.<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 09/02/2017 15:45, Dimitrios Katsaros
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAHpJRnxLVcD62oHJ9OMfkZ8uGXXwqJuTOu=Mj36nntjyiM1noA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>I think we need a bit more information before
                    figuring this out. <br>
                    <br>
                    Have you tried running and stopping a single
                    pipeline? <br>
                  </div>
                  What happens when you stop one video? Does the
                  recording stop<br>
                </div>
                or continue playing?<br>
              </div>
              Are you sure the callbacks for the keys are working after
              launching the pipeline?<br>
            </div>
            If you are running g-main_loop on your main thread it may be
            blocking the callbacks for<br>
          </div>
          key events?<br>
          <br>
        </div>
        Dimitrios<br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Wed, Feb 8, 2017 at 3:39 PM, Michael
          Yarochkin <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:michael.yarochkin@timetronics.be"
              target="_blank">michael.yarochkin@timetronics.be</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div>
              <div dir="ltr">
                <div id="m_-1975791287034119917x_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 style="display:inline-block;width:98%">
                <div id="m_-1975791287034119917x_divRplyFwdMsg"
                  dir="ltr"><font style="font-size:11pt" face="Calibri,
                    sans-serif" color="#000000"><b>From:</b>
                    gstreamer-devel <<a moz-do-not-send="true"
                      href="mailto:gstreamer-devel-bounces@lists.freedesktop.org"
                      target="_blank">gstreamer-devel-bounces@<wbr>lists.freedesktop.org</a>>
                    on behalf of <a moz-do-not-send="true"
                      href="mailto:whoman@gmail.com" target="_blank">whoman@gmail.com</a>
                    <<a moz-do-not-send="true"
                      href="mailto:whoman@gmail.com" target="_blank">whoman@gmail.com</a>><br>
                    <b>Sent:</b> Tuesday, January 10, 2017 7:27:59 PM<br>
                    <b>To:</b> <a moz-do-not-send="true"
                      href="mailto:gstreamer-devel@lists.freedesktop.org"
                      target="_blank">gstreamer-devel@lists.<wbr>freedesktop.org</a><br>
                    <b>Subject:</b> Why can't I replay the same video
                    twice with python?</font>
                  <div> </div>
                </div>
              </div>
              <div>
                <div class="h5">
                  <font size="2"><span style="font-size:10pt">
                      <div class="m_-1975791287034119917PlainText">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.<wbr>PLAYING)<br>
                        <br>
                        def PlayVideo2():<br>
                            StopAllPipelines()<br>
                            p1.set_state(Gst.State.<wbr>PLAYING)<br>
                        <br>
                        def PlayVideo3():<br>
                            StopAllPipelines()<br>
                            p1.set_state(Gst.State.<wbr>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>
                        ______________________________<wbr>_________________</div>
                    </span></font></div>
              </div>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>