Latest 1.2.0
Homepage https://github.com/shogo4405/GPUHaishinKit.swift
License New BSD
Platforms ios 8.0
Dependencies GPUImage, HaishinKit
Authors

GPUHaishinKit.swift

Platform
Language
CocoaPods
GitHub license

GPUImage + HaishinKit(lf). Camera and Microphone streaming library via RTMP, HLS for iOS.

Whare is Issues page?

Features

Requirements

iOS XCode Swift CocoaPods Carthage
1.2.0 8.0+ 8.3+ 4.0 1.2.0 0.20.0+
1.1.0 8.0+ 8.3+ 3.1 1.2.0 0.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

New BSD

Donation

Bitcoin

1CWA9muX36QKBdJiRQJGpu2HvchfEpJbWr

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)
    }
}

Latest podspec

{
    "name": "GPUHaishinKit",
    "version": "1.2.0",
    "summary": "Camera and Microphone streaming library via RTMP, HLS for iOS. Powered by GPUImage + HaishinKit",
    "description": "GPUHaishinKit. Camera and Microphone streaming library via RTMP, HLS for iOS. Powered by GPUImage + HaishinKit",
    "homepage": "https://github.com/shogo4405/GPUHaishinKit.swift",
    "license": "New BSD",
    "authors": {
        "shogo4405": "[email protected]"
    },
    "source": {
        "git": "https://github.com/shogo4405/GPUHaishinKit.swift.git",
        "tag": "1.2.0"
    },
    "social_media_url": "http://twitter.com/shogo4405",
    "platforms": {
        "ios": "8.0"
    },
    "ios": {
        "source_files": "Platforms/iOS/*.{h,swift}"
    },
    "source_files": "Sources/**/*.swift",
    "dependencies": {
        "GPUImage": [
            "~> 0.1.7"
        ],
        "HaishinKit": [
            "~> 0.8.0"
        ]
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This