Coder Social home page Coder Social logo

ingress's Introduction

The LiveKit icon, the name of the repository and some sample code in the background.

LiveKit Ingress

WebRTC is proving to be a versatile and scalable transport protocol both for media ingestion and delivery. However, some applications may require integrating with existing workflows or equipment that do not support WebRTC. Universal Ingress provides a way to send media that was generated using such workflows to a LiveKit room.

Capabilities

Universal Ingress is meant to be a versatile service supporting a variety of protocols, both using a push and pull model. Currently, the following protcols are supported:

Supported Output

The Ingress service will automatically transcode the source media to ensure compatibility with WebRTC. It can publish multiple layers with Simulcast. The parameters of the different video layers can be defined at ingress creation time.

Documentation

Push workflow

To push media to the Ingress, the workflow goes like this:

  • create an Ingress with CreateIngress API (to livekit-server)
  • CreateIngress returns a URL that can be used to push media to
  • copy and paste the URL into your streaming workflow
  • start the stream
  • Ingress starts receiving data
  • Ingress joins the LiveKit room and publishes transcoded media

Service Architecture

The Ingress service and the LiveKit server communicate over Redis. Redis is also used as storage for the Ingress session state. The Ingress service must also expose a public IP address for the publishing endpoint streamers will connect to. In a typical cluster setup, this IP address would be assigned to a load balancer that would forward incoming connection to an available Ingress service instance. The targeted Ingress instance will then validate the incoming request with the LiveKit server using Redis as RPC transport.

Config

The Ingress service takes a YAML config file:

# required fields
api_key: livekit server api key. LIVEKIT_API_KEY env can be used instead
api_secret: livekit server api secret. LIVEKIT_API_SECRET env can be used instead
ws_url: livekit server websocket url. LIVEKIT_WS_URL env can be used instead
redis:
  address: must be the same redis address used by your livekit server
  username: redis username
  password: redis password
  db: redis db

# optional fields
health_port: if used, will open an http port for health checks
prometheus_port: port used to collect prometheus metrics. Used for autoscaling
log_level: debug, info, warn, or error (default info)
rtmp_port: port to listen to incoming RTMP connection on (default 1935)
whip_port: port to listen to incoming WHIP calls on (default 8080)
http_relay_port: port used to relay data from the main service process to the per ingress handler process (default 9090)
rtc_config: configuration for ICE and other RTC related settings, same settings livekit-server RTC configuration. Used for WHIP.

# cpu costs for various Ingress types with their default values
cpu_cost:
  rtmp_cpu_cost: 2.0
  whip_cpu_cost: 2.0

The config file can be added to a mounted volume with its location passed in the INGRESS_CONFIG_FILE env var, or its body can be passed in the INGRESS_CONFIG_BODY env var.

In order for the LiveKit server to be able to create Ingress sessions, an ingress section must also be added to the livekit-server configuration:

ingress:
  rtmp_base_url: RTMP url prefix pointing to the Ingress external IP address or load balancer
  whip_base_url: WHIP url prefix pointing to the Ingress external IP address or load balancer

For instance:

ingress:
  rtmp_base_url: rtmp://my.domain.com/x
  whip_base_url: http://my.domain.com/w

A stream key will be appended to this prefix to generate the ingress session specific RTMP or WHIP publishing endpoint.

Using the Ingress service

RTMP and WHIP

The first step in order to use the Ingress service is to create an ingress session and associate it with a room. This can be done with any of the server SDKs or with the livekit-cli. The syntax with the livekit-cli is as follow:

livekit-cli create-ingress \
  --request <path to Ingress creation request JSON file>

The request creation JSON file uses the following syntax:

{
    "input_type": 0 for RTMP, 1 for WHIP
    "name": Name of the Ingress,
    "room_name": Name of the room to connect to,
    "participant_identity": Unique identity for the room participant the Ingress service will connect as,
    "participant_name": Name displayed in the room for the participant
}

On success, livekit-cli will return the unique id for the Ingress.

It is possible to get details on all created Ingress with the list-ingress command:

livekit-cli list-ingress

In particular, this will return the RTMP url WHIP endpoint to use to setup the encoder.

