Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ 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.
enable_udp_url_pull: allow URL pull ingresses to pull from udp:// urls (default false)
multicast_interface: network interface to join multicast groups on for UDP url pull. Empty lets the OS decide

# cpu costs for various Ingress types with their default values
cpu_cost:
Expand Down
3 changes: 3 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ type ServiceConfig struct {
Logging logger.Config `yaml:"logging"`
Development bool `yaml:"development"`
PSRPCSkipClaim bool `yaml:"psrpc_skip_claim,omitempty"` // Lets psrpc servers skip the claim handshake on queue rpcs
EnableUDPURLPull bool `yaml:"enable_udp_url_pull,omitempty"`
// Network interface to join multicast groups on for UDP url pull. Empty means let the OS decide.
MulticastInterface string `yaml:"multicast_interface,omitempty"`

// Used for WHIP transport
RTCConfig rtcconfig.RTCConfig `yaml:"rtc_config"`
Expand Down
21 changes: 20 additions & 1 deletion pkg/media/urlpull/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (
"github.com/frostbyte73/core"
"github.com/go-gst/go-gst/gst"

"github.com/livekit/protocol/logger"

"github.com/livekit/ingress/pkg/errors"
"github.com/livekit/ingress/pkg/params"
"github.com/livekit/protocol/logger"
)

var (
Expand Down Expand Up @@ -85,6 +86,24 @@ func NewURLSource(_ context.Context, p *params.Params) (*URLSource, error) {
}
}
}
} else if p.EnableUDPURLPull && strings.HasPrefix(p.Url, "udp://") {
elem, err = gst.NewElement("udpsrc")
if err != nil {
return nil, err
}
err = elem.SetProperty("uri", p.Url)
if err != nil {
return nil, err
}

if p.MulticastInterface != "" {
err = elem.SetProperty("multicast-iface", p.MulticastInterface)
if err != nil {
return nil, err
}
}

// udpsrc doesn't expose a stats property, so leave printStats unset
} else {
return nil, errors.ErrUnsupportedURLFormat
}
Expand Down
Loading