'is there a way to create dynamic pipeline in gst-launch-1.0 PIPELINE-DESCRIPTION?

I know how to create dynamic pipeline in python or c, but I wonder is it possible to create dynamic pipeline in the PIPELINE-DESCRIPTION language?

I have a hls stream, which may contain audio, video or audio+video, I want to be able to deal with the pipeline-description. Following pipline breaks when there is video only or audio only

gst-launch-1.0 -e rtspsrc location='rtsp://localhost:554' latency=0 name=d d. ! queue ! capsfilter caps="application/x-rtp,media=video" ! rtph264depay ! mpegtsmux name=mux ! filesink location=file.ts d. ! queue ! capsfilter caps="application/x-rtp,media=audio" ! decodebin ! audioconvert ! audioresample ! lamemp3enc ! mux.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source