Running locally

Running natively

The Ingress service can be run natively on any platform supported by GStreamer.

Prerequisites

The Ingress service is built in Go. Go >= 1.18 is needed. The following GStreamer libraries and headers must be installed:

  • gstreamer
  • gst-plugins-base
  • gst-plugins-good
  • gst-plugins-bad
  • gst-plugins-ugly
  • gst-libav

On MacOS, these can be installed using Homebrew by running mage bootstrap.

Building

Build the Ingress service by running:

mage build
Running the service

To run against a local LiveKit server, a redis server must be running locally. All servers must be configured to communicate over localhost. Create a file named config.yaml with the following content:

log_level: debug
api_key: <your-api-key>
api_secret: <your-api-secret>
ws_url: ws://localhost:7880
redis:
  address: localhost:6379

On MacOS, if GStreamer was installed using Homebrew, the following environment must be set in order to ensure that GStreamer can load all its plugins:

export DYLD_LIBRARY_PATH=/opt/homebrew/lib

Then to run the service:

ingress --config=config.yaml

If starting an Ingress fails with a GStreamer error such as Failed to load libsoup library or no such element factory "souphttpsrc, try deleting your GStreamer plugin registry with:

rm -rf ~/.cache/gstreamer-1.0/

Running with Docker

To run against a local LiveKit server, a Redis server must be running locally. The Ingress service must be instructed to connect to LiveKit server and Redis on the host. The host network is accessible from within the container on IP:

  • host.docker.internal on MacOS and Windows
  • 172.17.0.1 on linux

Create a file named config.yaml with the following content:

log_level: debug
api_key: <your-api-key>
api_secret: <your-api-secret>
ws_url: ws://host.docker.internal:7880 (or ws://172.17.0.1:7880 on linux)
redis:
  address: host.docker.internal:6379 (or 172.17.0.1:6379 on linux)

In order to be able to use establish WHIP sessions over UDP, the container must be run with host networking enabled.

Then to run the service:

docker run --rm \
    -e INGRESS_CONFIG_BODY="`cat config.yaml`" \
    -p 1935:1935 \
    -p 8080:8080 \
    --network host \
    livekit/ingress


LiveKit Ecosystem
Real-time SDKsReact Components · Browser · iOS/macOS · Android · Flutter · React Native · Rust · Node.js · Python · Unity (web) · Unity (beta)
Server APIsNode.js · Golang · Ruby · Java/Kotlin · Python · Rust · PHP (community)
Agents FrameworksPython · Playground
ServicesLivekit server · Egress · Ingress · SIP
ResourcesDocs · Example apps · Cloud · Self-hosting · CLI

ingress's People

Contributors

biglittlebigben avatar cnderrauber avatar davidzhao avatar dependabot[bot] avatar frostbyte73 avatar jibon57 avatar lukasio avatar matkam avatar ocupe avatar paulwe avatar real-danm avatar renovate[bot] avatar sean-der avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ingress's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
build/ingress/Dockerfile
github-actions
.github/workflows/build.yaml
  • actions/checkout v4
  • actions/cache v4
.github/workflows/docker.yaml
  • actions/checkout v4
  • actions/cache v4
  • docker/metadata-action v5
  • actions/setup-go v5
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • docker/build-push-action v5
.github/workflows/test.yaml
  • actions/checkout v4
