Coder Social home page Coder Social logo

nodemediaclient-ios's Introduction

NodeMediaClient

A simple, high-performance, low-latency live streaming SDK.

Features

Play

  • RTMP/RTSP/HLS/HTTP/KMP/UDP protocols
  • FLV/MP4/fMP4/MKV/MPEGTS demuxers
  • H264/H265 video decoders
  • AAC/OPUS/G711/SPEEX/NELLYMOSER audio decoders
  • Audio and video content decryption
  • Hardware Acceleration
  • Low latency
  • Delay elimination
  • Compatible with flv_extension_id and Enhanced-Rtmp standards

Publish

  • RTMP/RTSP/HLS/HTTP/KMP/UDP protocols
  • FLV/MPEGTS muxers
  • H264/H265 video encoders
  • AAC audio encoder
  • Audio and video content encryption
  • Hardware Acceleration
  • Arbitrary video resolution
  • Multiple output
  • Compatible with flv_extension_id and Enhanced-Rtmp standards

Install

You want to add pod 'NodeMediaClient', '~> 3.2.3' similar to the following to your Podfile:

target 'MyApp' do
  pod 'NodeMediaClient', '~> 3.2.3'
end

Then run a pod install inside your terminal, or from CocoaPods.app.

Play Live Streaming

1. import header

#import "ViewController.h"
#import <NodeMediaClient/NodeMediaClient.h>
#import <AVFoundation/AVFoundation.h>

2. define object

@interface ViewController ()
@property (nonatomic, strong) NodePlayer *np;
@end

3.Play the stream

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _np = [[NodePlayer alloc] init];
    [_np attachView:self.view];
    [_np setScaleMode:1];
    [_np start:@"rtmp://192.168.0.2/live/demo"];
}

- (void)viewWillDisappear:(BOOL)animated {
    [_np stop];
    [_np detachView];
}
@end

Publish Live Streaming

1. Request more permissions

Please confirm that the description of the 'Privacy - Microphone Usage Description' and the 'Privacy - Camera Usage Description' is added in info.plist .

2. Import header

#import "ViewController.h"
#import <AVFoundation/AVFoundation.h>
#import <NodeMediaClient/NodeMediaClient.h>

3. Define object

@interface ViewController ()
@property (nonatomic, strong) NodePublisher *np;
@end

4.Start Publish

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _np = [[NodePublisher alloc] init];
    [_np attachView:self.view];
    [_np setAudioParamWithCodec:NMC_CODEC_ID_AAC profile:NMC_PROFILE_AUTO samplerate:48000 channels:2 bitrate:64*1000];
    [_np setVideoOrientation:VIDEO_ORIENTATION_PORTRAIT];
    [_np setVideoParamWithCodec:NMC_CODEC_ID_H264 profile:NMC_PROFILE_AUTO width:480 height:854 fps:30 bitrate:1000*1000];
    [_np openCamera:true];
    [_np start:@"rtmp://192.168.0.2/live/demo"];
    // Do any additional setup after loading the view.
}

- (void)viewWillDisappear:(BOOL)animated {
    [_np stop];
    [_np closeCamera];
    [_np detachView];
}
@end

Demo

https://cdn.nodemedia.cn/NodeMediaClient/NodeMediaClient-iOSDemo.zip

License

A commercial license is required.
https://www.nodemedia.cn/product/nodemediaclient-iOS/

Business & Technical service

nodemediaclient-ios's People

Contributors

illuspas 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.