<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    tsdemux doesn't number its pads starting from 0, instead it names
    them according to<br>
    the PID of the streams. From the command line you can get away with
    not explicitly<br>
    naming the pads:<br>
    <br>
    <pre>demux. ! <parser> ! queue ! mux.</pre>
    <br>
    The parser is necessary for most stream types because mpegtsmux
    expects<br>
    parsed streams, check the output of gst-inspect-1.0 mpegtsmux .<br>
    <br>
    If you need to transmux TS files containing arbitrary streams, you
    should definitely<br>
    write an application. You don't have to write it in C however,
    python and rust are<br>
    also options.<br>
    <br>
    -- <br>
    Mathieu Duponchelle · <a href="https://www.centricular.com">https://www.centricular.com</a><br>
    <br>
    <div class="moz-cite-prefix">On 9/18/19 6:54 PM, Rafal Garbat wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAGUrXFzSQ+XwDS5hcMedu=Ntf41teTJs31PBCfzTpQ3+Q9euXA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Hi Mathieu.</div>
        <div><br>
        </div>
        <div>Thank you for the quick anwer.<br>
        </div>
        <div>The content of the ts file is as follows:<br>
            container: MPEG-2 Transport Stream<br>
              audio: MPEG-1 Layer 2 (MP2)<br>
              subtitles: DVB subtitles<br>
              audio: MPEG-1 Layer 2 (MP2)<br>
              video: MPEG-2 Video (Main Profile)<br>
          <br>
        </div>
        <div>I have tried the example you gave, but I'm getting errors
          like:<br>
          ```<br>
          WARNING: from element /GstPipeline:pipeline0/GstTSDemux:demux:
          Delayed linking failed.<br>
          Additional debug info:<br>
          ./grammar.y(510): gst_parse_no_more_pads ():
          /GstPipeline:pipeline0/GstTSDemux:demux:<br>
          failed delayed linking pad  sink_0 of GstTSDemux named demux
          to some pad of GstQueue named queue0</div>
        <div>```<br>
          <br>
        </div>
        <div>Is that related to wrong parser I was using
          (mpegvideoparse) ? Do I really need to parse it before
          remuxing?</div>
        <div><br>
        </div>
        <div>Additionally, the example TS file is just for a testing
          purposes, in a real world I'll be getting MPEG-TS without a
          priori knowledge what kind of streams are there, therefore a
          static pipeline won't do the trick here. Is the only way to
          dynamically connect a parsers (if they are needed) to write an
          app with adding pad ad hoc as the type of stream is know?<br>
          <br>
        </div>
        <div>Regards,</div>
        <div>R<br>
        </div>
        <div> </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">śr., 18 wrz 2019 o
          18:15 Mathieu Duponchelle <<a
            href="mailto:mathieu@centricular.com" moz-do-not-send="true">mathieu@centricular.com</a>>
          napisał(a):<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 bgcolor="#FFFFFF"> mpegtsmux now has support for CBR as
            you've noticed (the bitrate property), so<br>
            it should simply be a matter of remuxing the input file
            indeed.<br>
            <br>
            If you want to do this from the command line, the command
            line will need to<br>
            match the streams contained in your input file, so it's not
            possible for us to<br>
            give you a working pipeline :)<br>
            <br>
            It should more or less look like:<br>
            <br>
            <pre>mpegtsmux bitrate=<bitrate> name=mux ! filesink location=<path> filesrc location=<path> ! tsdemux name=demux \</pre>
            <pre>  demux.sink_%d ! <parser> ! queue ! mux.</pre>
            <pre>  <repeat above for every stream in the input file>

</pre>
            <div class="gmail-m_8396424499972071692moz-signature">-- <br>
              Mathieu Duponchelle · <a
                href="https://www.centricular.com" target="_blank"
                moz-do-not-send="true">https://www.centricular.com</a><br>
              <br>
            </div>
            <div class="gmail-m_8396424499972071692moz-cite-prefix">On
              9/18/19 5:58 PM, Rafal Garbat wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">
                <div>Hi.</div>
                <div><br>
                </div>
                <div>I'm quite new to GStreamer. I have an input MPEG-TS
                  stream with a low bitrate. I need to stuff it with
                  NULL packets to make it higher (of course all the data
                  like PCR must be adjusted).</div>
                <div><br>
                </div>
                <div>1. I was thinking about merging my original stream
                  with the one, filled with null packets, but with
                  target bitrate. Is there as some straightforward
                  solution for that? I was thinking about something
                  like:  <br>
                        filesrc location=in.ts  ! ...some magic here...
                  !  mpegtsmux bitrate=51253960 ! filesink
                  location=out.ts<br>
                </div>
                <div>I have tried some variations but couldn't setup a
                  working pipeline so far.<br>
                  <br>
                </div>
                <div>2. Maybe there is a simpler and obvious solution
                  I'm missing here.</div>
                <div><br>
                </div>
                <div>BR,</div>
                <div>Rafal<br>
                </div>
              </div>
              <br>
              <fieldset
                class="gmail-m_8396424499972071692mimeAttachmentHeader"></fieldset>
              <pre class="gmail-m_8396424499972071692moz-quote-pre">_______________________________________________
gstreamer-devel mailing list
<a class="gmail-m_8396424499972071692moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" moz-do-not-send="true">gstreamer-devel@lists.freedesktop.org</a>
<a class="gmail-m_8396424499972071692moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank" moz-do-not-send="true">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></pre>
            </blockquote>
          </div>
          _______________________________________________<br>
          gstreamer-devel mailing list<br>
          <a href="mailto:gstreamer-devel@lists.freedesktop.org"
            target="_blank" moz-do-not-send="true">gstreamer-devel@lists.freedesktop.org</a><br>
          <a
            href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote>
      </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>
    <br>
  </body>
</html>