livekit-cli icon indicating copy to clipboard operation
livekit-cli copied to clipboard

lk cli: Try to restart publishing if track unpublished

Open haffi-mazhar-oxa opened this issue 5 months ago • 1 comments

When using lk cli to publish a stream from a socket, it could try to republish the track for X seconds/minutes if the stream stops and starts again. Currently, it just logs out "unpublished track" when the tcp stream stops.

Steps I used:

  1. Start a gstreamer pipeline to tcp port
  2. Publish to livekit from port
  3. Confirm video is coming through
  4. Stop the gstreamer pipeline
  5. See "unpublished track" event log in the lk cli logs
  6. Restart gstreamer pipeline

i.e

GStreamer:

gst-launch-1.0 videotestsrc pattern=ball ! clockoverlay font-desc="Sans, 36" ! video/x-raw,format=I420,width=640,height=480,framerate=30/1 ! x264enc key-int-max=10 ! h264parse config-interval=1 ! video/x-h264,stream-format=byte-stream ! tcpserversink host=127.0.0.1 port=5004

Lk:

lk room join --api-key={key} --api-secret={secret} --url={lk_url} --identity=video-test --room test-room --publish h264://127.0.0.1:5004

haffi-mazhar-oxa avatar Aug 28 '25 08:08 haffi-mazhar-oxa