Merge two MPEG-TS streams with higher bitrate

Rafal Garbat garbbraf at gmail.com
Wed Sep 18 16:54:38 UTC 2019


Hi Mathieu.

Thank you for the quick anwer.
The content of the ts file is as follows:
  container: MPEG-2 Transport Stream
    audio: MPEG-1 Layer 2 (MP2)
    subtitles: DVB subtitles
    audio: MPEG-1 Layer 2 (MP2)
    video: MPEG-2 Video (Main Profile)

I have tried the example you gave, but I'm getting errors like:
```
WARNING: from element /GstPipeline:pipeline0/GstTSDemux:demux: Delayed
linking failed.
Additional debug info:
./grammar.y(510): gst_parse_no_more_pads ():
/GstPipeline:pipeline0/GstTSDemux:demux:
failed delayed linking pad  sink_0 of GstTSDemux named demux to some pad of
GstQueue named queue0
```

Is that related to wrong parser I was using (mpegvideoparse) ? Do I really
need to parse it before remuxing?

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?

Regards,
R


śr., 18 wrz 2019 o 18:15 Mathieu Duponchelle <mathieu at centricular.com>
napisał(a):

> mpegtsmux now has support for CBR as you've noticed (the bitrate
> property), so
> it should simply be a matter of remuxing the input file indeed.
>
> If you want to do this from the command line, the command line will need to
> match the streams contained in your input file, so it's not possible for
> us to
> give you a working pipeline :)
>
> It should more or less look like:
>
> mpegtsmux bitrate=<bitrate> name=mux ! filesink location=<path> filesrc location=<path> ! tsdemux name=demux \
>
>   demux.sink_%d ! <parser> ! queue ! mux.
>
>   <repeat above for every stream in the input file>
>
>
> --
> Mathieu Duponchelle · https://www.centricular.com
>
> On 9/18/19 5:58 PM, Rafal Garbat wrote:
>
> Hi.
>
> 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).
>
> 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:
>       filesrc location=in.ts  ! ...some magic here... !  mpegtsmux
> bitrate=51253960 ! filesink location=out.ts
> I have tried some variations but couldn't setup a working pipeline so far.
>
> 2. Maybe there is a simpler and obvious solution I'm missing here.
>
> BR,
> Rafal
>
> _______________________________________________
> gstreamer-devel mailing listgstreamer-devel at lists.freedesktop.orghttps://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190918/d2651d22/attachment.html>


More information about the gstreamer-devel mailing list