Git Product home page Git Product logo

lflivekit's Introduction

LFLiveKit

icon~

Build Status  License MIT  CocoaPods  Support  platform 

LFLiveKit is a opensource RTMP streaming SDK for iOS.

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 7.0+
- Xcode 7.3

Installation

CocoaPods

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

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
pod 'LFLiveKit'

# Then, run the following command:
$ pod install

Carthage

1. Add `github "LaiFengiOS/LFLiveKit"` to your Cartfile.
2. Run `carthage update --platform ios` and add the framework to your project.
3. Import \<LFLiveKit/LFLiveKit.h\>.

Manually

1. Download all the files in the `LFLiveKit` 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

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

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

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

//MARK: - CallBack:
- (void)liveSession:(nullable LFLiveSession *)session liveStateDidChange: (LFLiveState)state;
- (void)liveSession:(nullable LFLiveSession *)session debugInfo:(nullable LFLiveDebug*)debugInfo;
- (void)liveSession:(nullable LFLiveSession*)session errorCode:(LFLiveSocketErrorCode)errorCode;

Swift

// import LFLiveKit in [ProjectName]-Bridging-Header.h
#import <LFLiveKit.h> 

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

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

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

//MARK: - Callback
func liveSession(session: LFLiveSession?, debugInfo: LFLiveDebug?) 
func liveSession(session: LFLiveSession?, errorCode: LFLiveSocketErrorCode)
func liveSession(session: LFLiveSession?, liveStateDidChange state: LFLiveState)

Release History

* 2.0.0
    * CHANGE: modify bugs,support ios7 live.
* 2.2.4.3
    * CHANGE: modify bugs,support swift import.
* 2.5 
    * CHANGE: modify bugs,support bitcode.

License

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

lflivekit's People

Contributors

toss156 avatar zenonhuang avatar leonatan avatar michael-ioser avatar hannseman avatar zhangyu528 avatar kciter avatar bunnyirsa avatar linyehui avatar

Watchers

Shmulik Flint avatar Ivan Kamenev avatar James Cloos avatar yaniv even haim avatar Andrii Rodionov avatar Mykyta Shyrin avatar Algimantas Krasauskas avatar Denys avatar Gilad Artzi avatar Oleksandr Dorokhin avatar  avatar Kristina avatar Noam Katzir avatar JJ Major avatar  avatar Valera avatar Jony Vesterman Cohen avatar Andrey Makarov avatar Serhii Korniienko avatar Yuval Aviyam avatar Ohad Raz avatar Olesia Zaichenko avatar Andrii Ziabriev avatar Maor Hamami avatar Gregory Bondar avatar Evaldas avatar Ward Abbass avatar Jurij Mikelionis avatar uri bechar avatar Vladimir Sorkin avatar Artur Rieznik avatar Audrius Petreikis avatar Michaelda avatar Tomer Chajaj avatar Victoria Kirushenkova avatar Tetiana Stashchenko avatar Mykolas Sindeikis avatar Itay Gadot avatar Anna Tsibulskaya avatar regina avatar Eyal Malron avatar Jonas Kabelka avatar Amir Uval avatar Kobi Zakut avatar Nikolay Kolesnik avatar Aleksandr Khambir avatar Ovchinnikov Konstantyn avatar Robert Woolfson avatar Guy Goldman avatar Avi Mualem avatar  avatar Ido Karnon avatar Alexey Soshin avatar Moises Rezonzew avatar Vitaliy Sobol avatar  avatar Dan Noybouer avatar  avatar Yakir Amar avatar Dom avatar Julia Kozyreva avatar Omer Gartzman avatar Yaniv Stein avatar Dana avatar Cheli Bachar avatar Mykola Vlasov avatar Liron Chakim avatar Itay Steinberg avatar Aleksandra Pervunina avatar Ran Romano avatar  avatar  avatar Valentyna Kalinichenko avatar Yael Sapir avatar Svitlana Koshelieva avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.