[pyds] Unable to create NvStreamMux, pgie, nvosd

I’ve extracted ds_pybind to deepstream folder.

This is the error:

$ python deepstream_test_1.py MOT16-11.mp4
Creating Pipeline

Creating Source

Creating H264Parser

Creating Decoder

 Unable to create NvStreamMux
 Unable to create pgie
 Unable to create nvosd
Creating EGLSink

The corresponding codes:

    # Create nvstreammux instance to form batches from one or more sources.
    streammux = Gst.ElementFactory.make("nvstreammux", "Stream-muxer") # returns None
    if not streammux:
        sys.stderr.write(" Unable to create NvStreamMux \n")

    # Use nvinfer to run inferencing on decoder's output,
    # behaviour of inferencing is set through config file
    pgie = Gst.ElementFactory.make("nvinfer", "primary-inference") # returns None
    if not pgie:
        sys.stderr.write(" Unable to create pgie \n")

    # Use convertor to convert from NV12 to RGBA as required by nvosd
    nvvidconv = Gst.ElementFactory.make("nvvideoconvert", "convertor")
    if not nvvidconv:
        sys.stderr.write(" Unable to create nvvidconv \n")

    # Create OSD to draw on the converted RGBA buffer
    nvosd = Gst.ElementFactory.make("nvdsosd", "onscreendisplay") # returns None
    if not nvosd:
        sys.stderr.write(" Unable to create nvosd \n")

It’s seems some nv components are None. When I go to interactive python shell, I try

Gst.ElementFactory.make("nvstreammux", "Stream-muxer")

but it’s None

How do I debug this? How do I make sure the ElementFactory can return successfully?

Looks like there is a problem with my own Deepstream

This appears when I’m on apt:

E: The package deepstream-4.0 needs to be reinstalled, but I can't find an archive for it.

Reinstalling deepstream does the trick