LFLiveVideoConfiguration 配置类
LFLiveVideoConfiguration *videoConfiguration = [LFLiveVideoConfiguration new];
videoConfiguration.videoSize = CGSizeMake(720, 1280);
videoConfiguration.videoBitRate = 800*1024;
videoConfiguration.videoMaxBitRate = 1000*1024;
videoConfiguration.videoMinBitRate = 500*1024;
videoConfiguration.videoFrameRate = 15;
videoConfiguration.videoMaxKeyframeInterval = 30;
videoConfiguration.orientation = UIInterfaceOrientationPortrait;
videoConfiguration.sessionPreset = LFCaptureSessionPreset720x1280;
LFLiveSession 会话类
_session = [[LFLiveSession alloc] initWithAudioConfiguration:[LFLiveAudioConfiguration defaultConfiguration] videoConfiguration:[LFLiveVideoConfiguration defaultConfigurationForQuality:LFLiveVideoQuality_Medium2] liveType:LFLiveRTMP];
_session.delegate = self;
_session.running = YES;
_session.preView = self.livingPreView;
停止直播
[_session stopLive];
开始直播
[_session startLive:stream];
LFLiveStreamInfo 推流配置,可配置推流地址
LFLiveStreamInfo *stream = [LFLiveStreamInfo new];
stream.url=@"";
注意:LFLiveKit已经集成了CPUImage,不再需要集成
demo 链接:https://github.com/licl19/LFLiveKitDemo.git
注意:demo里的url需要改成实际推流地址