5

Working on implementing Screen Sharing(Replay Kit) in iOS app using Kurento Media Server. I get CMSampleBuffer which follows RTMP protocol. But Kurento doesn't support RTMP. It does support RTP. Is there a way to convert from RTMP to RTP. I read about ffmpeg but it seems to need to be implemented on server side which require a lot of change in current flow something like below [Browser] -> RTMP -> [Node_Media_Server(srs)] -> RTMP ->

[FFmpeg] -> RtpEndpoint -> [Kurento] -> WebrtcEndpoint -> [Browser]

Will this flow be efficient enough ?

Is there a way to convert it from client side i.e iOS application?

3 Answers3

0

Using WebRTC to send an iOS devices’ screen capture using ReplayKit Looks like the answer in this question may point you in the right direction. Kurento supports webrtc. You can take the pixel buffer from the cmsamplebuffer and turn it into a RTCFrame and pipe that into a local video source and stream it up using webrtc

hartwellalex
  • 396
  • 3
  • 3
0

The problem was with videoCapturer , VideoSource and video track initialized again and again in processSampleBuffer. We need to create VideoCapturer, VideoSource, MediaStream, VideoTrack only once in broadcastStartedWithSetupInfo.

Now i am able to see video packets on wireshark but a green screen appears on receiver side . I think the issue is with media configuration which is as below.

NBMMediaConfiguration *config = [[NBMMediaConfiguration alloc] init];
config.rendererType = NBMRendererTypeOpenGLES;
config.audioBandwidth = 0;
config.videoBandwidth = 0;
config.audioCodec = NBMAudioCodecOpus;
config.videoCodec = NBMVideoCodecVP8;

NBMVideoFormat format;
format.dimensions = (CMVideoDimensions){720, 480};
format.frameRate = 30;
format.pixelFormat = NBMPixelFormat420f;
config.receiverVideoFormat = format;

config.cameraPosition = NBMCameraPositionAny;

Please suggest if it seems correct

0

SRS 4.0 supports coverting RTMP to WebRTC, or vice versa.

For usage, please follow SRS #307 and RTMP to RTC.

The stream flow is like bellow, it's quite simple:

FFmpeg/OBS/CMSampleBuffer --RTMP--> SRS --WebRTC--> Browser

Note that RTMP does not support opus, while WebRTC always use opus as default audio codec, so SRS transcodes aac to opus, which causes performance suffer.

However, seems there is no audio for your sue scenario, so it seems OK.

ChrisF
  • 134,786
  • 31
  • 255
  • 325
Winlin
  • 1,136
  • 6
  • 25