4

I am currently trying to make some modifications to the incoming WebRTC video stream in the AppRTC app for iOS in Swift (which in turn is based on this Objective-C version). To do so, I need access to the data which is stored in the frame objects of class RTCI420Frame (which is a basic class for the Objective-C implementation of libWebRTC). In particular, I need an array of bytes: [UInt8] and Size of the frames. This data is to be used for further processing & addition of some filters.

The problem is, all the operations on RTCVideoTrack / RTCEAGLVideoView are done under the hood of pre-compiled libWebRTC.a, it is compiled from the official WebRTC repository linked above and it's fairly complicated to get a custom build of it, so I'd prefer to go with the build available in the example iOS project; in my understanding it's supposed to have all the available functionality in it.

I was looking into RTCVideoChatViewController class and in particular, remoteView / remoteVideoTrack, but had no success in accessing the frames themselves, spent a lot of time researching the libWebRTC sources in official repo but still can't wrap my head around the problem of accessing the frames data for own manipulations with it. Would be glad for any help!

4

1 回答 1

4

就在发布问题后,我很幸运地找到了偷偷摸摸的数据!

您必须将以下属性添加到 RTCEAGLVideoView.h 文件:

@property(atomic, strong) RTCI420Frame* i420Frame;

原始实现文件中有i420Frame属性,但它没有在 iOS 项目的类头文件中公开。添加该属性允许您获取视图的当前帧。

我仍在寻找一种更优雅的方式来直接获取流数据,而无需查看 remoteView 内容,一旦找到它就会更新答案。

于 2016-08-25T00:04:16.787 回答