gomod
go.mod
  • go 1.22
  • go 1.22.6
  • github.com/Eyevinn/mp4ff v0.45.1
  • github.com/aclements/go-moremath v0.0.0-20210112150236-f10218a38794@f10218a38794
  • github.com/frostbyte73/core v0.0.10
  • github.com/go-gst/go-glib v1.1.0
  • github.com/go-gst/go-gst v1.1.0
  • github.com/gorilla/mux v1.8.1
  • github.com/livekit/go-rtmp v0.0.0-20230829211117-1c4f5a5c81ed@1c4f5a5c81ed
  • github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1@54e8a70427c1
  • github.com/livekit/mediatransportutil v0.0.0-20240625074155-301bb4a816b7@301bb4a816b7
  • github.com/livekit/protocol v1.19.1
  • github.com/livekit/psrpc v0.5.3-0.20240616012458-ac39c8549a0a@ac39c8549a0a
  • github.com/livekit/server-sdk-go/v2 v2.2.0
  • github.com/pion/dtls/v2 v2.2.12
  • github.com/pion/interceptor v0.1.30
  • github.com/pion/rtcp v1.2.14
  • github.com/pion/rtp v1.8.9
  • github.com/pion/sdp/v3 v3.0.9
  • github.com/pion/webrtc/v3 v3.2.51
  • github.com/prometheus/client_golang v1.19.1
  • github.com/sirupsen/logrus v1.9.3
  • github.com/stretchr/testify v1.9.0
  • github.com/urfave/cli/v2 v2.27.3
  • github.com/yutopp/go-flv v0.3.1
  • go.uber.org/atomic v1.11.0
  • golang.org/x/image v0.19.0
  • google.golang.org/grpc v1.65.0
  • google.golang.org/protobuf v1.34.2
  • gopkg.in/yaml.v3 v3.0.1

  • Check this box to trigger a request for Renovate to run again on this repository

H264 RTP depacketization failure due to unsupported MTAP16 and FU-B NALUs

There are reports of OBS 30.1.2 failing with ingress, sometimes after several hours of broadcasting. Ingress logs show the following errors coming from the Pion H264 depacketizer:

NALU Type is unhandled: 26
NALU Type is unhandled: 29

These correspond to NALU types MTAP16 and FU-B, which don't seem to be supported by Pion indeed.

exec: "ingress": executable file not found in %PATH% ?

I found cmd.Err have exec: "ingress": executable file not found in %PATH% ?
image
this is my ingress log

