<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 10/6/19 9:18 am, pisymbol . wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAPpy_fHFtOrx=5CWQkfmUhg+N6ernkqN-F2SXhj7gK4yqVx=DQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr"><br>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Sat, Jun 8, 2019 at 7:54
            AM pisymbol . <<a href="mailto:pisymbol@gmail.com"
              moz-do-not-send="true">pisymbol@gmail.com</a>> wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            <div dir="ltr">
              <div dir="ltr"><br>
              </div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Sat, Jun 8, 2019 at
                  1:26 AM pisymbol . <<a
                    href="mailto:pisymbol@gmail.com" target="_blank"
                    moz-do-not-send="true">pisymbol@gmail.com</a>>
                  wrote:<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px 0.8ex;border-left:1px solid
                  rgb(204,204,204);padding-left:1ex">
                  <div dir="ltr">
                    <div>If I do the following on the command line:</div>
                    <div><br>
                    </div>
                    <div>gst-launch-1.0  filesrc
                      location="/mnt/storage/2cam/20190608_050606Z_00000000.mkv"
                      ! matroskademux name=demux demux.video_0 !
                      h264parse ! avdec_h264 ! videoconvert ! gtksink</div>
                    <div><br>
                    </div>
                    <div>I see the video in the Cairo window.</div>
                    <div><br>
                    </div>
                    <div>However, if I do the exact same thing in
                      Python:</div>
                    <div><br>
                    </div>
                    <div>on_realize():<br>
                    </div>
                    <div> 53        self.pipeline = Gst.Pipeline()<br>
                       54        factory = self.pipeline.get_factory()<br>
                       55        gtksink = factory.make('gtksink')<br>
                       56        self.pipeline.add(gtksink)<br>
                       57        self.pipeline.add(self.bin) # self.bin
                      = Gst.parse_bin_from_dsecription(pipeline above)<br>
                       58        self.bin.link(gtksink)<br>
                    </div>
                  </div>
                </blockquote>
              </div>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <p><br>
      This working depends on the exact pipeline and the arguments you
      passed to 'Gst.parse_bin_from_description'.  You may need to
      extract videoconvert's src pad and expose that as a ghost pad
      before 'self.bin.link(gtksink)' may work.<br>
      <br>
      matroskademux also exposes pads dynamically so you need to connect
      to the 'pad-added' signal and connect it to the h264parse when it
      exposes the video src pad.  This is most likely the cause of your
      not-linked error.<br>
      <br>
      The python equivalent of 'gst_debug_bin_to_dot_file_with_ts' is
      your friend here.<br>
      <br>
      Cheers<br>
      -Matt<br>
      <br>
    </p>
    <blockquote type="cite"
