# Stream Runcam Webcam using RTSP

**URL:** <https://forums.developer.nvidia.com/t/stream-runcam-webcam-using-rtsp/174166>\
**Category:** Jetson Nano\
**Tags:** rtsp\
**Created:** [April 4, 2021, 12:06am UTC](https://forums.developer.nvidia.com/t/stream-runcam-webcam-using-rtsp/174166 "2021-04-04T00:06:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CVicente](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@CVicente](https://forums.developer.nvidia.com/u/CVicente)\
**Post date:** [April 4, 2021, 12:06am UTC](https://forums.developer.nvidia.com/t/stream-runcam-webcam-using-rtsp/174166/1 "2021-04-04T00:06:13Z")

</div>

Hi all,

I have a runcam Webcam connected through USB to the Jetson nano and I’ve been trying to stream it’s image through RTSP to view it, for instance, on a windows machine using VLC.

I’ve gone through the [FAQ](https://forums.developer.nvidia.com/t/jetson-nano-faq/82953#5390621) and also followed several tickets in the forum concerning streaming video from a USB camera through RTSP ([This one](https://forums.developer.nvidia.com/t/stream-4k-webcam-gstreamer/108025) was quite useful)

Here is what I get when I run:

`v4l2-ctl -d /dev/video1 --list-formats-ext`

```
ioctl: VIDIOC_ENUM_FMT
        Index : 0
        Type : Video Capture
        Pixel Format: 'MJPG' (compressed)
        Name : Motion-JPEG
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 320x240
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 800x600
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 960x720
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 1024x576
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)

        Index : 1
        Type : Video Capture
        Pixel Format: 'H264' (compressed)
        Name : H.264
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 320x240
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 800x600
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 960x720
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 1024x576
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)

        Index : 2
        Type : Video Capture
        Pixel Format: 'YUYV'
        Name : YUYV 4:2:2
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 320x180
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 320x240
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 352x288
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 432x240
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 800x448
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 800x600
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 864x480
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 960x720
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 1024x576
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)

```

In the jetson nano itself I was able to see the camera output by running:

`gst-launch-1.0 v4l2src device=/dev/video1 io-mode=2 ! image/jpeg,width=1280,height=720,framerate=30/1 ! nvjpegdec ! video/x-raw ! xvimagesink`

But when I run:  
`./test-launch "v4l2src device=/dev/video1 io-mode=2 ! image/jpeg,width=1280,height=720,framerate=30/1 ! nvjpegdec ! video/x-raw ! omxh265enc ! rtph265pay name=pay0 pt=96"`

And try to read it from VLC on windows it fails to open:  
main debug: using renderer\_discovery module “microdns”

```
main debug: processing request item: rtsp://192.168.178.46:8554/test, node: Playlist, skip: 0

main debug: rebuilding array of current - root Playlist

main debug: rebuild done - 4 items, index 3

main debug: starting playback of new item

main debug: resyncing on rtsp://192.168.178.46:8554/test

main debug: rtsp://192.168.178.46:8554/test is at 3

main debug: creating new input thread

main debug: Creating an input for 'rtsp://192.168.178.46:8554/test'

main debug: requesting art for new input thread

main debug: using timeshift granularity of 50 MiB

main debug: using timeshift path: C:\Users\vicen\AppData\Local\Temp

main debug: `rtsp://192.168.178.46:8554/test' gives access `rtsp' demux `any' path `192.168.178.46:8554/test'

main debug: creating demux: access='rtsp' demux='any' location='192.168.178.46:8554/test' file='\\192.168.178.46:8554\test'

main debug: looking for access_demux module matching "rtsp": 15 candidates

live555 debug: version 2016.11.28

main debug: looking for meta fetcher module matching "any": 1 candidates

lua debug: Trying Lua scripts in C:\Users\vicen\AppData\Roaming\vlc\lua\meta\fetcher

lua debug: Trying Lua scripts in D:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher

main debug: no meta fetcher modules matched

main debug: looking for art finder module matching "any": 2 candidates

lua debug: Trying Lua scripts in C:\Users\vicen\AppData\Roaming\vlc\lua\meta\art

lua debug: Trying Lua scripts in D:\Program Files (x86)\VideoLAN\VLC\lua\meta\art

lua debug: Trying Lua playlist script D:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac

lua debug: skipping script (unmatched scope) D:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac

lua debug: Trying Lua playlist script D:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac

lua debug: skipping script (unmatched scope) D:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac

lua debug: Trying Lua playlist script D:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac

lua debug: skipping script (unmatched scope) D:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac

lua debug: Trying Lua playlist script D:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac

lua debug: skipping script (unmatched scope) D:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac

main debug: no art finder modules matched

main debug: looking for meta fetcher module matching "any": 1 candidates

lua debug: Trying Lua scripts in C:\Users\vicen\AppData\Roaming\vlc\lua\meta\fetcher

lua debug: Trying Lua scripts in D:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher

main debug: no meta fetcher modules matched

main debug: looking for art finder module matching "any": 2 candidates

lua debug: Trying Lua scripts in C:\Users\vicen\AppData\Roaming\vlc\lua\meta\art

lua debug: Trying Lua scripts in D:\Program Files (x86)\VideoLAN\VLC\lua\meta\art

lua debug: Trying Lua playlist script D:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac

lua debug: Trying Lua playlist script D:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac

lua debug: Trying Lua playlist script D:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac

lua debug: Trying Lua playlist script D:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac

main debug: no art finder modules matched

qt debug: IM: Setting an input

live555 debug: we will now try HTTP tunneling mode

live555 debug: connection error -10057

live555 error: Failed to connect with rtsp://192.168.178.46:8554/test

main debug: no access_demux modules matched

main debug: creating access: rtsp://192.168.178.46:8554/test

main debug: (path: \\192.168.178.46:8554\test)

main debug: looking for access module matching "rtsp": 27 candidates

satip debug: try to open 'rtsp://192.168.178.46:8554/test'

satip debug: connect to host '192.168.178.46'

main debug: net: connecting to 192.168.178.46 port 8554

main debug: connection succeeded (socket = 2344)

main debug: net: opening 0.0.0.0 datagram port 9416

main debug: net: opening 0.0.0.0 datagram port 9417

satip error: Failed to setup RTSP session

main debug: net: connecting to 192.168.178.46 port 8554

main debug: connection succeeded (socket = 2344)

access_realrtsp warning: Cseq mismatch, got 1, assumed 0

access_realrtsp debug: rtsp connected

access_realrtsp warning: only real/helix rtsp servers supported for now

main debug: no access modules matched

main debug: dead input

qt debug: IM: Deleting the input

main debug: changing item without a request (current 3/4)

main debug: nothing to play

main debug: removing module "microdns"

```

If I try to use the command:  
`gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! nvoverlaysink`

directly from JetsonNano I only get the following output:

![RTSP output](https://global.discourse-cdn.com/nvidia/original/3X/9/a/9a3cdd240254383021dadfc2d66031c5d21ea387.png)

Any idea what I could be missing?

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [April 6, 2021, 6:04am UTC](https://forums.developer.nvidia.com/t/stream-runcam-webcam-using-rtsp/174166/3 "2021-04-06T06:04:32Z")

</div>

Hi,  
We have deprecated omx plugins. Please try

```auto
./test-launch "v4l2src device=/dev/video1 io-mode=2 ! image/jpeg,width=1280,height=720,framerate=30/1 ! nvjpegdec ! video/x-raw ! nvvidconv ! nvv4l2h265enc ! rtph265pay name=pay0 pt=96"

```

Or try _nvv4l2decoder_ for MJPEG decoding:

```auto
./test-launch "v4l2src device=/dev/video1 io-mode=2 ! image/jpeg,width=1280,height=720,framerate=30/1 ! jpegparse ! nvv4l2decoder mjpeg=1 ! nvv4l2h265enc ! rtph265pay name=pay0 pt=96"

```

---

<div class="post-metadata">

**Author:** ![CVicente](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@CVicente](https://forums.developer.nvidia.com/u/CVicente)\
**Post date:** [April 6, 2021, 10:16am UTC](https://forums.developer.nvidia.com/t/stream-runcam-webcam-using-rtsp/174166/4 "2021-04-06T10:16:46Z")

</div>

Both work! Fantastic!! I guess this one is solved, thank a lot!

But since “I have you here”, I’ll take advantage to ask a couple of more related questions:

- I have about 1.5 seconds of delay. Do you know if it can be improved somehow? Reducing stream definition doesn’t seem to have any effect (or very little).

- This camera also has a microphone. Could sound also be streamed through the test-launch app? Is it just a matter of the configuration string being passed as a parameter?

- I’ve been struggling to find some documentation on how to understand and tweak the “configuration string” passed as a parameter to both test-launch or gst-launch. Could you please point me to it?

Cheers,  
Carlos

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [April 7, 2021, 7:22am UTC](https://forums.developer.nvidia.com/t/stream-runcam-webcam-using-rtsp/174166/5 "2021-04-07T07:22:37Z")

</div>

Hi  
The delay may be from network or source. You may run the command to check glass-to-glass latency first:

```auto
gst-launch-1.0 v4l2src device=/dev/video1 io-mode=2 ! image/jpeg,width=1280,height=720,framerate=30/1 ! jpegparse ! nvv4l2decoder mjpeg=1 ! nvoverlaysink

```

For launching audio source, please refer to  
[Live streaming cam usb - #4 by DaneLLL](https://forums.developer.nvidia.com/t/live-streaming-cam-usb/123166/4)

_test-launch_ is a sample in native gstreamer package. For further question about it, please go to [gstreamer forum](http://gstreamer-devel.966125.n4.nabble.com/)

---

<div class="post-metadata">

**Author:** ![CVicente](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@CVicente](https://forums.developer.nvidia.com/u/CVicente)\
**Post date:** [April 7, 2021, 10:43am UTC](https://forums.developer.nvidia.com/t/stream-runcam-webcam-using-rtsp/174166/6 "2021-04-07T10:43:19Z")

</div>

> [@DaneLLL](#):
>
> Hi  
> The delay may be from network or source. You may run the command to check glass-to-glass latency first:
> 
> ```auto
> gst-launch-1.0 v4l2src device=/dev/video1 io-mode=2 ! image/jpeg,width=1280,height=720,framerate=30/1 ! jpegparse ! nvv4l2decoder mjpeg=1 ! nvoverlaysink
> 
> ```

Actually if I use this command I do get an extremely laggy image accompanied by by the following errors:

> WARNING: from element /GstPipeline:pipeline0/GstNvOverlaySink-nvoverlaysink:nvoverlaysink-nvoverlaysink0: A lot of buffers are being dropped.  
> Additional debug info:  
> gstbasesink.c(2902): gst\_base\_sink\_is\_too\_late (): /GstPipeline:pipeline0/GstNvOverlaySink-nvoverlaysink:nvoverlaysink-nvoverlaysink0:  
> There may be a timestamping problem, or this computer is too slow.  
> WARNING: from element /GstPipeline:pipeline0/GstNvOverlaySink-nvoverlaysink:nvoverlaysink-nvoverlaysink0: A lot of buffers are being dropped.

On the other hand if a run:

> gst-launch-1.0 v4l2src device=/dev/video1 io-mode=2 ! image/jpeg,width=1280,height=720,framerate=30/1 ! nvjpegdec ! video/x-raw ! xvimagesink

It runs smoothly with negligible delay.

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 15, 2021, 3:59am UTC](https://forums.developer.nvidia.com/t/stream-runcam-webcam-using-rtsp/174166/8 "2021-10-15T03:59:34Z")

</div>