`2023-11-24T18:34:58.019+0800 INFO ingress redis/redis.go:127 connecting to redis {
"nodeID": "NE_BJf5hZKdUSCN", "simple": true, "addr": "localhost:6379"}
time="2023-11-24T18:47:18+08:00" level=info msg="Change state: From = , To = NotConnected(Server)" logger=ingress nodeID=NE_BJf5hZKdUSCN state="NotConnected(Server)" stream_id=0
time="2023-11-24T18:47:18+08:00" level=info msg=Connect logger=ingress nodeID=NE_BJf5hZKdUSCN state="NotConnected(Server)" stream_id=0
time="2023-11-24T18:47:18+08:00" level=info msg="Set win ack size: Size = 2147483647" logger=ingress nodeID=NE_BJf5hZKdUSCN state="NotConnected(Server)" stream_id=0
time="2023-11-24T18:47:18+08:00" level=info msg="Set peer bandwidth: Size = 786432, Limit = 0" logger=ingress nodeID=NE_BJf5hZKdUSCN state="NotConnected(Server)" stream_id=0
time="2023-11-24T18:47:18+08:00" level=info msg="Stream Begin: ID = 0" logger=ingress nodeID=NE_BJf5hZKdUSCN state="NotConnected(Server)" stream_id=0
time="2023-11-24T18:47:18+08:00" level=info msg="Connect: ResponseBody = &message.NetConnectionConnectResult{Properties:message.NetConnectionConnectResultProperties{FMSVer:"GO-RTMP/0,0,0,0", Capabil
ities:31, Mode:1}, Information:message.NetConnectionConnectResultInformation{Level:"status", Code:"NetConnection.Connect.Success", Description:"Connection succeeded.", Data:amf0.ECMAArray{"type
":"go-rtmp", "version":"master"}}}" logger=ingress nodeID=NE_BJf5hZKdUSCN state="NotConnected(Server)" stream_id=0
time="2023-11-24T18:47:18+08:00" level=info msg=Connected logger=ingress nodeID=NE_BJf5hZKdUSCN state="NotConnected(Server)" stream_id=0
time="2023-11-24T18:47:18+08:00" level=info msg="Change state: From = NotConnected(Server), To = Connected(Server)" logger=ingress nodeID=NE_BJf5hZKdUSCN state="Connected(Server)" stream_id=0
time="2023-11-24T18:47:18+08:00" level=info msg="Release stream...: StreamName = GnrxqezSrVnf" logger=ingress nodeID=NE_BJf5hZKdUSCN state="Connected(Server)" stream_id=0
time="2023-11-24T18:47:18+08:00" level=info msg="FCPublish stream...: StreamName = GnrxqezSrVnf" logger=ingress nodeID=NE_BJf5hZKdUSCN state="Connected(Server)" stream_id=0
time="2023-11-24T18:47:18+08:00" level=info msg="Stream creating...: &message.NetConnectionCreateStream{}" logger=ingress nodeID=NE_BJf5hZKdUSCN state="Connected(Server)" stream_id=0
time="2023-11-24T18:47:18+08:00" level=info msg="Change state: From = , To = Inactive(Server)" logger=ingress nodeID=NE_BJf5hZKdUSCN state="Inactive(Server)" stream_id=1
time="2023-11-24T18:47:18+08:00" level=info msg="Stream created...: NewStreamID = 1" logger=ingress nodeID=NE_BJf5hZKdUSCN state="Connected(Server)" stream_id=0
time="2023-11-24T18:47:18+08:00" level=info msg="Publisher is comming: &message.NetStreamPublish{CommandObject:interface {}(nil), PublishingName:"GnrxqezSrVnf", PublishingType:"live"}" logger=ingr
ess nodeID=NE_BJf5hZKdUSCN state="Inactive(Server)" stream_id=1
2023-11-24T18:47:18.216+0800 INFO ingress service/service.go:382 received ingress info {
"nodeID": "NE_BJf5hZKdUSCN", "ingressID": "IN_TJHKcQP8Ygh2", "streamKey": "GnrxqezSrVnf", "resourceID": "RT_nowW8MRPzN7E", "ingressInfo": "ingress_id:"IN_TJHKcQP8Ygh2" name:"test-ingress" stream_k
ey:"{Gnr...Vnf}" url:"rtmp://localhost:1935/live" audio:{} video:{} room_name:"7bzo-wkka" participant_identity:"kkkk" participant_name:"kkkk" reusable:true state:{status:ENDPOINT_BUFFERING s
tarted_at:1700822838208197100 resource_id:"RT_nowW8MRPzN7E"}"}
2023-11-24T18:47:18.242+0800 INFO ingress service/session_manager.go:47 ingress started {
"nodeID": "NE_BJf5hZKdUSCN", "ingressID": "IN_TJHKcQP8Ygh2", "resourceID": "RT_nowW8MRPzN7E"}
2023-11-24T18:47:23.989+0800 INFO ingress rtmp/server.go:206 Received a new published stream {
"nodeID": "NE_BJf5hZKdUSCN", "streamKey": "GnrxqezSrVnf", "resourceID": "RT_nowW8MRPzN7E"}
2023-11-24T18:47:23.989+0800 ERROR ingress service/process_manager.go:164 could not launch handler {
"nodeID": "NE_BJf5hZKdUSCN", "error": "exec: "ingress": executable file not found in %PATH%"}
github.com/livekit/ingress/pkg/service.(*ProcessManager).awaitCleanup
D:/直播流媒体/backend/ingress/pkg/service/process_manager.go:164
2023-11-24T18:47:23.990+0800 WARN ingress service/service.go:401 ingress failed {
"nodeID": "NE_BJf5hZKdUSCN", "error": "exec: "ingress": executable file not found in %PATH%"}
time="2023-11-24T18:47:23+08:00" level=info msg="Publisher accepted" logger=ingress nodeID=NE_BJf5hZKdUSCN state="Inactive(Server)" stream_id=1
time="2023-11-24T18:47:23+08:00" level=info msg="Change state: From = Inactive(Server), To = Publish(Server)" logger=ingress nodeID=NE_BJf5hZKdUSCN state="Publish(Server)" stream_id=1
2023-11-24T18:47:23.991+0800 INFO ingress rtmp/server.go:307 key frame found {
"nodeID": "NE_BJf5hZKdUSCN", "streamKey": "GnrxqezSrVnf", "resourceID": "RT_nowW8MRPzN7E"}
2023-11-24T18:47:23.992+0800 INFO ingress service/service.go:326 shutting down {
"nodeID": "NE_BJf5hZKdUSCN"}
2023-11-24T18:47:23.992+0800 INFO ingress service/session_manager.go:61 ingress ended {
"nodeID": "NE_BJf5hZKdUSCN", "ingressID": "IN_TJHKcQP8Ygh2", "resourceID": "RT_nowW8MRPzN7E"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x1573fae]

goroutine 65 [running]:
github.com/prometheus/client_golang/prometheus.(*Registry).Unregister.func1()
C:/Users/Administrator/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/registry.go:372 +0x2e
created by github.com/prometheus/client_golang/prometheus.(*Registry).Unregister in goroutine 1
C:/Users/Administrator/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/registry.go:371 +0x198

Debugger finished with the exit code 0
`