cite="mid:CAPpy_fHFtOrx=5CWQkfmUhg+N6ernkqN-F2SXhj7gK4yqVx=DQ@mail.gmail.com">
      <div dir="ltr">
        <div class="gmail_quote">
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            <div dir="ltr">
              <div class="gmail_quote">
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px 0.8ex;border-left:1px solid
                  rgb(204,204,204);padding-left:1ex">
                  <div dir="ltr">
                    <div> 59      
                       self.pack_start(gtksink.props.widget, True, True,
                      0)<br>
                       60      
                       self.pipeline.set_state(Gst.State.PLAYING)<br>
                       61        gtksink.props.widget.show_all()</div>
                    <div><br>
                    </div>
                    <br>
                  </div>
                </blockquote>
                <div><br>
                </div>
                <div>Weird, the pipe is actually failing within Gst:</div>
                <div><br>
                </div>
                <div>0:00:05.944147506 12757      0x11d0f70 INFO        
                     GST_PIPELINE grammar.y:518:gst_parse_found_pad:
                  trying delayed linking pad  video_0 of
                  GstMatroskaDemux named demux to some pad of
                  GstH264Parse named h264parse0<br>
                  0:00:05.944179026 12757      0x11d0f70 INFO      
                   GST_ELEMENT_PADS
                  gstutils.c:1573:gst_element_link_pads_full: trying to
                  link element demux:video_0 to element h264parse0:(any)<br>
                  0:00:05.944199121 12757      0x11d0f70 INFO      
                   GST_ELEMENT_PADS
                  gstelement.c:907:gst_element_get_static_pad: found pad
                  demux:video_0<br>
                  0:00:05.944260817 12757      0x11d0f70 INFO      
                   GST_ELEMENT_PADS
                  gstelement.c:907:gst_element_get_static_pad: found pad
                  h264parse0:sink<br>
                  0:00:05.944287952 12757      0x11d0f70 INFO      
                   GST_ELEMENT_PADS
                  gstutils.c:1124:gst_element_get_compatible_pad:<h264parse0>
                  Could not find a compatible pad to link to
                  demux:video_0<br>
                  0:00:05.944307568 12757      0x11d0f70 INFO          
                        default
                  gstutils.c:1962:gst_element_link_pads_filtered: Could
                  not link pads: demux:video_0 - h264parse0:(null)<br>
                  0:00:05.944373647 12757      0x11d0f70 WARN          
                        default
                  grammar.y:506:gst_parse_no_more_pads:<demux>
                  warning: Delayed linking failed.<br>
                  0:00:05.944391151 12757      0x11d0f70 WARN          
                        default
                  grammar.y:506:gst_parse_no_more_pads:<demux>
                  warning: failed delayed linking pad  video_0 of
                  GstMatroskaDemux named demux to some pad of
                  GstH264Parse named h264parse0<br>
                  0:00:05.944422927 12757      0x11d0f70 INFO      
                   GST_ERROR_SYSTEM
                  gstelement.c:1879:gst_element_message_full:<demux>
                  posting message: Delayed linking failed.<br>
                  0:00:05.944459054 12757      0x11d0f70 INFO      
                   GST_ERROR_SYSTEM
                  gstelement.c:1902:gst_element_message_full:<demux>
                  posted warning message: Delayed linking failed.<br>
                  0:00:05.944496014 12757      0x11d0f70 INFO          
                      GST_EVENT gstevent.c:760:gst_event_new_segment:
                  creating segment event time segment
                  start=0:00:00.648000000, offset=0:00:00.000000000,
                  stop=99:99:99.999999999, rate=1.000000,
                  applied_rate=1.000000, flags=0x00,
                  time=0:00:00.000000000, base=0:00:00.000000000,
                  position 0:00:00.000000000, duration
                  99:99:99.999999999<br>
                  0:00:05.945143367 12757      0x11d0f70 WARN          
                  matroskademux
                  matroska-demux.c:4761:gst_matroska_demux_loop:<demux>
                  error: stream stopped, reason not-linked<br>
                  0:00:05.945192006 12757      0x11d0f70 INFO      
                   GST_ERROR_SYSTEM
                  gstelement.c:1879:gst_element_message_full:<demux>
                  posting message: GStreamer encountered a general
                  stream error.<br>
                  0:00:05.945221830 12757      0x11d0f70 INFO      
                   GST_ERROR_SYSTEM
                  gstelement.c:1902:gst_element_message_full:<demux>
                  posted error message: GStreamer encountered a general
                  stream error.<br>
                  0:00:05.945249445 12757      0x11d0f70 INFO          
                           task
                  gsttask.c:316:gst_task_func:<demux:sink> Task
                  going to paused</div>
                <div><br>
                </div>
                <div>Again, why does this work on the command line but
                  not in my Python window?</div>
                <br>
              </div>
            </div>
          </blockquote>
          <div><br>
          </div>
          <div>In general: Are gst-launch-1.0 pipelines equivalent to
            Gst.parse_from_description() ones? This has me a bit
            confuzzled.<br>
          </div>
          <div><br>
          </div>
          <div>-aps<br>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>