Injecting custom data into mpegts via udpsrc

James Linder jam at tigger.ws
Sat Sep 25 02:25:54 UTC 2021



> On 24 Sep 2021, at 11:22 pm, Jesper Taxbøl via gstreamer-devel <gstreamer-devel at lists.freedesktop.org> wrote:
> 
> I have now implemented my issue in a public repo
> 
> https://github.com/taxfromdk/mpegtsmux_metadata
> 
> I can add that I am working in Ubuntu 20.04 and I am using the apt-get version of gstreamer.
> 
> GStreamer 1.16.2
> 
> I hope this can shed some light to my issue.
> 
> Kind regards
> 
> Jesper
> 
> 
> Den tor. 23. sep. 2021 kl. 12.22 skrev Jesper Taxbøl <jesper at taxboel.dk>:
> 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.
> 

Jesper

I’ve been posting about strange behaviour to no avail

Eventually I built from git using the https://gstreamer.freedesktop.org/documentation/frequently-asked-questions/git.html?gi-language=c
It was easy AND all my problems went away.
I installed in /usr/local but from a packaging point /opt/gstreamer is probably a better choice (I built 19.1, using meson; apt-file is your friend)

James


More information about the gstreamer-devel mailing list