Setting PIDs for mpegtsmux

Peter Maersk-Moller pmaersk at gmail.com
Wed May 27 02:12:44 PDT 2015


Hi Jesper.

Thanks for the info. Very helpful and very useful.

Now for the other end, the consuming or decoding end. I assume I can do
something similar with tsdemux.

  gst-launch-v udpsrc ..... ! mtsdemux program-number=10 ! .....

Haven't tested it yet, but it'll be close I think.

What if you want to control what program number to decode in a decodebin.
Is there a less known, less documented way to parse this information to
decodebin? I remember there is a way to set some parameters of a bin in
GStreamer, however I have never found the formal documentations for that.

best regards.

Peter Maersk-Moller




Is there a way to filter which PID gets decoded when using decodebin or
tsdemux

On Wed, May 27, 2015 at 9:39 AM, Jesper Larsen <knorr.jesper at gmail.com>
wrote:

> Well, my knowledge was just increased. You can actually set the prog-map
> preoperty using gst-launch
>
> gst-launch-1.0 -v videotestsrc name=vsrc1 is-live=true do-timestamp=true !
> x264enc ! queue ! h264parse ! muxer.sink_300 mpegtsmux name=muxer
> prog-map=program_map,sink_300=10,sink_301=11 ! queue ! tcpserversink
> host=0.0.0.0 sync-method=2 recover-policy=keyframe port=5000  videotestsrc
> name=vsrc2 is-live=true do-timestamp=true ! x264enc ! queue ! h264parse !
> muxer.sink_301
>
> This will put the video on PID 300 on program number 10, and PID 301 on
> program 11.
>
> On Wed, May 27, 2015 at 8:12 AM, Jesper Larsen <knorr.jesper at gmail.com>
> wrote:
>
>> You can set the PID when requesting a sink pad from the mux. I.e.
>>
>> gst-launch-1.0 -v videotestsrc name=vsrc1 is-live=true do-timestamp=true
>> ! x264enc ! queue ! h264parse ! muxer.sink_300 mpegtsmux name=muxer ! queue
>> ! tcpserversink host=0.0.0.0 sync-method=2 recover-policy=keyframe
>> port=5000  videotestsrc name=vsrc2 is-live=true do-timestamp=true ! x264enc
>> ! queue ! h264parse ! muxer.sink_301
>>
>> to use PID 300 and 301 instead.
>>
>> I'm afraid you cannot configure which PIDs belongs to which program/PMT
>> using gst-launch.
>> You need to set the "prog-map" property of the mpegtsmux element, which
>> takes a GstStructure, and to my knowledge you cannot specify a GstStructure
>> using gst-launch.
>>
>> An example of setting the two videostreams to specific program numbers (3
>> and 4):
>>
>> GstElement *mux;
>> GstStructure *pm;
>>
>> mux = gst_element_factory_make ("mpegtsmux", NULL);
>>
>> pm = gst_structure_new_empty ("program_map");
>> gst_structure_set (pm, "sink_300", G_TYPE_INT, 3,
>>                            "sink_301", G_TYPE_INT, 4, NULL);
>> g_object_set (mux, "prog-map", pm, NULL);
>>
>> This will associate PID 300 to program 3, and PID 301 to program 4. When
>> you add the audio streams you simply give those a fixed PID as well, and
>> associate them with the program containing the correct video stream.
>>
>> Ad Astra.
>> Jesper
>>
>> On Tue, May 26, 2015 at 5:25 PM, Peter Maersk-Moller <pmaersk at gmail.com>
>> wrote:
>>
>>> Hi
>>>
>>> When you are muxing multiple video streams with mpegtsmux, is there then
>>> a way to set/control (on the command line using gst-launch) the PIDs of
>>> video streams that the mpegtsmux chooses for each video stream?
>>>
>>> A quick test with the following command line reveals mpegtsmux chooses
>>> PID 65 and 66.
>>>
>>> gst-launch-1.0 -v videotestsrc name=vsrc1 is-live=true do-timestamp=true
>>> ! x264enc ! queue ! h264parse ! mpegtsmux name=muxer ! queue !
>>> tcpserversink host=0.0.0.0 sync-method=2 recover-policy=keyframe port=5000
>>> videotestsrc name=vsrc2 is-live=true do-timestamp=true ! x264enc ! queue !
>>> h264parse ! muxer.
>>>
>>> Assuming you have audio as well, is there a way to set/control which
>>> audio stream belongs to which video stream (for PAD/PMT) ?
>>>
>>> Best regards
>>> Peter MM
>>>
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> gstreamer-devel at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>
>>>
>>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150527/d6dba4f7/attachment.html>


More information about the gstreamer-devel mailing list