<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 08/09/2012 08:00 PM, Matt Pekar
      wrote:<br>
    </div>
    <blockquote
cite="mid:CANw9OncUGN8Dv3MmkTmbELCC-e4-nLQXG3Fsc+Qzjx8NQGdxPg@mail.gmail.com"
      type="cite">I run this in response to user input:
      <div><br>
      </div>
      <div>
        <div>void display_pipeline_in_chrome(GstElement *pipeline) {</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>const
          char* temp_filename = "gst_bin_graph_tmp";</div>
        <div><br>
        </div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>char
          dot_command[1024];</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>char
          chrome_command[1024];</div>
        <div><br>
        </div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>const
          char* DIR = getenv("GST_DEBUG_DUMP_DOT_DIR");</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>//GstDebugGraphDetails
          output_flags =
          GstDebugGraphDetails(GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE |
          GST_DEBUG_GRAPH_SHOW_STATES |
          GST_DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS);</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>GstDebugGraphDetails
          output_flags = GstDebugGraphDetails(GST_DEBUG_GRAPH_SHOW_ALL);</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(pipeline),
          output_flags, temp_filename);</div>
        <div><br>
        </div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>snprintf(dot_command,
          sizeof(dot_command), "dot -Tpng %s/%s.dot -o %s/%s.png", DIR,
          temp_filename, DIR, temp_filename);</div>
        <div>
          <span class="Apple-tab-span" style="white-space:pre"> </span>snprintf(chrome_command,
          sizeof(chrome_command), "google-chrome %s/%s.png", DIR,
          temp_filename);</div>
      </div>
    </blockquote>
    FYI: you can also use xdg-open to open it with a suitable viewer.
    Also using svg is sometimes better when zooming.<br>
    <blockquote
cite="mid:CANw9OncUGN8Dv3MmkTmbELCC-e4-nLQXG3Fsc+Qzjx8NQGdxPg@mail.gmail.com"
      type="cite">
      <div>
        <div><br>
        </div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>system(dot_command);</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>system(chrome_command);</div>
        <div>}</div>
        <div><br>
        </div>
        <div>It displays the whole pipeline as an image in Chrome, using
          the Gstreamer debug output from graphviz.</div>
      </div>
    </blockquote>
    <br>
    Thing worth looking for in the graph are:<br>
    * disconnected elements (obvious)<br>
    * pads with uppercase 'F' (= flushing) (missing flush stop or
    activation)<br>
    * not negotiated elements (some elements have a long list of caps,
    instead simple caps)<br>
    <br>
    If there are good ideas how, the graphs can be improved to highlight
    more issues, let us know.<br>
    <br>
    Stefan<br>
    <blockquote
cite="mid:CANw9OncUGN8Dv3MmkTmbELCC-e4-nLQXG3Fsc+Qzjx8NQGdxPg@mail.gmail.com"
      type="cite">
      <div>
        <div><br>
        </div>
        <div>However, that usually isn't enough to tell what's wrong.
           For example, I recently had a pipeline along these lines:</div>
        <div><br>
        </div>
        <div>appsrc ! ffmpegcolorspace ! theoraenc ! rtptheorapay !
          udpsink</div>
        <div><br>
        </div>
        <div>This pipeline looked fine in the graph output, so to debug
          it I used the GST_DEBUG environment variable on each element
          in the pipeline, starting at the top:</div>
        <div><br>
        </div>
        <div>GST_DEBUG=appsrc:5</div>
        <div>--kill and restart</div>
        <div>GST_DEBUG=ffmpegcolorspace:5</div>
        <div>--kill and restart</div>
        <div>GST_DEBUG=theoraenc:5</div>
        <div>--ahhh theoraenc is dropping buffers...</div>
        <div><br>
        </div>
        <div>Doing this one step at a time let me discover which element
          was blocking.  It turns out the problem was I wasn't
          timestamping the appsrc buffers, and therefore theoraenc was
          just dropping them.</div>
        <br>
        <div class="gmail_quote">On Thu, Aug 9, 2012 at 12:38 PM, Eric
          Montellese <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:eric.montellese@videon-central.com"
              target="_blank">eric.montellese@videon-central.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Folks, in
            development I've run into various malformed or buggy
            pipelines that give this output:
            <div><br>
            </div>
            <div>
              <div>gst-launch  launch ! a ! pipeline</div>
              <div>Setting pipeline to PAUSED ...</div>
              <div>Pipeline is PREROLLING ...</div>
            </div>
            <div><br>
            </div>
            <div>Generally I have debugged these issues through a
              mixture of brute force and intuition (looking for common
              sorts of problems, etc).</div>
            <div><br>
            </div>
            <div>But perhaps there is a better way to determine which
              element has held up the pipeline?  Some swanky debug
              command I'm totally unaware of that shows the buffers
              in-flight perhaps?</div>
            <div><br>
            </div>
            <div>Any advice?</div>
            <div><br>
            </div>
            <div>Thanks,</div>
            <div>Eric</div>
            <br>
            _______________________________________________<br>
            gstreamer-devel mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel"
              target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <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="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>