<div dir="ltr">Hm, I almost got my example working with the pipeline:<br><i>`gst-launch-1.0 -e  mpegtsmux bitrate=51253960 name=mux ! filesink location=out.ts  filesrc location=in.ts   ! tsdemux emit-stats=true name=demux  \<br>demux. ! mpegvideoparse ! queue ! mux. \<br>demux. ! mpegaudioparse ! queue ! mux. \<br>demux. ! mpegaudioparse ! queue ! mux. \<br></i><div><i>demux. ! 'subpicture/x-dvb' ! dvbsuboverlay enable=true name=r! queue  ! mux.`</i></div><div><i><br></i></div><div>except the subtitles - when I added this subpipe my pipeline stucks in PREROLLING state. Is that something related to queues being out of sync?</div><div>Regards<br></div><div><i></i></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">pon., 23 wrz 2019 o 11:51 Rafal Garbat <<a href="mailto:garbbraf@gmail.com">garbbraf@gmail.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 dir="ltr"><div dir="ltr"><div>Hi Mathieu.</div><div><br></div><div>Thank you very much. This got me process further.</div><div>One more question: is there a appropriate (all -in-one) video and audio parser to use without pads naming (I use `mpegvideoparse`, but - as expected - I got only video stream)?<br><br></div><div>BR,</div><div>Rafal<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">śr., 18 wrz 2019 o 19:21 Mathieu Duponchelle <<a href="mailto:mathieu@centricular.com" target="_blank">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">
    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" target="_blank">https://www.centricular.com</a><br>
    <br>
    <div>On 9/18/19 6:54 PM, Rafal Garbat wrote:<br>
    </div>
    <blockquote type="cite">
      
      <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" target="_blank">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>-- <br>
              Mathieu Duponchelle · <a href="https://www.centricular.com" target="_blank">https://www.centricular.com</a><br>
              <br>
            </div>
            <div>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></fieldset>
              <pre>_______________________________________________
gstreamer-devel mailing list
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">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">gstreamer-devel@lists.freedesktop.org</a><br>
          <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
gstreamer-devel mailing list
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></pre>
    </blockquote>
    <br>
  </div>

_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote></div>
</blockquote></div>