Record video on anomaly detection in Python

i need to record video framas when an anomaly is detected . Can i use splitmuxsink . if so can get an example of the same .


buntu@ip-172-31-11-102:~/sriharsha$ nvidia-smi
Thu Jan 20 10:08:39 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.63.01    Driver Version: 470.63.01    CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla T4            Off  | 00000000:00:1E.0 Off |                    0 |
| N/A   29C    P0    26W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

**•	Hardware Platform (Jetson / GPU)**
**•	DeepStream Version** 5.1
**•	TensorRT Version** 7.1
**•	NVIDIA GPU Driver Version (valid for GPU only)**

Yes, you can. The usage is in splitmuxsink (gstreamer.freedesktop.org)

It is not a deepstream topic.

Is there a test application repo or link ??? for reference ?

reference for what? How to use splitmuxsink? The gstreamer document is enough for splitmuxsink usage.

For how to detect anomaly? It is your own use case, you need to develop your own app according to your requirements.

my bin is as below

Gst.Bin.add(nbin, queue, nvvidconv_pre, nvosd, nvvidconv, caps, encoder,  rtppay, sink)

where do i add splitmuxsink and should i need to use “tee” in between ?

splitmuxsink is a sink plugin ( Sink elements (gstreamer.freedesktop.org)), you can use it as other sink plugins. Where to add it depends on what you want to dump by splitmuxsink. Whether to use tee depends on your requirement too.

i have the below function code ,

    tee=Gst.ElementFactory.make("tee", "nvsink-tee")
    if not tee:
        sys.stderr.write(" Unable to create tee \n")

    queuetee1=Gst.ElementFactory.make("queue", "nvtee-que1")
    if not queuetee1:
        sys.stderr.write(" Unable to create queuetee1 \n")

    queuetee2=Gst.ElementFactory.make("queue", "nvtee-que2")
    if not queuetee2:
        sys.stderr.write(" Unable to create queuetee2 \n")

    uridecodebin_c = "uridecodebin_%u" %index
    print("Creating uridecodebin \n ")
    uridecodebin2 = Gst.ElementFactory.make("uridecodebin", uridecodebin_c)


    # uridecodebin = Gst.ElementFactory.make('uridecodebin')
    
    splitmuxsink_c = "splitmuxsink_%u" %index
    print("Creating splitmuxsink \n ")
    splitmuxsink = Gst.ElementFactory.make("splitmuxsink", splitmuxsink_c)

    
    # splitmuxsink = Gst.ElementFactory.make('splitmuxsink')
    pipeline.add(uridecodebin2)
    pipeline.add(splitmuxsink)

    #splitmux change
    uridecodebin2.set_property('uri', input_url)
    uridecodebin2.connect('autoplug-factories', on_autoplug_factories, None)
    uridecodebin2.connect('autoplug-continue', on_autoplug_continue, None)
    # uridecodebin.connect('pad-added', on_pad_added, (pipeline, splitmuxsink))
    uridecodebin2.connect('pad-added', on_pad_added, (pipeline, splitmuxsink))
    
    output_dir = "/home/ubuntu/sriharsha/videos/testing"
    
    # TODO fix mp4mux to properly segment files
    splitmuxsink.set_property('muxer', Gst.ElementFactory.make('matroskamux'))
    splitmuxsink.set_property('location', output_dir + '/' + 'segment_%09d.mkv')
    # splitmuxsink.set_property('max-size-time', 10000000000) #10s segments
    splitmuxsink.set_property('max-size-time', 10000000000) #10s segments


