Skip to content

Fork of LaiFeng IOS Live Kit,H264 and AAC Hard coding,support GPUImage Beaut, rtmp transmission, weak network lost frame

License

Notifications You must be signed in to change notification settings

washingtonpost/ios-livekit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiveKit

LiveKit is a opensource RTMP streaming SDK for iOS forked from LiveKit and maintained by WashPost.

Features

  • Background recording
  • Support horizontal vertical recording
  • Support Beauty Face With GPUImage
  • Support H264+AAC Hardware Encoding
  • Drop frames on bad network
  • Dynamic switching rate
  • Audio configuration
  • Video configuration
  • RTMP Transport
  • Switch camera position
  • Audio Mute
  • Support Send Buffer
  • Support WaterMark
  • Swift Support
  • Support Single Video or Audio
  • Support External input video or audio(Screen recording or Peripheral)
  • FLV package and send

Requirements

- iOS 10.0+
- Xcode 10.2

Installation

CocoaPods

# To integrate LiveKit into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
pod 'LiveKit'

# Then, run the following command:
$ pod install

Manually

1. Download all the files in the `LiveKit` subdirectory.
2. Add the source files to your Xcode project.
3. Link with required frameworks:
    * UIKit
    * Foundation
    * AVFoundation
    * VideoToolbox
    * AudioToolbox
    * libz
    * libstdc++

Usage example

Objective-C

- (LiveSession*)session {
	if (!_session) {
	    _session = [[LiveSession alloc] initWithAudioConfiguration:[LiveAudioConfiguration defaultConfiguration] videoConfiguration:[LiveVideoConfiguration defaultConfiguration]];
	    _session.preView = self;
	    _session.delegate = self;
	}
	return _session;
}

- (void)startLive {	
	LiveStreamInfo *streamInfo = [LiveStreamInfo new];
	streamInfo.url = @"your server rtmp url";
	[self.session startLive:streamInfo];
}

- (void)stopLive {
	[self.session stopLive];
}

//MARK: - CallBack:
- (void)liveSession:(nullable LiveSession *)session liveStateDidChange: (LiveState)state;
- (void)liveSession:(nullable LiveSession *)session debugInfo:(nullable LiveDebug*)debugInfo;
- (void)liveSession:(nullable LiveSession*)session errorCode:(LiveSocketErrorCode)errorCode;

Swift

TODO update

import LiveKit

//MARK: - Getters and Setters
lazy var session: LiveSession = {
	let audioConfiguration = LiveAudioConfiguration.defaultConfiguration()
	let videoConfiguration = LiveVideoConfiguration.defaultConfigurationForQuality(LiveVideoQuality.Low3, landscape: false)
	let session = LiveSession(audioConfiguration: audioConfiguration, videoConfiguration: videoConfiguration)
	    
	session?.delegate = self
	session?.preView = self.view
	return session!
}()

//MARK: - Event
func startLive() -> Void { 
	let stream = LiveStreamInfo()
	stream.url = "your server rtmp url";
	session.startLive(stream)
}

func stopLive() -> Void {
	session.stopLive()
}

//MARK: - Callback
func liveSession(session: LiveSession?, debugInfo: LiveDebug?) 
func liveSession(session: LiveSession?, errorCode: LiveSocketErrorCode)
func liveSession(session: LiveSession?, liveStateDidChange state: LiveState)

Release History

TODO.

License

LiveKit is released under the MIT license. See LICENSE for details.

About

Fork of LaiFeng IOS Live Kit,H264 and AAC Hard coding,support GPUImage Beaut, rtmp transmission, weak network lost frame

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 60.5%
  • Swift 14.7%
  • Objective-C++ 13.5%
  • C++ 8.6%
  • Ruby 1.7%
  • Shell 1.0%