Question: GPU Support for transcoding (NVEnc) #2711

Do you have plans to add Nvidia GPU transcoding in the transcoder profiles? Gstreamer has nvenc and nvdec support. GPU cards can handle more transcoding per watt and more efficient.

Thank you in advance.

Infinite loop when closing RTMP session

This is my first time setting up LiveKit Ingress on a Kubernetes cluster using the helm guide. I've ensured that no sources are attempting to connect to the ingress and even stopped listening on the RTMP port (1935) in both firewall and my cluster's ingress. But when I checked the pod's logs I continually see the following error repeated:

2024-05-26T22:55:05.818Z	INFO	ingress	rtmp/server.go:327	closing ingress RTMP session	{"nodeID": "NE_QjxZsdzxBSvA"}
time="2024-05-26T22:55:06Z" level=info msg="Server closed by error: Err = EOF\nFailed to handshake\ngithub.com/livekit/go-rtmp.(*serverConn).Serve\n\t/root/go/pkg/mod/github.com/livekit/[email protected]/server_conn.go:31\ngithub.com/livekit/go-rtmp.(*Server).handleConn\n\t/root/go/pkg/mod/github.com/livekit/[email protected]/server.go:116\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1598" logger=ingress nodeID=NE_QjxZsdzxBSvA

I am using the latest available version on all ingress, server, and egress deployments.

Using an NGINX RTMP Module

Hi I have a configuration question it seems my configuration dosnt work, I have an RTMP nginx server setup and im pushing streams from external devices to the server then pushing them to ingress server with address 1936 but it dosnt seem to be working,

This is my

rtmp {
        server {
                listen 1935;
                chunk_size 4096;
                # Todo only allow external publishing from specific IPs
                allow publish all;

                application stream {
                        live on;
                        record off;
                        # Push to internal ingress RTMP server
                        push rtmp://127.0.0.1:1936/live/$name;
                        allow play 127.0.0.1;
                }
        }
}

And this is my base url in livekit server config

ingress:
  rtmp_base_url: "rtmp://example.com:1935/stream"

And my ingress config

cpu_cost:
  rtmp_cpu_cost: 2.0
log_level: debug
rtmp_port: 1936
http_relay_port: 9090

From external devices I push to rtmp://example.com:1935/stream using ingress streamkey

Decoding artifacts when using ingress and WHIP

We have experienced decoding artifacts like pixelation and even green screens on browsers receiving video tracks from an ingress that is using WHIP.
We verified that the video that is fed to ingress using whip was correctly encoded and in fact we could record it and see that the video at whip ingress was correct. However at the same time, the video received in all browsers subscribed to the track show decoding artifacts. We have been able to reproduce the problem using H264 and VP8. and if many browser subscribe to the tracks, all of the show the same problem at the same time

We have analysed the ingress and we think we have found possible causes for this problem: basically on ingress frames may be dropped to several causes, that may happen when media comes from WHIP. The problem seems to be that dropping samples in the middle of an encoded video stream casuses gaps in the stream that will make the video player impossible to correctly decode the stream until a new keyframe appears on the stream. The main problem is that after a sample is dropped subsequent samples are still pushed downstream even to the RemoteTrack that without sequence numbers has no way for livekit server or the browser to detect that there is a gap on the stream. Thus, when this issue happens, the decoder on the browser cannot detect the gap and just tries to decode frames causing decoding artifacts.