Gst.Bin.add(nbin, queue, nvvidconv_pre, nvosd, nvvidconv, caps, encoder, tee, uridecodebin,  splitmuxsink, encoder0, rtppay, sink)
    #link

    queue.link(nvvidconv_pre)
    nvvidconv_pre.link(nvosd)
    nvosd.link(nvvidconv)
    nvvidconv.link(caps)
    caps.link(encoder)

   

   

    caps.link(tee)
    tee.link(encoder0)
    encoder0.link(uridecodebin)
    uridecodebin.link(splitmuxsink)

       

    encoder.link(rtppay)
    rtppay.link(sink)

    #ghostpad
    pad = queue.get_static_pad("sink")

    ghost_pad = Gst.GhostPad.new("sink", pad)

    nbin.add_pad(ghost_pad)

    return nbin

i get the below error

0:00:00.036315405  6157 0x55c83f382ef0 WARN                  ladspa gstladspa.c:507:plugin_init:<plugin50> no LADSPA plugins found, check LADSPA_PATH
0:00:00.050785486  6157 0x55c83f382ef0 WARN                   vaapi gstvaapiutils.c:77:gst_vaapi_warning: va_getDriverName() failed with unknown libva error,driver_name=(null)
0:00:00.051083963  6157 0x55c83f382ef0 WARN                   vaapi gstvaapiutils.c:77:gst_vaapi_warning: va_getDriverName() failed with unknown libva error,driver_name=(null)
0:00:00.051163815  6157 0x55c83f382ef0 ERROR                default gstvaapi.c:254:plugin_init: Cannot create a VA display
0:00:00.059176823  6157 0x55c83f382ef0 ERROR                    omx gstomx.c:2769:plugin_init: Core '/usr/lib/libomxil-bellagio.so.0' does not exist for element 'omxmpeg4videodec'
0:00:00.059194713  6157 0x55c83f382ef0 ERROR                    omx gstomx.c:2769:plugin_init: Core '/usr/lib/libomxil-bellagio.so.0' does not exist for element 'omxh264dec'
0:00:00.059210931  6157 0x55c83f382ef0 ERROR                    omx gstomx.c:2769:plugin_init: Core '/usr/lib/libomxil-bellagio.so.0' does not exist for element 'omxmpeg4videoenc'
0:00:00.059225113  6157 0x55c83f382ef0 ERROR                    omx gstomx.c:2769:plugin_init: Core '/usr/lib/libomxil-bellagio.so.0' does not exist for element 'omxaacenc'
0:00:00.059232895  6157 0x55c83f382ef0 WARN      GST_PLUGIN_LOADING gstplugin.c:527:gst_plugin_register_func: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstomx.so" failed to initialise
0:00:00.182264764  6157 0x55c83f382ef0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x120000: 'AVR (Audio Visual Research)' is not mapped
0:00:00.182283957  6157 0x55c83f382ef0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x180000: 'CAF (Apple Core Audio File)' is not mapped
0:00:00.182293954  6157 0x55c83f382ef0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x100000: 'HTK (HMM Tool Kit)' is not mapped
0:00:00.182305410  6157 0x55c83f382ef0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0xc0000: 'MAT4 (GNU Octave 2.0 / Matlab 4.2)' is not mapped
0:00:00.182315688  6157 0x55c83f382ef0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0xd0000: 'MAT5 (GNU Octave 2.1 / Matlab 5.0)' is not mapped
0:00:00.182323381  6157 0x55c83f382ef0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x210000: 'MPC (Akai MPC 2k)' is not mapped
0:00:00.182331205  6157 0x55c83f382ef0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0xe0000: 'PVF (Portable Voice Format)' is not mapped
0:00:00.182338896  6157 0x55c83f382ef0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x160000: 'SD2 (Sound Designer II)' is not mapped
0:00:00.182347533  6157 0x55c83f382ef0 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x190000: 'WVE (Psion Series 3)' is not mapped
0:00:00.186867692  6157 0x55c83f382ef0 ERROR                    omx gstomx.c:2769:plugin_init: Core '/usr/lib/libomxil-bellagio.so.0' does not exist for element 'omxmpeg4videodec'
0:00:00.186886034  6157 0x55c83f382ef0 ERROR                    omx gstomx.c:2769:plugin_init: Core '/usr/lib/libomxil-bellagio.so.0' does not exist for element 'omxh264dec'
0:00:00.186897007  6157 0x55c83f382ef0 ERROR                    omx gstomx.c:2769:plugin_init: Core '/usr/lib/libomxil-bellagio.so.0' does not exist for element 'omxmpeg4videoenc'
0:00:00.186906128  6157 0x55c83f382ef0 ERROR                    omx gstomx.c:2769:plugin_init: Core '/usr/lib/libomxil-bellagio.so.0' does not exist for element 'omxaacenc'
0:00:00.186913565  6157 0x55c83f382ef0 WARN      GST_PLUGIN_LOADING gstplugin.c:527:gst_plugin_register_func: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstomx-generic.so" failed to initialise
0:00:00.291330584  6157 0x55c83f382ef0 WARN      GST_PLUGIN_LOADING gstplugin.c:792:_priv_gst_plugin_load_file_for_registry: module_open failed: libtritonserver.so: cannot open shared object file: No such file or directory

