livekit / server-sdk-ruby

LiveKit Server SDK for Ruby
Apache License 2.0
21 stars 15 forks source link

ParticipantEgressRequest does not support StreamOutput #41

Open armanddp opened 7 months ago

armanddp commented 7 months ago

From discussion on Slack (https://livekit-users.slack.com/archives/C01KVTJH6BX/p1700152530119099) the Ruby SDK doesn't include support for StreamOutput for a ParticipantEgressRequest.

At the moment when calling start_participant_egress with a StreamOutput it fails because the Proto::ParticipantEgressRequest doesn't have a stream attribute. Client code adapted from RoomComposite sample:

info = egress_client.start_participant_egress(
        event.short_code,
        profile.uuid,
        LiveKit::Proto::StreamOutput.new(
          protocol: LiveKit::Proto::StreamProtocol::RTMP,
          urls: rtmps
        )
      )

SDK: egress_service_client.rb (Line 236)

   # helper that sets output to file or stream
    def set_output(request, output)
      ....
      elsif output.is_a? LiveKit::Proto::StreamOutput
        request.stream = output
        request.stream_outputs = Google::Protobuf::RepeatedField.new(:message, Proto::StreamOutput, [output])
      end
    end

The use case we are looking at solving is to maintain compatibility with pre-LiveKit code and want to forward the participant stream (video+audio) with as little overhead as possible for onwards processing to a RTMP endpoint. (edited)