Gstreamer Python Pipeline udpsrc->rtph264depay->h264parse... Not Working

50 Views Asked by At

I have setup a UDP Multicast address from where I want to read it in Gstreamer (in Python). When I run the code the rtp packets seems to be going through the rtph264depay (in the DEBUG output) but nothing happening after that. I am not sure what is wrong. Can you suggest something ?

Here is my relevant code/pipeline:

    uD = Gst.ElementFactory.make("udpsrc", "source")
    uD.set_property("address", "224.1.0.1")
    uD.set_property("port", 8002)
    caps = Gst.caps_from_string("application/x-rtp, media=video, clock-rate=90000, encoding-name=H264")
    uD.set_property("caps", caps)

    rD = Gst.ElementFactory.make("rtph264depay", "rD")
    hP = Gst.ElementFactory.make("h264parse", "hP")
    aV = Gst.ElementFactory.make("avdec_h264", "aV")
    vC = Gst.ElementFactory.make("videoconvert", "vC")
    cF = Gst.ElementFactory.make("capsfilter", "cF")
    video_caps = Gst.caps_from_string("video/x-raw,format=BGR")
    cF.set_property("caps", video_caps)
    aF = Gst.ElementFactory.make("appsink", "aF")
    aF.set_property("emit-signals", True)
    aF.connect("new-sample", self.aF_callback)
    
    for ele in [uD,rD,hP,aV,vC,cF,aF]:
        self.pipeline.add(ele)

    uD.link(rD)
    rD.link(hP)
    hP.link(aV)
    aV.link(vC)
    vC.link(cF)
    cF.link(aF)

My expectaction is that self.aF_callback, should be called, but its not. When I just run it without any processing, that is udpsrc->appsink then I get the call back (obviously without processing), so that means the udpsrc is fine.

The same pipeline (obviously with different caps) is working with rtspsrc. I tried other ways to give caps, but with same results... the appsink callback code is not called.

0

There are 0 best solutions below