(gst-plugin-scanner:6157): GStreamer-WARNING **: 13:09:18.844: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferserver.so': libtritonserver.so: cannot open shared object file: No such file or directory
0:00:00.439085990  6147      0x26b6c90 WARN            GST_REGISTRY gstregistry.c:1835:gst_update_registry: registry update failed: Error writing registry cache to /home/ubuntu/.cache/gstreamer-1.0/registry.x86_64.bin: Permission denied
Creating Pipeline 
 
Creating streamux 
 
Creating source_bin  0  
 
Creating source bin
source-bin-00
Creating Pgie 
 
Creating nvtracker 
 
Creating nvdsanalytics 
 
Unknown key 'OC-label' in group in 'overcrowding-stream-0'
Creating nvstreamdemux   
 
Adding elements to Pipeline 

Linking elements in the Pipeline 

Creating sink_bin  0  
 
Creating sink bin
sink-bin-00
Creating nvvidconv pre 
 
Creating nvosd 
 
Creating nvvidconv 
 
Creating H264 Encoder
Creating H264 Encoder
Creating H264 rtppay

 updsink_port_num = %u 7001
Creating uridecodebin 
 
Creating splitmuxsink 
 

(python3:6147): GStreamer-WARNING **: 13:09:19.076: Element 'uridecodebin_0' already has parent
Traceback (most recent call last):
  File "PoC_HelmetTest.py", line 1376, in <module>
    sys.exit(main())
  File "PoC_HelmetTest.py", line 1101, in main
    sink_bin = create_sink_bin (i, uri_name, q);
  File "PoC_HelmetTest.py", line 727, in create_sink_bin
    Gst.Bin.add(nbin, queue, nvvidconv_pre, nvosd, nvvidconv, caps, encoder,queuetee1,queuetee2, tee, encoder0,  uridecodebin,  splitmuxsink,    rtppay, sink)
  File "/usr/lib/python3/dist-packages/gi/overrides/Gst.py", line 65, in add
    raise AddError(arg)
