[DS 4.0.1] How to create and add a rtsp sink in deepstream_test4_app.c ? [jetson nano]

I tried to stream the deepstream_test4_app output over RTSP but my app is unable to do so .
I tried adding a rtspsink from :

rtsp = gst_element_factory_make ("rtspsink", "rtspsink");

My complete edited sample of deepstream_test4_app.c is up here :
https://pastebin.com/nh7gYQq7

but I am unable to add it to the pipeline in deepstream_test4_app .

I actually want to stream the detentions (using DS 4.0) from JetsonNano over web .

Please help me out with the issue …

Thanks in Advance

I am having a similar problem , I would also need to see a working example on how to use a rtsp sink in code with deepstream test app 1/2/3/4 . It would be really helpful if someone can share a working example of adding a rtsp sink in the app pipeline.

Yes It is unclear how to stream jetsonNano’s test app’s output over RTSP using a RTSP sink . A Working example would clear how to integrate a rtsp sink in the pipeline …

Yes I’m also having the same problem. Working example in C language sought.

Moving to DeepStream SDK forum for resolution.

Hi,
We would suggest you refer to source code of deepstream-app:

deepstream_sdk_v4.0.1_jetson\sources\apps\apps-common\src\deepstream_sink_bin.c

All samples are open source and we encourage users to do customization. Actually deepstream-app should cover most general cases. It may be easier to modify config files and run deepstream-app instead of customizing deepstream test apps.

For deepstream-test4 + RTSP sink, we suggest refer to deepstream-test5.