使用库伦托媒体服务器在iOS应用程序中实现屏幕共享(重播工具包)。我得到了遵循RTMP协议的CMSampleBuffer。但是Kurento不支持RTMP。它确实支持RTP。有没有办法把RTMP转换成RTP?我读到过关于ffmpeg的文章,但它似乎需要在服务器端实现,这需要在当前流程中进行大量更改,例如下面的Browser -> RTMP -> Node_Media_Server(srs) -> RTMP ->
FFmpeg -> RtpEndpoint ->库伦托-> WebrtcEndpoint ->浏览器
这个流程是否足够有效?
有没有办法把它从客户端转换成iOS应用程序?
发布于 2018-12-31 07:02:35
Using WebRTC to send an iOS devices’ screen capture using ReplayKit看起来这个问题的答案可能会给你指明正确的方向。Kurento支持webrtc。您可以从cmsamplebuffer中获取像素缓冲区,并将其转换为RTCFrame,再通过管道将其转换为本地视频源,然后使用webrtc将其流传输。
发布于 2019-01-04 17:48:45
问题是在processSampleBuffer中一次又一次地初始化videoCapturer、VideoSource和视频轨道。我们只需要在broadcastStartedWithSetupInfo中创建一次VideoCapturer,VideoSource,MediaStream,VideoTrack。
现在我可以在wireshark上看到视频数据包,但接收器端出现了一个绿色屏幕。我认为问题出在媒体配置上,如下所示。
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;如果看起来是对的,请给出建议
发布于 2021-12-18 01:49:02
SRS 4.0支持RTMP到WebRTC之间的相互转换。
的用法请关注SRS #307和RTMP to RTC。
这个流就像是bellow,它很简单:
FFmpeg/OBS/CMSampleBuffer --RTMP--> SRS --WebRTC--> Browser需要注意的是,RTMP不支持opus,而WebRTC默认音频编解码器使用的是opus,所以RTMP会将aac转码为opus,这会导致性能下降。
但是,您的sue场景似乎没有音频,所以看起来没问题。
https://stackoverflow.com/questions/53664557
复制相似问题