Setting PIDs for mpegtsmux
Jesper Larsen
knorr.jesper at gmail.com
Tue May 26 23:12:33 PDT 2015
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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150527/2add4de6/attachment.html>
More information about the gstreamer-devel
mailing list