# Video lagging with publishing stream with RESTapi

**URL:** <https://janus.discourse.group/t/video-lagging-with-publishing-stream-with-restapi/406>\
**Category:** General\
**Created:** [July 6, 2023, 10:31am UTC](https://janus.discourse.group/t/video-lagging-with-publishing-stream-with-restapi/406 "2023-07-06T10:31:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jessedewild](https://avatars.discourse-cdn.com/v4/letter/j/4491bb/32.png) [@jessedewild](https://janus.discourse.group/u/jessedewild)\
**Post date:** [July 6, 2023, 10:31am UTC](https://janus.discourse.group/t/video-lagging-with-publishing-stream-with-restapi/406/1 "2023-07-06T10:31:12Z")

</div>

Hello there,

For our JavaScript application, we are currently publishing the streams by sending a GET request like this (without the API):

[https://192.168.178.186:8080/janus?gateway\_url=https://janus.conf.meetecho.com&gateway\_root=/janus&room=1234&room\_pin=&username=&token=&publish=1&subscribe=0&hw\_vcodec=0&vformat=60&reconnect=1&proxy\_host=&proxy\_port=80&proxy\_password=&proxy\_bypass=&action=Start](https://192.168.178.186:8080/janus?gateway_url=https://janus.conf.meetecho.com&gateway_root=/janus&room=1234&room_pin=&username=&token=&publish=1&subscribe=0&hw_vcodec=0&vformat=60&reconnect=1&proxy_host=&proxy_port=80&proxy_password=&proxy_bypass=&action=Start)

This works perfectly, and the published streams to that room are very smooth and not laggy at all.

Now, we want to use the RESTapi for publishing the streams, and creating the room.  
These are the steps I am currently using the RESTapi:

1. Create a client
2. Create a room
3. Join a room
4. Publish the media

Are these the correct steps for publishing the media? Right now, when we receive the remote streams, they are very laggy and the UV4L sever becomes very slow.

---

<div class="post-metadata">

**Author:** ![lorenzo](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/lorenzo/32/425_2.png) [@lorenzo](https://janus.discourse.group/u/lorenzo)\
**Post date:** [July 6, 2023, 1:10pm UTC](https://janus.discourse.group/t/video-lagging-with-publishing-stream-with-restapi/406/2 "2023-07-06T13:10:34Z")

</div>

Please ask UV4L questions on UV4L lists, not here. That’s not the Janus API, so it’s out of scope here.
