Pipeline is not working if I use fakesink and filesink at a same time using tee element

• Hardware Platform: dGPU
• DeepStream Version: 5.0
• TensorRT Version: 7.0.0-1+cuda10.2
• NVIDIA GPU Driver Version: 465.19.01

Hello there,
I have a working pipeline whose last element is fakesink, now I want to modify it a bit, I need to add a tee element into it to attach fakesink and filesink at a same time, I’ve added the tee element, attached fakesink, and filesink, the pipeline doesn’t work when I try to use them in parallel. It works if I comment-out either fakesink or filesink but again the data is not getting stored into the .mp4 file although the data is flowing through the pipeline, I’ve checked it using the probe function.

                tee_fake = tee.get_request_pad("src_0")
                sinkpad = nvvidconv.get_static_pad("sink")
                if not sinkpad:
                    sys.stderr.write(" Unable to get sink pad of encoder \n")
                tee_record = tee.get_request_pad("src_1")
                tee_record.add_probe(Gst.PadProbeType.BUFFER, self.check_src_pad_buffer_probe, 0)
                self.recording_pipeline(tee_record, pipeline, i)

    def recording_pipeline(self, tee_src_pad, pipeline, i):
        nvvidconv_rec = Gst.ElementFactory.make("videoconvert", "convertor2-rec-%u"%i)
        if not nvvidconv_rec:
            sys.stderr.write(" Unable to create nvvidconv_rec \n")
        print("Creating nvvidconv_rec \n")
        nvvidconv_sink_pad_rec = nvvidconv_rec.get_static_pad('sink')
        if not nvvidconv_sink_pad_rec:
            sys.stderr.write('Could not fetch sink pad for recording nvvidconv_rec')

        rtph264depay = Gst.ElementFactory.make("rtph264depay", "rtph264depay-rec-%u"%i)
        if not rtph264depay:
            sys.stderr.write(" Unable to create rtph264depay \n")
        print("Creating rtph264depay \n")

        h264parse = Gst.ElementFactory.make("h264parse", "h264parse-rec-%u"%i)
        if not h264parse:
            sys.stderr.write(" Unable to create h264parse \n")
        print("Creating h264parse \n")
        mp4mux = Gst.ElementFactory.make("mp4mux", "mp4mux-rec-%u"%i)
        if not mp4mux:
            sys.stderr.write(" Unable to create mp4mux \n")
        print("Creating mp4mux \n")

        filesink = Gst.ElementFactory.make("filesink", "filesink-rec-%u"%i)
        if not filesink:
            sys.stderr.write(" Unable to create file sink \n")
        filesink.set_property("location", "./out.mp4")

I would really appreciate if somebody can help…

It has nothing to do with deepstream. Please try your pipeline with “gst-launch” first and debug by yourself.