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