LiveKit ingress expects video by default is it tru...
# ask-ai
q
LiveKit ingress expects video by default is it true? do i need to create special ingress if i want to ingress audio only?
t
Thanks for reaching out, Mayank. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Just to share a helpful tip: LiveKit Ingress doesn’t expect video by default, so audio-only ingress works perfectly fine without needing any special setup. When you create an ingress, you can simply specify
IngressAudioOptions
and leave out
IngressVideoOptions
, and that will give you an audio-only stream. If you’d like, I’m here to help you walk through the configuration or answer any questions you might have! Sources: livekit/livekit_ingress.pb.go | packages/livekit-server-sdk/src/IngressClient.ts | lib/livekit/ingress_service_client.rb | livekit-protocol/src/livekit.rs
q
so can u show me how can i create an ingress with audio only? i am using nodejs livekit-server-sdk
t
I'd be happy to guide you through creating an audio-only ingress using the Node.js LiveKit server SDK. Just follow these simple steps: 1. First, initialize the
IngressClient
with your LiveKit server URL, API key, and secret. Here's how you can do it:
Copy code
import { IngressClient, IngressInput } from 'livekit-server-sdk';

const ingressClient = new IngressClient(
  process.env.LIVEKIT_URL,
  process.env.LIVEKIT_API_KEY,
  process.env.LIVEKIT_API_SECRET
);
1. Next, set up the ingress options specifically for audio-only by using
IngressAudioOptions
and leaving out any video settings. Here's an example:
Copy code
const ingressOptions = {
  roomName: 'my-audio-room',
  participantIdentity: 'audio-streamer',
  participantName: 'Audio Stream',
  audio: {
    name: 'Primary Audio',
    source: 'MICROPHONE',
    preset: 'OPUS_STEREO_96KBPS', // High-quality stereo preset
  },
};
1. Finally, create the ingress with your preferred input type, such as RTMP:
Copy code
const rtmpIngress = await ingressClient.createIngress(
  IngressInput.RTMP_INPUT,
  ingressOptions
);

console.log('Stream Key:', rtmpIngress.streamKey);
console.log('URL:', rtmpIngress.url);
And that's it! This will set up an audio-only ingress for you. If you'd like to explore custom audio encoding options or have any other questions, please feel free to ask—I'm here to help! Sources: examples/receive-audio/index.ts | lib/livekit/ingress_service_client.rb | livekit-protocol/livekit/protocol/ingress.pyi | Stream import | LiveKit docs
q
#ask-ai so can u show me how can i create an ingress with audio only? i am using nodejs livekit-server-sdk