This happens in two places:

  • The jitter buffer used at the reception of WHIP packets may drop late ones. It is true that in this case, jitter buffer dropping samples will also cause a PLI request that theoretically should generate a key frame at some point in the near future, but until that happens, subsequent frames that has lost their previous frame reference will be pushed downstream, making the decoder to cause decoding artifact that may last from just a flash to a few seconds depending on when the keyframe appears
  • Also the output synchronizer may drop samples
    drop, err := t.sink.outputSync.WaitForMediaTime(ts)
    and in this case apart from pushing downstream subsequent frames, the point is that no PLI request is generated, so the publisher has no way to know that a keyframe is needed and the decoding artifact may last for many seconds, even minutes, in fact until for any other reason a keyframe is generated.

We have created a fix for this that basically whenever a sample is dropped, it just drops all subsequent frames until a keyframe appears. Also for the sdk_media_sink.go the fix includes that if a sample is dropped a PLI is requested upstream.

We have verified that with this fix the decoding artifacts completely dissapear, so we are pretty sure that the issue is as we described. However, I am afraid that the fix also impacts the output synchronizer causing freezings longer than what theoretically should appear. We haven't gone further on that analysis, but it seems that as when a sample is dropped a sequence of samples is dropped, this may be impacting the output synchronizer that handle sample durations thus having more difficult to correctly synchronize when not short gaps appear on the stream.

Failed reading cpu stats file on WSL2

Starting the service it exists with exit code 0 and throws "Failed reading cpu stats file".
Im using WSL2 and Docker Engine v4.16.1. I tried running it as a seperate docker container and adding it as a service to livekit, but seems to return the same message.

These are the logs:
{"level":"info","ts":1674200810.1469305,"logger":"ingress","caller":"redis/redis.go:53","msg":"connecting to redis","nodeID":"NE_hdd82Cduay5A","sentinel":false,"addr":"host.docker.internal:6379"} failed reading cpu stats file {"level":"debug","ts":1674200810.1541233,"logger":"ingress","caller":"service/service.go:119","msg":"starting service","nodeID":"NE_hdd82Cduay5A"} {"level":"info","ts":1674200810.1541848,"logger":"ingress","caller":"stats/monitor.go:126","msg":"available CPU cores: 12.000000 max cost: 2.000000","nodeID":"NE_hdd82Cduay5A"}

This is my configuration file:
log_level: debug api_key: <retracted> api_secret: <retracted> ws_url: ws://<retracted>:7880 redis: address: host.docker.internal:6379 username: "" password: "" db: 0 cpu_cost: rtmp_cpu_cost: 2.0 ingress: rtmp_base_url: rtmp://<retracted>

No Ingress webhooks called

LK Server v. 1.4.2, LK Ingress v0.9.0

Streaming works just fine, I see that Ingress participant joins with the respective webhook called, but ingress_started / ingress_ended is not triggered.

could not establish signal connection

i'm getting below error while start streaming

ERROR	ingress	service/handler.go:120	ingress failed	{"nodeID": "CENSORD", "ingressID": "CENSORD", "ingressID": "CENSORD", "error": "could not establish signal connection"}

ingressrtmp/server.go:285 Failed to write video	{"nodeID": "CENSORD", "streamKey": "CENSORD", "error": "preroll buffer reset"}
ey": "aRiBEsYufex2", "error": "preroll buffer reset"}
github.com/livekit/ingress/pkg/rtmp.(*RTMPHandler).OnVideo
	/workspace/pkg/rtmp/server.go:285
github.com/livekit/go-rtmp.(*serverDataPublishHandler).onMessage
	/root/go/pkg/mod/github.com/livekit/[email protected]/server_data_publish_handler.go:35
github.com/livekit/go-rtmp.(*streamHandler).Handle



config.yaml ingress :

log_level: debug
api_key: access_token
api_secret: CENSORD
ws_url: wss://CENSORD

redis:
address: CENSORD
db: 0
username: default
password: CENSORD
use_tls: true

ingress invalid type

dear author:
when i use ingress service , there are some issue as below:
param: ingressRequest := &livekit.CreateIngressRequest{
InputType: livekit.IngressInput_URL_INPUT,
Name: "ingress_" + name,
RoomName: room,
ParticipantIdentity: from,
ParticipantName: from,
Url: url,
}

