RidgeRun / gst-interpipe

GStreamer plug-in for interpipeline communication
Other
143 stars 64 forks source link

loopback issue using gstreamermm to open interpipe pipeline #86

Open zhenglh33 opened 3 years ago

zhenglh33 commented 3 years ago

Hi,

I'm using interpipe to develop program, and also used gstreamermm, which is c++ wrapper of gstreamer, to open pipeline.

So I have (1)camera source, (2) inference pipeline, (3) display pipeline, (4) encode pipeline and (5) record pipeline. So the structure is cam_src => inference => display and cam_src => encode => record.

The issue is the display will show the previous frame, like half second before, and then display current frame. So it's like frame 0 -> frame 1 -> frame 0 -> frame 2 -> frame3 -> frame 1....

This only happened to display pipeline, recorded video is fine. The function I used to open pipeline is Gst::Parse::launch from gstreamermm, which I think is from gst_parse_launch

I'm using interpipe 1.1.4 and gstd 0.12.0( which I only turn on when the program starts, and kill when closing the program ), and this only happened using interpipe 1.1.3 and gstd 0.11.2

Can anyone help?

zhenglh33 commented 3 years ago

I solved this by remove the is-live=true and stream-sync=restart-ts of interpipesrc in inference pipeline and display pipeline, the loop back issue is gone. And seems like the recorded video is fine

But there is another issue I can not solve by now

gst-launch-1.0 -ev filesrc location=/home/nvidia/Downloads/cam4.mkv ! matroskademux ! h264parse ! nvv4l2decoder ! nvvideoconvert ! queue ! m.sink_0 \ filesrc location=/home/nvidia/Downloads/cam4.mkv ! matroskademux ! h264parse ! nvv4l2decoder ! nvvideoconvert ! queue ! m.sink_1 \ nvstreammux name=m batch-size=2 width=1920 height=1080 batched-push-timeout=4000000 ! nvvideoconvert ! queue ! interpipesink name=src_h264 forward-events=true forward-eos=true sync=false caps='video/x-raw(memory:NVMM),format=RGBA,width=1280,height=720,pixel-aspect-ratio=1/1,interlace-mode=progressive,framerate=30/1' \

interpipesrc listen-to=src_h264 format=time allow-renegotiation=true ! queue ! nvvideoconvert ! nvinfer config-file-path=/home/nvidia/config_infer_primary.txt interval=5 batch-size=2 ! queue ! nvmultistreamtiler width=1920 height=1080 rows=1 columns=2 ! nvtracker tracker-width=608 tracker-height=608 ll-lib-file=/opt/nvidia/deepstream/deepstream-5.0/lib/libnvds_mot_klt.so enable-batch-process=true ! nvvideoconvert ! nvdsosd ! queue ! interpipesink name=sr_h264 forward-events=true forward-eos=true sync=false caps='video/x-raw(memory:NVMM),format=RGBA,width=1280,height=720,pixel-aspect-ratio=1/1,interlace-mode=progressive,framerate=30/1' \

interpipesrc listen-to=sr_h264 format=time allow-renegotiation=true ! queue ! nvvideoconvert ! 'video/x-raw,format=(string)I420' ! xvimagesink sync=false async=false

in this command, it can stream normally, but with nvtracker is put behind nvmultistreamtiler, or the pipeline can not work. It can only work using gstd-client to open these three pipelines. What's the difference between gst-launch-1.0 and gstd-client?