Injecting custom data into mpegts via udpsrc

Jesper Taxbøl jesper at taxboel.dk
Thu Sep 23 10:22:44 UTC 2021


Hi ,

I am working on a project where I use a mpegtsmux component to mux audio
data into a ts file. This has worked fine for a while now.

gst-launch-1.0 \
    mpegtsmux name=mux ! filesink location=test.ts \
    audiotestsrc is-live=true ! avenc_aac ! mux.

But I am experiencing some strange behaviour with some sensors in my
application and would like to be able to debug this behaviour in the
context of the audio track.

I would therefore like to add an extra data track in the tsmuxer to debug
in the context of the audio. Note that the extra data will arrive randomly
with no guranteed interval.

I was thinking about using a structure like this to achieve the goal.

gst-launch-1.0 \
    mpegtsmux name=mux ! filesink location=test.ts \
    audiotestsrc is-live=true ! avenc_aac ! mux. \
    udpsrc port=9001 ! meta/x-klv ! mux.

The idea would be that I would use a UDP src as input for said data,
because I can pipe stdout from my main app into the stream. I would also be
able to inject other interresting sources into extra tracks if needed.

This works conceptually, but I have run into a problem. It seems that the
mpegtsmuxer stalls if there is not sent data on the UDP inputs.

I am therefore wondering if the TS muxer need a "heartbeat" on each input,
and more importantly, if there is a way to disable this need so I can just
inject when data arrives.

I must note that the output TS file is only used internally in this
project, so I have no need to conform with extenal standards. I just need
some debug data for my application.

Kind regards

Jesper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210923/a20ed950/attachment.htm>


More information about the gstreamer-devel mailing list