Mobile-SDK-iOS icon indicating copy to clipboard operation
Mobile-SDK-iOS copied to clipboard

结合LFLiveKit做推流直播

Open YuhangYang opened this issue 4 years ago • 3 comments

QQ20201118-100100@2x QQ20201118-100043@2x 如图所示,LFLiveKit的pushVideo外部视频是个像素缓存区类型; -(void)videoFeed:(DJIVideoFeed *)videoFeed didUpdateVideoData:(NSData *)videoData; 获取到的是个data,如何回去到DJIVideoFeed中解析好的pixelBuffer呢???!!!

YuhangYang avatar Nov 18 '20 03:11 YuhangYang

Agent comment from Luce Luo in Zendesk ticket #41174:

尊敬的客户,

您好!感谢您联系DJI 大疆创新。 MSDK不支持获取视频流解码过的CVPixelBufferRef,如果您需要实现直播业务,可以使用官方提供的RTMP方式,示例如下: https://github.com/dji-sdk/Mobile-SDK-iOS/tree/master/Sample%20Code/ObjcSampleCode/DJISdkDemo/Demo/Liveview

非常感谢您的理解与配合,祝您生活愉快!

Best Regards,

DJI 大疆创新SDK技术支持

dji-dev avatar Nov 18 '20 10:11 dji-dev

Agent comment from Luce Luo in Zendesk ticket #41174:

尊敬的客户,

您好!感谢您联系DJI 大疆创新。 MSDK不支持获取视频流解码过的CVPixelBufferRef,如果您需要实现直播业务,可以使用官方提供的RTMP方式,示例如下: https://github.com/dji-sdk/Mobile-SDK-iOS/tree/master/Sample%20Code/ObjcSampleCode/DJISdkDemo/Demo/Liveview

非常感谢您的理解与配合,祝您生活愉快!

Best Regards,

DJI 大疆创新SDK技术支持

1、安卓端直接使用MSDK中的RMTP推流示列,输入推流URL,可以正常直接使用。 2、iOS端直接使用MSDK中的RMTP推流示列,输入推流URL,VideoLiveStreamingViewController.m中的DJIRtmpMuxerState=DJIRtmpMuxerState_prepareIFrame。 3、用UXSDK的DefaultLayoutViewController.m的页面导入MSDK中VideoLiveStreamingViewController.m是的直播推流的代码。运行后,DJIRtmpMuxerState=DJIRtmpMuxerState_Stoped。 大哥知道为什么吗?

YuhangYang avatar Nov 19 '20 07:11 YuhangYang

结合LFLiveKit做推流可以调用

- (void)videoProcessFrame:(VideoFrameYUV *)frame { 
    //硬件解码成功
    if (frame->cv_pixelbuffer_fastupload) {
         [self.rtmpManager pushPixelBuffer:frame->cv_pixelbuffer_fastupload];
    }else{
        DDLogError(@"该设备不支持硬解");
    }
}

- (void)pushPixelBuffer:(CVPixelBufferRef)pixelBuffer {
  [self.liveSession pushVideo:pixelBuffer];
}

第一个是DJ的代理方法 在DJIWidgetDJIStreamCommon.h文件下

@protocol VideoFrameProcessor <NSObject>
@required
/**
 * Enables the frame processor
 */
-(BOOL) videoProcessorEnabled;
-(void) videoProcessFrame:(VideoFrameYUV*)frame;

@optional
/*
 * this output frame is not the same frame that input to the decoder
 * this frame only keeps some basic infomations from that input frame
 */
-(void) videoProcessFailedFrame:(VideoFrameH264Raw*)frame;
@end

你可以试试

randy-Zhang avatar Dec 14 '20 02:12 randy-Zhang