How to multiplex audio and video into mpegtsmux

jmz jmzheng at gmail.com
Mon Oct 16 10:41:31 UTC 2017


jmz wrote
> a) Create rtspsrc & mpegtsmux & sink and add them to pipeline
> b) Set pipeline to PAUSED
> c) Set rtspsrc to PLAYING (necessary because rtspsrc is live source)
> d) In pad-added callback of rtspsrc, add video and audio stream to
> pipeline,
> link elements, and sync state with pipeline
> e) In no-more-pads callback of rtspsrc, set pipeline to PLAYING


I changed my program flow as follows.
a) Add only rtspsrc to pipeline and set the pipeline PLAYING
b) In pad-added callback of rtspsrc, add depayloader & parser & mpegtsmux &
filesink to pipeline, link them together, and sync state (except for
mpegtsmux and filesink) with pipeline
c) In no-more-pads callback of rtspsrc, sync mpegtsmux and filesink state
with pipeline

In this flow, "mpegtsmux0: Could not multiplex stream." does not appear. But
the pipeline stays in PAUSED state and filesink stays in READY while the
other elements (including mpegtsmux) have been PLAYING. This does work :(

I further found in dot graph that the caps between parser (e.g. h264parse)
and mpegtsmux are not negotiated. How can I let the caps be negotiated?

In addition, I saw some logs as folows (where mpegtsmux0:sink_65 is linked
with h264parse0:src):
INFO               GST_EVENT
gstpad.c:5083:gst_pad_send_event_unchecked:<mpegtsmux0:sink_65> Received
event on flushing pad. Discarding

On the other hand, if mpegtsmux is set to PLAYING in the pad-added callback
of rtspsrc for video stream, the caps between h264parse and mpegtsmux are
negotiated. But, I cannot multiplex the audio stream into M2TS later in the
pad-added callback.

I would appreciate it if someone could help.




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list