gi.overrides.Gst.AddError: <__gi__.GstURIDecodeBin object at 0x7fb291ff5630 (GstURIDecodeBin at 0x290e560)>```

below is the latest error , could you please help out




0:00:00.518089585 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder_0:sink> Unable to try format: Unknown error -1
0:00:00.518110588 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<encoder_0:sink> Could not probe minimum capture size for pixelformat YM12
0:00:00.518122630 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder_0:sink> Unable to try format: Unknown error -1
0:00:00.518136561 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<encoder_0:sink> Could not probe maximum capture size for pixelformat YM12
0:00:00.518152292 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2375:gst_v4l2_object_add_interlace_mode:0x38713d0 Failed to determine interlace mode
0:00:00.518172707 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder_0:sink> Unable to try format: Unknown error -1
0:00:00.518183860 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<encoder_0:sink> Could not probe minimum capture size for pixelformat NM12
0:00:00.518194863 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder_0:sink> Unable to try format: Unknown error -1
0:00:00.518205203 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<encoder_0:sink> Could not probe maximum capture size for pixelformat NM12
0:00:00.518217006 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2375:gst_v4l2_object_add_interlace_mode:0x38713d0 Failed to determine interlace mode
0:00:00.518266709 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder_0:src> Unable to try format: Unknown error -1
0:00:00.518279905 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<encoder_0:src> Could not probe minimum capture size for pixelformat H264
0:00:00.518290420 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder_0:src> Unable to try format: Unknown error -1
0:00:00.518301431 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<encoder_0:src> Could not probe maximum capture size for pixelformat H264
0:00:00.518516514 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder0_0:sink> Unable to try format: Unknown error -1
0:00:00.518537586 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<encoder0_0:sink> Could not probe minimum capture size for pixelformat YM12
0:00:00.518548139 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder0_0:sink> Unable to try format: Unknown error -1
0:00:00.518557962 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<encoder0_0:sink> Could not probe maximum capture size for pixelformat YM12
0:00:00.518578914 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2375:gst_v4l2_object_add_interlace_mode:0x3873270 Failed to determine interlace mode
0:00:00.518593253 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder0_0:sink> Unable to try format: Unknown error -1
0:00:00.518603488 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<encoder0_0:sink> Could not probe minimum capture size for pixelformat NM12
0:00:00.518611664 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder0_0:sink> Unable to try format: Unknown error -1
0:00:00.518620880 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<encoder0_0:sink> Could not probe maximum capture size for pixelformat NM12
0:00:00.518630283 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2375:gst_v4l2_object_add_interlace_mode:0x3873270 Failed to determine interlace mode
0:00:00.518665350 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder0_0:src> Unable to try format: Unknown error -1
0:00:00.518674937 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<encoder0_0:src> Could not probe minimum capture size for pixelformat H264
0:00:00.518684947 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder0_0:src> Unable to try format: Unknown error -1
0:00:00.518695119 22117      0x3191890 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<encoder0_0:src> Could not probe maximum capture size for pixelformat H264

below is my code


    nvvidconv_c = "convertor_%u" %index
    print("Creating nvvidconv \n ")
    nvvidconv = Gst.ElementFactory.make("nvvideoconvert", nvvidconv_c)
    if not nvvidconv:
        sys.stderr.write(" Unable to create nvvidconv %u\n", i)

    caps_c = "caps1_%u" %index
    caps1 = Gst.ElementFactory.make("capsfilter", caps_c)
    caps1.set_property("caps", Gst.Caps.from_string("video/x-raw(memory:NVMM), format=I420"))
    

    # Make the encoder
    encoder_c = "encoder1_%u" %index
    print("Creating H264 Encoder")
    encoder1 = Gst.ElementFactory.make("nvv4l2h264enc", encoder_c)
    if not encoder1:
        sys.stderr.write(" Unable to create encoder")

    encoder1.set_property('bitrate', bitrate)
    
    
    caps_c = "cap2s_%u" %index
    caps2 = Gst.ElementFactory.make("capsfilter", caps_c)
    # caps1.set_property("caps", Gst.Caps.from_string("video/x-raw(memory:NVMM), format=I420"))
    caps2.set_property("caps", Gst.Caps.from_string("video/x-raw, format=I420"))
    
    encoder_c = "encoder2_%u" %index
    print("Creating H264 Encoder")
    # encoder2 = Gst.ElementFactory.make("nvv4l2h264enc", encoder_c)
    encoder2 = Gst.ElementFactory.make("x264enc", encoder_c)
    if not encoder2:
        sys.stderr.write(" Unable to create encoder")

    encoder2.set_property('bitrate', bitrate)


    
    
    
    # Make the payload-encode video into RTP packets
    rtppay_c = "rtppay_%u" %index
    rtppay = Gst.ElementFactory.make("rtph264pay", rtppay_c)
    print("Creating H264 rtppay")
    if not rtppay:
        sys.stderr.write(" Unable to create rtppay")
    
    # Make the UDP sink
    updsink_port_num = udp_sink_port_num
    updsink_port_num += index
    print("\n updsink_port_num = %u", updsink_port_num)
    udpsink_c = "udpsink_%u" %index
    sink = Gst.ElementFactory.make("udpsink", udpsink_c)
    if not sink:
        sys.stderr.write(" Unable to create udpsink")
    
    sink.set_property('host', '224.224.255.255')
    sink.set_property('port', updsink_port_num)
    sink.set_property('async', False)
    sink.set_property('sync', 1)

    sink.set_property("qos",0)
    
    tee=Gst.ElementFactory.make("tee", "nvsink-tee")
    if not tee:
        sys.stderr.write(" Unable to create tee \n")
    tee_msg_pad=tee.get_request_pad('src_%u')
    tee_render_pad=tee.get_request_pad("src_%u")
    
    if not tee_msg_pad or not tee_render_pad:
        sys.stderr.write("Unable to get request pads\n")
    
    queue1 = Gst.ElementFactory.make("queue", "nvtee-que1")
    if not queue1:
        sys.stderr.write(" Unable to create queue1 \n")

    queue2 = Gst.ElementFactory.make("queue", "nvtee-que2")
    if not queue2:
        sys.stderr.write(" Unable to create queue2 \n")



    
    splitmuxsink_c = "splitmuxsink_%u" %index
    print("Creating splitmuxsink \n ")
    splitmuxsink = Gst.ElementFactory.make("splitmuxsink", splitmuxsink_c)
    # splitmuxsink.set_property('muxer', Gst.ElementFactory.make('matroskamux'))

    splitmuxsink.set_property('muxer', Gst.ElementFactory.make('qtmux'))
    splitmuxsink.set_property('location', '/home/ubuntu/sriharsha/videos/testing/segment_%09d.mkv')
    splitmuxsink.set_property('max-size-time', 10000000000) #10s segments
    
  
    sink_pad = queue1.get_static_pad("sink")
    tee_msg_pad = tee.get_request_pad('src_%u')
    tee_render_pad = tee.get_request_pad("src_%u")
    if not tee_msg_pad or not tee_render_pad:
        sys.stderr.write("Unable to get request pads\n")
    tee_msg_pad.link(sink_pad)
    sink_pad = queue2.get_static_pad("sink")
    tee_render_pad.link(sink_pad)
    try:    
        Gst.Bin.add(nbin, queue, nvvidconv_pre, nvosd, nvvidconv, caps1, encoder1, caps2, encoder2, queue1, queue2 ,tee,  splitmuxsink, rtppay, sink)
    except Exception as e:
        print("error in gst bin add", e)

    #link 
    queue.link(nvvidconv_pre)

    nvvidconv_pre.link(nvosd)
    nvosd.link(nvvidconv)
    nvvidconv.link(tee)
    
    queue2.link(caps2)
    caps2.link(encoder2)
    encoder2.link(encoder2)
    encoder2.link(splitmuxsink)

    queue1.link(caps1)
    caps1.link(encoder1)
    encoder1.link(rtppay)
    rtppay.link(sink)
    
    
    


    #ghostpad
    pad = queue.get_static_pad("sink")
    ghost_pad = Gst.GhostPad.new("sink", pad)
    nbin.add_pad(ghost_pad)

and i get the below error :

Starting pipeline

Starting pipeline 

0:00:00.563881816 18103      0x29b0490 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder1_0:sink> Unable to try format: Unknown error -1
0:00:00.563900804 18103      0x29b0490 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<encoder1_0:sink> Could not probe minimum capture size for pixelformat YM12
0:00:00.563913867 18103      0x29b0490 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder1_0:sink> Unable to try format: Unknown error -1
0:00:00.563924094 18103      0x29b0490 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<encoder1_0:sink> Could not probe maximum capture size for pixelformat YM12
0:00:00.563935949 18103      0x29b0490 WARN                    v4l2 gstv4l2object.c:2375:gst_v4l2_object_add_interlace_mode:0x308eee0 Failed to determine interlace mode
0:00:00.563951819 18103      0x29b0490 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder1_0:sink> Unable to try format: Unknown error -1
0:00:00.563960811 18103      0x29b0490 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<encoder1_0:sink> Could not probe minimum capture size for pixelformat NM12
0:00:00.563969384 18103      0x29b0490 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder1_0:sink> Unable to try format: Unknown error -1
0:00:00.563978382 18103      0x29b0490 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<encoder1_0:sink> Could not probe maximum capture size for pixelformat NM12
0:00:00.563988160 18103      0x29b0490 WARN                    v4l2 gstv4l2object.c:2375:gst_v4l2_object_add_interlace_mode:0x308eee0 Failed to determine interlace mode
0:00:00.564024663 18103      0x29b0490 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder1_0:src> Unable to try format: Unknown error -1
0:00:00.564034343 18103      0x29b0490 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<encoder1_0:src> Could not probe minimum capture size for pixelformat H264
0:00:00.564042986 18103      0x29b0490 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<encoder1_0:src> Unable to try format: Unknown error -1
0:00:00.564052390 18103      0x29b0490 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<encoder1_0:src> Could not probe maximum capture size for pixelformat H264
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream/lib/libnvds_mot_klt.so
gstnvtracker: Optional NvMOT_RemoveStreams not implemented
gstnvtracker: Batch processing is OFF
gstnvtracker: Past frame output is OFF
0:00:59.075008714 18103      0x29b0490 INFO                 nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1702> [UID = 1]: deserialized trt engine from :/home/ubuntu/PoC/model/TripleRiding_model/trt.engine
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:685 [FullDims Engine Info]: layers num: 5
0   INPUT  kFLOAT Input           3x384x1248      min: 1x3x384x1248    opt: 8x3x384x1248    Max: 16x3x384x1248   
1   OUTPUT kINT32 BatchedNMS      1               min: 0               opt: 0               Max: 0               
2   OUTPUT kFLOAT BatchedNMS_1    200x4           min: 0               opt: 0               Max: 0               
3   OUTPUT kFLOAT BatchedNMS_2    200             min: 0               opt: 0               Max: 0               
4   OUTPUT kFLOAT BatchedNMS_3    200             min: 0               opt: 0               Max: 0               

0:00:59.075118541 18103      0x29b0490 INFO                 nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1806> [UID = 1]: Use deserialized engine model: /home/ubuntu/PoC/model/TripleRiding_model/trt.engine
0:00:59.089119692 18103      0x29b0490 INFO                 nvinfer gstnvinfer_impl.cpp:313:notifyLoadModelStatus:<primary-inference> [UID 1]: Load new model:config/TripleRiding/PoC_pgie_config.txt sucessfully
0:00:59.089678635 18103      0x29b0490 WARN                 basesrc gstbasesrc.c:3583:gst_base_src_start_complete:<source> pad not activated yet
Decodebin child added: source 

Decodebin child added: decodebin0 

0:00:59.090527661 18103      0x29b0490 WARN                 basesrc gstbasesrc.c:3583:gst_base_src_start_complete:<source> pad not activated yet
Decodebin child added: qtdemux0 

0:00:59.125445316 18103 0x7fac1406ba80 WARN                 qtdemux qtdemux_types.c:233:qtdemux_type_get: unknown QuickTime node type gsst
0:00:59.125471333 18103 0x7fac1406ba80 WARN                 qtdemux qtdemux_types.c:233:qtdemux_type_get: unknown QuickTime node type gstd
0:00:59.125510314 18103 0x7fac1406ba80 WARN                 qtdemux qtdemux.c:3031:qtdemux_parse_trex:<qtdemux0> failed to find fragment defaults for stream 1
0:00:59.125628308 18103 0x7fac1406ba80 WARN                 qtdemux qtdemux.c:3031:qtdemux_parse_trex:<qtdemux0> failed to find fragment defaults for stream 2
Decodebin child added: multiqueue0 

Decodebin child added: h264parse0 

Decodebin child added: capsfilter0 

Decodebin child added: aacparse0 

Decodebin child added: avdec_aac0 

Decodebin child added: nvv4l2decoder0 

0:00:59.178333151 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:59.178351898 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat MJPG
0:00:59.178363653 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:59.178378933 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat MJPG
0:00:59.178402825 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:59.178413733 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat MPG4
0:00:59.178424073 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:59.178435704 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat MPG4
0:00:59.178454489 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:59.178465674 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat MPG2
0:00:59.178476339 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:59.178490537 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat MPG2
0:00:59.178511948 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:59.178523555 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat H265
0:00:59.178534714 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:59.178545535 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat H265
0:00:59.178562933 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:59.178584415 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat VP90
0:00:59.178595363 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:59.178606381 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat VP90
0:00:59.178623760 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:59.178636007 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat VP80
0:00:59.178647051 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:59.178658128 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat VP80
0:00:59.178677866 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:59.178689619 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat H264
0:00:59.178700239 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:59.178710997 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat H264
0:00:59.178767854 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:src> Unable to try format: Unknown error -1
0:00:59.178781129 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2924:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:src> Could not probe minimum capture size for pixelformat NM12
0:00:59.178792396 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:3038:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:src> Unable to try format: Unknown error -1
0:00:59.178804196 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2930:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:src> Could not probe maximum capture size for pixelformat NM12
0:00:59.178820165 18103 0x7fac04013ad0 WARN                    v4l2 gstv4l2object.c:2375:gst_v4l2_object_add_interlace_mode:0x7fabf80273d0 Failed to determine interlace mode
0:00:59.286522130 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286544567 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286581835 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286593017 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286622370 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286632939 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286656414 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286680701 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286707342 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286717606 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286743008 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286753214 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286780390 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286791677 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286820798 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:59.286831212 18103 0x7fac04013ad0 ERROR                   v4l2 gstv4l2object.c:2077:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

In cb_newpad

gstname= video/x-raw
features= <Gst.CapsFeatures object at 0x7fad256d59a8 (GstCapsFeatures at 0x29d0900)>
In cb_newpad

gstname= audio/x-raw
0:00:59.288155246 18103 0x7fac04013ad0 WARN            v4l2videodec gstv4l2videodec.c:1673:gst_v4l2_video_dec_decide_allocation:<nvv4l2decoder0> Duration invalid, not setting latency
0:00:59.288193655 18103 0x7fac04013ad0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1066:gst_v4l2_buffer_pool_start:<nvv4l2decoder0:pool:src> Uncertain or not enough buffers, enabling copy threshold
0:00:59.288773352 18103 0x7fabf833dc50 WARN          v4l2bufferpool gstv4l2bufferpool.c:1513:gst_v4l2_buffer_pool_dqbuf:<nvv4l2decoder0:pool:src> Driver should never set v4l2_buffer.field to ANY

You already link “caps” to “encoder”, why did you link “caps” to “tee” too?

Why did you link “encoder2” to itself?

I think the problem is just you are not familiar with gstreamer knowledge and coding skills.

Please study basic gstreamer knowledge and coding skills by GStreamer: open source multimedia framework. This is deepstream forum. You problem has nothing to do with deepstream.

i had edited , missed here .

caps2.link(encoder2)
#encoder2.link(encoder2)
encoder2.link(splitmuxsink)

What deepstream related issue have you found?

its not related to deepstream issue , its my pipleline issue that has to be fixed .

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.