Parsebin doesnt link with mpegtsmux when using h264 payload

Viewed 217

The problem: I am trying to setup a pipeline, which reads from different RTSP sources, and saves the video as mpegts without reencoding. The rtp payload can be h264, h265, mpegts with different encoders.

This is what I came up with:
gst-launch-1.0 urisourcebin uri=rtsp://<stream> ! parsebin ! mpegtsmux ! fakesink

It worked perfectly, when the payload was mpegts, but as soon as i tried it with h264 rtp, there was a linking issue. I think parsebin produces stream-format=avc streams, and the mpegtsmux can only receive byte-stream. The weird thing is that the parsebin converts it to avc inside the bin, it is originally byte-stream.

What I have tried(With some distilled examples):

This works as stated:
videotestsrc ! x264enc ! mpegtsmux ! rtpmp2tpay ! parsebin ! mpegtsmux ! fakesink

This gives linking error:
videotestsrc ! x264enc ! rtph264pay ! parsebin ! mpegtsmux ! fakesink

This works for h264, because the parser converts the stream-format, but the same pipeline obviously wont fork for h265. And also there is a h264parse in parsebin, so it is duplicated.
videotestsrc ! x264enc ! rtph264pay ! parsebin ! h264parse ! mpegtsmux ! fakesink

Without autoplugging, it works fine, just not universal enough for my use-case:
videotestsrc ! x264enc ! rtph264pay ! rtph264depay ! mpegtsmux ! fakesink

Also setting caps filters won't work, as parsebin wont output byte-stream.

My question is, am i missing something? Is there any way to configure the autoplug in parsebin to produce byte-stream. If not, is there any way to autoplug the h264parse/h265parse to change the stream-format after parsebin.

Here is the log of a run in gstreamer 1.18.3 with GST_DEBUG=3
https://pastebin.com/dJksA4BB

0 Answers
Related