# Webrtc issues with jetson-utils

**URL:** <https://forums.developer.nvidia.com/t/webrtc-issues-with-jetson-utils/283864>\
**Category:** Jetson AGX Orin\
**Tags:** kernel\
**Created:** [February 23, 2024, 4:58pm UTC](https://forums.developer.nvidia.com/t/webrtc-issues-with-jetson-utils/283864 "2024-02-23T16:58:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brbl](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@brbl](https://forums.developer.nvidia.com/u/brbl)\
**Post date:** [February 23, 2024, 4:58pm UTC](https://forums.developer.nvidia.com/t/webrtc-issues-with-jetson-utils/283864/1 "2024-02-23T16:58:46Z")

</div>

I apologize in advance for what may be a silly mistake on my part.

I am running a jetson-utils container built using the jetson-containers framework, and using ./run.sh, all on an ORIN AGX jetpack 6

I am experimenting with the jetson-utils image streaming:

In terminal 1: video-viewer v4l2:///dev/video0 webrtc://@:8554:my\_output  
In terminal 2: video-viewer webrtc://@8554:my\_output

So, basically experimenting with a simple pipeline. However, when I do this, the receiver (in terminal 2) I get [gstreamer] gstDecoder::Capture() – a timeout…

There a SOUP server warning that (could not listen on address 0.0.0.0, port = 8554: Error binding to address 0.0.0.0:8554: Address already in use), but then it does seem to create the gstDecoder.

When I try to access the source webrtc server from the browser, I get an empty video viewer, and an eventual crash (sinkpad should not be nullptr)

Any help would be greatly appreciated. Jetson-containers is awesome by the way.

---

<div class="post-metadata">

**Author:** ![brbl](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@brbl](https://forums.developer.nvidia.com/u/brbl)\
**Post date:** [February 23, 2024, 5:23pm UTC](https://forums.developer.nvidia.com/t/webrtc-issues-with-jetson-utils/283864/2 "2024-02-23T17:23:30Z")

</div>

rtp works as expected.

---

<div class="post-metadata">

**Author:** ![dusty\_nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dusty_nv/32/14043_2.png) [@dusty\_nv](https://forums.developer.nvidia.com/u/dusty_nv)\
**Post date:** [February 23, 2024, 5:27pm UTC](https://forums.developer.nvidia.com/t/webrtc-issues-with-jetson-utils/283864/3 "2024-02-23T17:27:50Z")

</div>

Hi @brbl, thanks, all the networking and connection negotiation with WebRTC can be tricky to debug sometimes (and admittedly the GStreamer plugins for it aren’t super rock solid) - so first, can you try to just get the browser viewer working, before trying the loopback? (and I actually haven’t tested WebRTC loopback before on the same device, which is maybe why you run into that port conflict, and I don’t really see a real circumstance for WebRTC loopback on the same device anyways)

In chrome on your client machine, try disabling `chrome://flags/#enable-webrtc-hide-local-ips-with-mdns`

See the mDNS resolution issue referred to in this post about that:

> <https://github.com/dusty-nv/jetson-containers/issues/387#issuecomment-1960104216>
>
> Head at commit ID- 2d6187b00eaad34a4a51bf1e088baf4a600faa09
> 
> Hey Dusty, I am f…ollowing your \[tutorial\](https://www.jetson-ai-lab.com/tutorial\_live-llava.html) on my new AGX ORIN Dev kit but when I try to run the run.sh file, it fails at the end. I will need your help to solve this, please.
> 
> Sharing the terminal output below -   
> 
> \`\`\`
> ./run.sh -e SSL\_KEY=/data/key.pem -e SSL\_CERT=/data/cert.pem $(./autotag local\_llm) python3 -m local\_llm.agents.video\_query --api=mlc --verbose --model liuhaotian/llava-v1.5-7b --max-new-tokens 32 --video-input /dev/video0 --video-output Display://0 --prompt "How many fingers am I holding up?"
> Namespace(disable=\[''\], output='/tmp/autotag', packages=\['local\_llm'\], prefer=\['local', 'registry', 'build'\], quiet=False, user='dustynv', verbose=False)
> \-- L4T\_VERSION=35.2.1 JETPACK\_VERSION=5.1 CUDA\_VERSION=11.4.315
> \-- Finding compatible container image for \['local\_llm'\]
> dustynv/local\_llm:r35.3.1
> localuser:root being added to access control list
> + docker run --runtime nvidia -it --rm --network host --volume /tmp/argus\_socket:/tmp/argus\_socket --volume /etc/enctune.conf:/etc/enctune.conf --volume /etc/nv\_tegra\_release:/etc/nv\_tegra\_release --volume /tmp/nv\_jetson\_model:/tmp/nv\_jetson\_model --volume /home/rajesh/Desktop/jetson-containers/data:/data --device /dev/snd --device /dev/bus/usb -e DISPLAY=:1 -v /tmp/.X11-unix/:/tmp/.X11-unix -v /tmp/.docker.xauth:/tmp/.docker.xauth -e XAUTHORITY=/tmp/.docker.xauth --device /dev/video0 --device /dev/video1 -e SSL\_KEY=/data/key.pem -e SSL\_CERT=/data/cert.pem dustynv/local\_llm:r35.3.1 python3 -m local\_llm.agents.video\_query --api=mlc --verbose --model liuhaotian/llava-v1.5-7b --max-new-tokens 32 --video-input /dev/video0 --video-output Display://0 --prompt 'How many fingers am I holding up?'
> /usr/local/lib/python3.8/dist-packages/transformers/utils/hub.py:124: FutureWarning: Using \`TRANSFORMERS\_CACHE\` is deprecated and will be removed in v5 of Transformers. Use \`HF\_HOME\` instead.
> warnings.warn(
> 16:32:47 | DEBUG | Namespace(api='mlc', chat\_template=None, debug=True, do\_sample=False, log\_level='debug', max\_new\_tokens=32, min\_new\_tokens=-1, model='liuhaotian/llava-v1.5-7b', prompt=\['How many fingers am I holding up?'\], quant=None, repetition\_penalty=1.0, save\_mermaid=None, system\_prompt=None, temperature=0.7, top\_p=0.95, video\_input='/dev/video0', video\_input\_codec=None, video\_input\_framerate=None, video\_input\_height=None, video\_input\_save=None, video\_input\_width=None, video\_output='Display://0', video\_output\_bitrate=None, video\_output\_codec=None, video\_output\_save=None, vision\_model=None)
> 16:32:47 | DEBUG | subprocess 34 started
> 16:32:47 | DEBUG | Starting new HTTPS connection (1): huggingface.co:443
> 16:32:48 | DEBUG | https://huggingface.co:443 "GET /api/models/liuhaotian/llava-v1.5-7b/revision/main HTTP/1.1" 200 2444
> Fetching 11 files: 100%|█████████████████████| 11/11 \[00:00\<00:00, 59686.09it/s\]
> 16:32:48 | INFO | loading /data/models/huggingface/models--liuhaotian--llava-v1.5-7b/snapshots/12e054b30e8e061f423c7264bc97d4248232e965 with MLC
> Process Process-1:
> Traceback (most recent call last):
> File "/usr/lib/python3.8/runpy.py", line 194, in \_run\_module\_as\_main
> return \_run\_code(code, main\_globals, None,
> File "/usr/lib/python3.8/runpy.py", line 87, in \_run\_code
> exec(code, run\_globals)
> File "/opt/local\_llm/local\_llm/agents/video\_query.py", line 115, in \<module\>
> agent = VideoQuery(\*\*vars(args)).run() 
> File "/opt/local\_llm/local\_llm/agents/video\_query.py", line 22, in \_\_init\_\_
> self.llm = ProcessProxy((lambda \*\*kwargs: ChatQuery(model, drop\_inputs=True, \*\*kwargs)), \*\*kwargs)
> File "/opt/local\_llm/local\_llm/plugins/process\_proxy.py", line 31, in \_\_init\_\_
> raise RuntimeError(f"subprocess has an invalid initialization status ({init\_msg\['status'\]})")
> RuntimeError: subprocess has an invalid initialization status (\<class 'AssertionError'\>)
> Traceback (most recent call last):
> File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in \_bootstrap
> self.run()
> File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
> self.\_target(\*self.\_args, \*\*self.\_kwargs)
> File "/opt/local\_llm/local\_llm/plugins/process\_proxy.py", line 62, in run\_process
> raise error
> File "/opt/local\_llm/local\_llm/plugins/process\_proxy.py", line 59, in run\_process
> plugin = factory(\*\*kwargs)
> File "/opt/local\_llm/local\_llm/agents/video\_query.py", line 22, in \<lambda\>
> self.llm = ProcessProxy((lambda \*\*kwargs: ChatQuery(model, drop\_inputs=True, \*\*kwargs)), \*\*kwargs)
> File "/opt/local\_llm/local\_llm/plugins/chat\_query.py", line 63, in \_\_init\_\_
> self.model = LocalLM.from\_pretrained(model, \*\*kwargs)
> File "/opt/local\_llm/local\_llm/local\_llm.py", line 72, in from\_pretrained
> model = MLCModel(model\_path, \*\*kwargs)
> File "/opt/local\_llm/local\_llm/models/mlc.py", line 58, in \_\_init\_\_
> assert(self.device.exist) # this is needed to initialize CUDA?
> AssertionError
> \`\`\`

---

<div class="post-metadata">

**Author:** ![brbl](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@brbl](https://forums.developer.nvidia.com/u/brbl)\
**Post date:** [February 23, 2024, 5:59pm UTC](https://forums.developer.nvidia.com/t/webrtc-issues-with-jetson-utils/283864/5 "2024-02-23T17:59:36Z")

</div>

Well I guess I am not alone. Sorry, I should have checked github issues. For what it is worth, the disable trick did not work for me. BTW, I think I ran into similar issues with rtsp.

Stepping back, I was thinking that using the jetson-utils framework to pass images between containers was better suited for our needs, and more lightweight than deepstream while being more performant than a software only solution (i.e., grpc). Am I thinking about this correctly?

As always, thanks for the quick response! It is greatly appreciated, so thanks!!!

---

<div class="post-metadata">

**Author:** ![dusty\_nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dusty_nv/32/14043_2.png) [@dusty\_nv](https://forums.developer.nvidia.com/u/dusty_nv)\
**Post date:** [February 23, 2024, 6:07pm UTC](https://forums.developer.nvidia.com/t/webrtc-issues-with-jetson-utils/283864/6 "2024-02-23T18:07:40Z")

</div>

OK gotcha - I probably would use some kind of cross-process shared memory pipe or queue to transfer images between container instances. The encoding and IP transport of RTSP/WebRTC has a higher overhead than would be necessary for that (not to mention the reliability)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [March 27, 2024, 2:26am UTC](https://forums.developer.nvidia.com/t/webrtc-issues-with-jetson-utils/283864/9 "2024-03-27T02:26:26Z")

</div>

Closed on March 27, 2024, 2:26am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