result: {"error": "twirp error invalid_argument: invalid ingress type
could u please tell me what should i do to resolve them?

Audio streaming via ffmpeg produces choppy playback on Android devices

Hello

I have an issue when using Ingress for audio streaming to a room with ffmpeg. I have two backends

  • Go backend for room creation, Egress instantiation and rtmp URL generation for Ingress I'm using node.js for backend
  • Node.js backend for playlist management and audio streaming to given rtmp URL.

Frontend is written in Flutter/Dart and uses livekit flutter SDK of the latest version (1.3.4). Flutter version: 3.7.12

When I spawn ffmpeg process to strem music to previously generated rtmp URL with this code (Node.js)

const ffmpeg = childProcess.spawn(
    `ffmpeg`, [`-re`, `-ss`, `${toHHMMSS(req.body.seekSeconds)}`, `-stream_loop`, `-1`, `-i`, `${concat}`, `-c:v`, `libx264`, `-c:a`, `aac`, `-f`, `flv`, `${req.body.rtmpUrl}`],
    {
        cwd: process.cwd() + '/songs'
    }
);

it looks like some parts of a song are dropping and it becomes choppy (watch the attached video). This behaviour happens only on Android devices: it works fine in example Web app and iOS build of my Flutter application.
Snipper comment: toHHMMSS transforms transforms seconds to MM:SS format and concat is a list of mp3 files for playback.

IMG_0099.MOV

whip connection does not work

I'm trying to use WHIP instead of RTMP (RTMP works fine) but after accepting the connection the connection drops.

image

Config

logging:
  level: debug
redis:
    address: localhost:6379
api_key: *******
api_secret: *******
ws_url: wss://MY.URL
rtmp_port: 1935
whip_port: 8080
http_relay_port: 9090

rtc_config:
  tcp_port: 7882 # 7881 - already in use
  udp_port: 7885
  use_external_ip: false

trying to ovewrite an ingress with an older version

failed to send update {"nodeID": "NE_G6wbh9hpPx9P", "ingressID": "IN_ELgkd7J8ZAoj", "resourceID": "RT_4pu5e65b4oFE", "ingressID": "IN_ELgkd7J8ZAoj", "resourceID": "RT_4pu5e65b4oFE", "error": "trying to ovewrite an ingress with an older version"}
github.com/livekit/ingress/pkg/params.(*Params).SendStateUpdate
/workspace/pkg/params/params.go:355
github.com/livekit/ingress/pkg/media.(*Pipeline).Run.func1
/workspace/pkg/media/pipeline.go:173
github.com/livekit/ingress/pkg/media.(*Pipeline).Run
/workspace/pkg/media/pipeline.go:210
github.com/livekit/ingress/pkg/service.(*Handler).HandleIngress.func2
/workspace/pkg/service/handler.go:94

Trailing slash in ws_url causes authentication failures

Reported in slack

With livekit-server 1.4.2 and Ingress 0.9.0, when I tying to send some test rtmp data to ingress, I get following error in logs:

ERROR	ingress	service/handler.go:120	ingress failed	{"nodeID": "NE_Caea23Ygkz3s", "ingressID": "IN_AgLrhaGk9jhP", "ingressID": "IN_AgLrhaGk9jhP", "error": "unauthorized: no permissions to access the room"}

This happens if ws_url has a trailing slash like wss://livekit.example.com/. Removing the trailing slash appears to fix the auth error above.

Option for participant's metadata

It will be nice to have this option. For our case in plugNmeet we always require participant's metadata for various purpose. If user doesn't have metadata then we can't verify lot of other logic in frontend.

tag ingress streams as camera or screen share when no transcoding is specified

Currently, when we setup an ingress stream as WHIP source with not transcoding to avoid wasting server resources. But in that case the ingress interface does not allow us to tag the tracks in the ingress as screenshare or screenshare audio.

As application manage differently main video from screenshare, there are some use cases where it is needed to tag some ingress streams as screenshare.

RTSP support

It would be nice to have support for RTSP protocol which will allow to integrate bunch of different IP cameras into LiveKit room.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.