# Tutorial: A working example for rtsp output in c

**URL:** <https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336>\
**Category:** DeepStream SDK\
**Tags:** demos-and-tutorials\
**Created:** [June 21, 2023, 4:03am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336 "2023-06-21T04:03:43Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![JenHao](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@JenHao](https://forums.developer.nvidia.com/u/JenHao)\
**Post date:** [June 21, 2023, 4:03am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/1 "2023-06-21T04:03:43Z")

</div>

**• DeepStream Version 6.x**  
This sample is modified from deepstream-test3. User can use VLC to watch this rtsp stream remotely. User should install gstreamer rtsp server first.

```auto
sudo apt-get install libgstrtspserver-1.0 libgstreamer1.0-dev

```

First you can check you environment is ready for rtsp streaming. Copy the rtsp server example [here](https://github.com/GStreamer/gst-rtsp-server/blob/1.14.5/examples/test-launch.c) and compile this file.

```auto
gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)

```

Then start the test rtsp server. Note this command did not use `nvvidconv` and `nvv4l2h264enc` element like the reference post because it will cause a broken pipeline _ **without any error** _ in dGPU environment.

```auto
./test-launch "videotestsrc is-live=1 ! videoconvert ! x264enc ! h264parse ! rtph264pay name=pay0 pt=96"

```

Then you can start a client using VLC connect to `rtsp://<host ip>:8554/test`. If it fail to connect, start a client in the same computer in another termal by

```auto
gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! fakesink

```

If success, the program will keep running without error.

After check the environment is OK, you can build the modified deepstream-test3 code in attachment. After compile the code, change the `source-list:` in `dstest3_config.yml`. Run the app with command

```auto
./deepstream-test3-app dstest3_config.yml

```

and use VLC connect to `rtsp://<host ip>:8554/ds-test` then you can see the stream.

This example code copy functions `start_rtsp_streaming`, `client_filter`, `destroy_sink_bin` from `/opt/nvidia/deepstream/deepstream/sources/apps/apps-common/src/deepstream_sink_bin.c`  
The main idea is deepstream pipeline stream go to udp sink on 5400 port, and then we start a rtsp server using `start_rtsp_streaming`. This rtsp server receive the udp as source and turn it into rtsp stream.

Reference:

> [@Jetson Nano FAQ](https://forums.developer.nvidia.com/t/jetson-nano-faq/82953):
>
> Q: What power supply should I use with Jetson Nano Developer Kit? Please refer to these pages on the wiki and forums: [https://elinux.org/Jetson\_Nano#Power\_Supplies](https://elinux.org/Jetson_Nano#Power_Supplies)[Power supply considerations for Jetson Nano Developer Kit](https://forums.developer.nvidia.com/t/power-supply-considerations-for-jetson-nano-developer-kit/71637)Q: My Jetson Nano is with sd card slot. Can I use it to verify secureboot? No. Secureboot is only supported on production module(Jetson Nano with emmc). Q: I have an issue that I need help with - what steps should I take when posting a new topic? Please see this thread - [D…](https://forums.developer.nvidia.com/t/debug-tips-when-you-hit-any-issue-fail-to-boot-keep-reboot-etc/177457)

[https://blog.csdn.net/ioir123juuki/article/details/117324430](https://blog.csdn.net/ioir123juuki/article/details/117324430)

[https://ppt.cc/fKC1dx](https://ppt.cc/fKC1dx)

[deepstream-test3-rtsp.zip](https://forums.developer.nvidia.com/uploads/short-url/aDvwNFBkhKXi8l1WXs1eQvd5FAM.zip) (14.8 KB)

---

<div class="post-metadata">

**Author:** ![yingliu](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/yingliu/32/136703_2.png) [@yingliu](https://forums.developer.nvidia.com/u/yingliu)\
**Post date:** [June 21, 2023, 5:31am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/2 "2023-06-21T05:31:28Z")

</div>

Thanks for sharing!

---

<div class="post-metadata">

**Author:** ![barzanhayati](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@barzanhayati](https://forums.developer.nvidia.com/u/barzanhayati)\
**Post date:** [August 19, 2023, 5:49am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/3 "2023-08-19T05:49:09Z")

</div>

Thanks for sharing, but it does not work on deepstream 6.1.1

---

<div class="post-metadata">

**Author:** ![JenHao](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@JenHao](https://forums.developer.nvidia.com/u/JenHao)\
**Post date:** [August 20, 2023, 4:38am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/4 "2023-08-20T04:38:04Z")

</div>

Hi, could you provide the error message?

---

<div class="post-metadata">

**Author:** ![barzanhayati](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@barzanhayati](https://forums.developer.nvidia.com/u/barzanhayati)\
**Post date:** [August 20, 2023, 5:26am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/5 "2023-08-20T05:26:20Z")

</div>

> [@JenHao](#):
>
> Hi, could you provide the error message?

Sure.

After compiling code by  
`gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)`

Then by running  
`./test-launch "videotestsrc is-live=1 ! videoconvert ! x264enc ! h264parse ! rtph264pay name=pay0 pt=96"`

I got these message:  
`stream ready at rtsp://127.0.0.1:8554/test`

Now by running this command in another terminal  
`gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! fakesink`

I got these message:

```auto

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://127.0.0.1:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Unhandled error
Additional debug info:
gstrtspsrc.c(6585): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Service Unavailable (503)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

```

And by opening stream in **VLC** , I got this error:

```auto

Your input can't be opened:

VLC is unable to open the MRL 'rtsp://MY_IP:8554/test'. Check the log for details.

```

---

<div class="post-metadata">

**Author:** ![JenHao](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@JenHao](https://forums.developer.nvidia.com/u/JenHao)\
**Post date:** [August 20, 2023, 6:26am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/6 "2023-08-20T06:26:35Z")

</div>

> [@barzanhayati](#):
>
> ./test-launch “videotestsrc is-live=1 ! videoconvert ! x264enc ! h264parse ! rtph264pay name=pay0 pt=96”

Hi, Could you try to modify the test-launch.c code [line 84](https://github.com/GStreamer/gst-rtsp-server/blob/1ad54eecfdf634ab6eb672c81df1602d004d75b8/examples/test-launch.c#L84) from 127.0.0.1 to 0.0.0.0. I think this is the reason.

---

<div class="post-metadata">

**Author:** ![barzanhayati](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@barzanhayati](https://forums.developer.nvidia.com/u/barzanhayati)\
**Post date:** [August 20, 2023, 6:38am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/7 "2023-08-20T06:38:11Z")

</div>

> [@JenHao](#):
>
> Hi, Could you try to modify the test-launch.c code [line 84](https://github.com/GStreamer/gst-rtsp-server/blob/1ad54eecfdf634ab6eb672c81df1602d004d75b8/examples/test-launch.c#L84) from 127.0.0.1 to 0.0.0.0. I think this is the reason.

But this line is just a print not anything more.

`g_print ("stream ready at rtsp://127.0.0.1:%s/test\n", port);`

---

<div class="post-metadata">

**Author:** ![barzanhayati](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@barzanhayati](https://forums.developer.nvidia.com/u/barzanhayati)\
**Post date:** [August 20, 2023, 6:54am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/8 "2023-08-20T06:54:35Z")

</div>

> [@JenHao](#):
>
> [deepstream-test3-rtsp.zip](https://forums.developer.nvidia.com/uploads/short-url/aDvwNFBkhKXi8l1WXs1eQvd5FAM.zip) (14.8 KB)

And your attached file is corrupted and can not be opened.

---

<div class="post-metadata">

**Author:** ![JenHao](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@JenHao](https://forums.developer.nvidia.com/u/JenHao)\
**Post date:** [August 20, 2023, 8:50am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/9 "2023-08-20T08:50:36Z")

</div>

> [@barzanhayati](#):
>
> > [@JenHao](#):
> >
> > Hi, Could you try to modify the test-launch.c code [line 84](https://github.com/GStreamer/gst-rtsp-server/blob/1ad54eecfdf634ab6eb672c81df1602d004d75b8/examples/test-launch.c#L84) from 127.0.0.1 to 0.0.0.0. I think this is the reason.
> 
> But this line is just a print not anything more.
> 
> `g_print ("stream ready at rtsp://127.0.0.1:%s/test\n", port);`

My bad, I did not look carefully. How about you try the command in your

**remote server**? Could gstreamer get stream in the same computer?

```bash
gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! fakesink

```

---

<div class="post-metadata">

**Author:** ![JenHao](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@JenHao](https://forums.developer.nvidia.com/u/JenHao)\
**Post date:** [August 20, 2023, 8:53am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/11 "2023-08-20T08:53:22Z")

</div>

> [@barzanhayati](#):
>
> > [@JenHao](#):
> >
> > [deepstream-test3-rtsp.zip](https://forums.developer.nvidia.com/uploads/short-url/aDvwNFBkhKXi8l1WXs1eQvd5FAM.zip) (14.8 KB)
> 
> And your attached file is corrupted and can not be opened.

Please try [7-zip](https://www.7-zip.org/) to unzip this file

---

<div class="post-metadata">

**Author:** ![barzanhayati](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@barzanhayati](https://forums.developer.nvidia.com/u/barzanhayati)\
**Post date:** [August 20, 2023, 9:50am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/12 "2023-08-20T09:50:45Z")

</div>

> [@JenHao](#):
>
> My bad, I did not look carefully. How about you try the command in your
> 
> **remote server**? Could gstreamer get stream in the same computer?
> 
> ```auto
> gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! fakesink
> 
> ```

```auto
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://127.0.0.1:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Unhandled error
Additional debug info:
gstrtspsrc.c(6585): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Service Unavailable (503)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
nvs@mehrabad-airport:

```

---

<div class="post-metadata">

**Author:** ![barzanhayati](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@barzanhayati](https://forums.developer.nvidia.com/u/barzanhayati)\
**Post date:** [August 20, 2023, 10:09am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/13 "2023-08-20T10:09:28Z")

</div>

> [@JenHao](#):
>
> `./deepstream-test3-app dstest3_config.yml`

After building your project and by running it I got these :

```auto
Now playing : rtsp://MY_IP/live.sdp

(deepstream-test6-app:29765): GLib-GObject-CRITICAL **: 13:37:16.801: g_object_set: assertion 'G_IS_OBJECT (object)' failed

(deepstream-test6-app:29765): GLib-GObject-CRITICAL **: 13:37:16.801: g_object_set: assertion 'G_IS_OBJECT (object)' failed

(deepstream-test6-app:29765): GLib-GObject-CRITICAL **: 13:37:16.801: g_object_set: assertion 'G_IS_OBJECT (object)' failed
[ERROR] Passed element is not nveglglessink
Using file: dstest6_config.yml
WARNING: [TRT]: Using an engine plan file across different models of devices is not recommended and is likely to affect performance or even cause errors.
0:00:01.048592937 29765 0x557b0b94ea10 INFO nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1909> [UID = 1]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [Implicit Engine Info]: layers num: 3
0 INPUT kFLOAT input_1 3x368x640       
1 OUTPUT kFLOAT conv2d_bbox 16x23x40        
2 OUTPUT kFLOAT conv2d_cov/Sigmoid 4x23x40         

0:00:01.070749547 29765 0x557b0b94ea10 INFO nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2012> [UID = 1]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine
0:00:01.071685219 29765 0x557b0b94ea10 INFO nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary-nvinference-engine> [UID 1]: Load new model:dstest6_pgie_config.yml sucessfully
Decodebin child added: source

 ***DeepStream: Launched RTSP Streaming at rtsp://localhost:8554/ds-test***

Running...

ERROR from element source: Could not open resource for reading and writing.
Error details: gstrtspsrc.c(7893): gst_rtspsrc_retrieve_sdp (): /GstPipeline:dstest3-pipeline/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin/GstRTSPSrc:source:
Failed to connect. (Generic error)
Returned, stopping playback
Deleting pipeline

```

And it cant be played in VLC.

---

<div class="post-metadata">

**Author:** ![JenHao](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@JenHao](https://forums.developer.nvidia.com/u/JenHao)\
**Post date:** [August 20, 2023, 10:15am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/14 "2023-08-20T10:15:43Z")

</div>

Hi, I see `dstest6_config.yml` in you log, could you provide the content?

> [@barzanhayati](#):
>
> > [@JenHao](#):
> >
> > `./deepstream-test3-app dstest3_config.yml`
> 
> After building your project and by running it I got these :
> 
> ```auto
> Now playing : rtsp://MY_IP/live.sdp
> 
> (deepstream-test6-app:29765): GLib-GObject-CRITICAL **: 13:37:16.801: g_object_set: assertion 'G_IS_OBJECT (object)' failed
> 
> (deepstream-test6-app:29765): GLib-GObject-CRITICAL **: 13:37:16.801: g_object_set: assertion 'G_IS_OBJECT (object)' failed
> 
> (deepstream-test6-app:29765): GLib-GObject-CRITICAL **: 13:37:16.801: g_object_set: assertion 'G_IS_OBJECT (object)' failed
> [ERROR] Passed element is not nveglglessink
> Using file: dstest6_config.yml
> WARNING: [TRT]: Using an engine plan file across different models of devices is not recommended and is likely to affect performance or even cause errors.
> 0:00:01.048592937 29765 0x557b0b94ea10 INFO nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1909> [UID = 1]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine
> INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [Implicit Engine Info]: layers num: 3
> 0 INPUT kFLOAT input_1 3x368x640       
> 1 OUTPUT kFLOAT conv2d_bbox 16x23x40        
> 2 OUTPUT kFLOAT conv2d_cov/Sigmoid 4x23x40         
> 
> 0:00:01.070749547 29765 0x557b0b94ea10 INFO nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2012> [UID = 1]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine
> 0:00:01.071685219 29765 0x557b0b94ea10 INFO nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary-nvinference-engine> [UID 1]: Load new model:dstest6_pgie_config.yml sucessfully
> Decodebin child added: source
> 
> ***DeepStream: Launched RTSP Streaming at rtsp://localhost:8554/ds-test***
> 
> Running...
> 
> ERROR from element source: Could not open resource for reading and writing.
> Error details: gstrtspsrc.c(7893): gst_rtspsrc_retrieve_sdp (): /GstPipeline:dstest3-pipeline/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin/GstRTSPSrc:source:
> Failed to connect. (Generic error)
> Returned, stopping playback
> Deleting pipeline
> 
> ```
> 
> And it cant be played in VLC.

---

<div class="post-metadata">

**Author:** ![barzanhayati](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@barzanhayati](https://forums.developer.nvidia.com/u/barzanhayati)\
**Post date:** [August 20, 2023, 10:29am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/15 "2023-08-20T10:29:06Z")

</div>

> [@JenHao](#):
>
> Hi, I see `dstest6_config.yml` in you log, could you provide the content?

I just renamed dstest3\_config to dstest6\_config. As you know there is a directory in the deepstream sample with name `deepstream-test3`.

---

<div class="post-metadata">

**Author:** ![JenHao](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@JenHao](https://forums.developer.nvidia.com/u/JenHao)\
**Post date:** [August 21, 2023, 3:26am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/16 "2023-08-21T03:26:17Z")

</div>

OK, So we first check if you can open the RTSP stream in the same computer. Are you sure you run the command  
`gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! fakesink`  
and `./test-launch "videotestsrc is-live=1 ! videoconvert ! x264enc ! h264parse ! rtph264pay name=pay0 pt=96"`  
in the same computer (the remote server)?

If you do, it mean you can not watch the stream even in the same computer. Did you have fire wall on this computer?(please check the ufw status, disable the firewall temporarily)

> [@barzanhayati](#):
>
> > [@JenHao](#):
> >
> > My bad, I did not look carefully. How about you try the command in your
> > 
> > **remote server**? Could gstreamer get stream in the same computer?
> > 
> > ```auto
> > gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! fakesink
> > 
> > ```
> 
> ```auto
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Progress: (open) Opening Stream
> Progress: (connect) Connecting to rtsp://127.0.0.1:8554/test
> Progress: (open) Retrieving server options
> Progress: (open) Retrieving media info
> ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Unhandled error
> Additional debug info:
> gstrtspsrc.c(6585): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
> Service Unavailable (503)
> ERROR: pipeline doesn't want to preroll.
> Setting pipeline to NULL ...
> Freeing pipeline ...
> nvs@mehrabad-airport:
> 
> ```

---

<div class="post-metadata">

**Author:** ![barzanhayati](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@barzanhayati](https://forums.developer.nvidia.com/u/barzanhayati)\
**Post date:** [September 30, 2023, 11:29am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/17 "2023-09-30T11:29:50Z")

</div>

> [@JenHao](#):
>
> My bad, I did not look carefully. How about you try the command in your
> 
> **remote server**? Could gstreamer get stream in the same computer?
> 
> ```auto
> gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! fakesink
> 
> ```

I try this one and it does not work.

---

<div class="post-metadata">

**Author:** ![barzanhayati](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@barzanhayati](https://forums.developer.nvidia.com/u/barzanhayati)\
**Post date:** [September 30, 2023, 11:35am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/18 "2023-09-30T11:35:35Z")

</div>

> [@JenHao](#):
>
> OK, So we first check if you can open the RTSP stream in the same computer. Are you sure you run the command  
> `gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! fakesink`  
> and `./test-launch "videotestsrc is-live=1 ! videoconvert ! x264enc ! h264parse ! rtph264pay name=pay0 pt=96"`  
> in the same computer (the remote server)?

I run both commands on the same computer and they don’t work.

> [@JenHao](#):
>
> id you have fire wall on this computer?(please check the ufw status, disable the firewall temporarily)

I check **ufw** and it is inactive.

---

<div class="post-metadata">

**Author:** ![barzanhayati](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@barzanhayati](https://forums.developer.nvidia.com/u/barzanhayati)\
**Post date:** [September 30, 2023, 11:39am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/19 "2023-09-30T11:39:49Z")

</div>

It’s necessary to say that [deepstream-test1-rtsp-out](https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/tree/master/apps/deepstream-test1-rtsp-out) works properly. This example has been written in python.

---

<div class="post-metadata">

**Author:** ![yingliu](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/yingliu/32/136703_2.png) [@yingliu](https://forums.developer.nvidia.com/u/yingliu)\
**Post date:** [April 8, 2024, 5:58am UTC](https://forums.developer.nvidia.com/t/tutorial-a-working-example-for-rtsp-output-in-c/257336/20 "2024-04-08T05:58:05Z")

</div>


