gpu

GPUHaishinKit

Camera and Microphone streaming library via RTMP, HLS for iOS. Powered by GPUImage + HaishinKit.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

36

Maintenance

Last Commit

3yrs ago

Contributors

1

Package

Dependencies

2

License

New BSD

Categories

Readme

[Archived]GPUHaishinKit.swift

Platform Language CocoaPods GitHub license

  • GPUImage is unmaintained. Also can't maintenance GPUHaishinKit. 7/14, 2018
  • GPUImage + HaishinKit(lf). Camera and Microphone streaming library via RTMP, HLS for iOS.

Features

Requirements

-iOSXCodeSwiftCocoaPodsCarthage
1.2.08.0+8.3+4.01.2.00.20.0+
1.1.08.0+8.3+3.11.2.00.20.0+

Cocoa Keys

iOS10.0+

  • NSMicrophoneUsageDescription
  • NSCameraUsageDescription

Installation

CocoaPods

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

def import_pods
    pod 'GPUHaishinKit', '~> 1.2.0'
end

target 'Your Target'  do
    platform :ios, '8.0'
    import_pods
end

Carthage

github "shogo4405/GPUHaishinKit.swift" ~> 1.2.0

License

BSD-3-Clause

RTMP Usage

// must import HaishinKit and GPUHaishinKit
import HaishinKit
import GPUHaishinKit

import GPUImage

class ViewController: UIViewController {
    @IBOutlet weak var outputView: GPUImageView?

    var camera:GPUImageVideoCamera?
    var filter:GPUImageSepiaFilter?
    var rtmpConnection:RTMPConnection?
    var rtmpStream:RTMPStream?

    var output:GPUImageRawDataOutput!

    override func viewDidLoad() {
        super.viewDidLoad()
        camera = GPUImageVideoCamera(sessionPreset: AVCaptureSessionPreset1280x720, cameraPosition: .back)
        rtmpConnection = RTMPConnection()
        rtmpStream = RTMPStream(connection: rtmpConnection!)
        filter = GPUImageSepiaFilter()
    }

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        rtmpStream?.attachGPUImageVideoCamera(camera!)
        rtmpStream?.attachAudio(AVCaptureDevice.defaultDevice(withMediaType: AVMediaTypeAudio))
        rtmpStream?.videoSettings = [
            "width": 720,
            "height": 1280,
        ]
        camera?.addTarget(filter!)
        filter?.addTarget(outputView)
        filter?.addTarget(rtmpStream!.rawDataOutput)
        camera?.outputImageOrientation = .portrait
        camera?.startCapture()
    }

    override func viewWillDisappear(_ animated: Bool) {
        rtmpStream?.close()
        rtmpStream?.dispose()
        camera?.stopCapture()
        super.viewWillDisappear(animated)
    }
}

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100