Segfault on Removing the Last Stream From the Pipeline

I have tried our demo runtime_source_add_delete with the diffs below.

-    nvosd.link(sink)
+    #nvosd.link(sink)
+    nvosd.link(video_converter)
+    video_converter.link(filter)
+    filter.link(sink)

It works properly. Could you refer to that and compare your code?

Also if you want to save jpeg image, you can try to use our API by referring to the FAQ. It will be more efficient.