Giter Site home page Giter Site logo

unrealcgh / camerartmpsdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abson/camerartmpsdk

0.0 1.0 0.0 132.29 MB

CameraRtmpSDK is an audio and video based on ffmpeg SDK, is committed to creating a cross-platform audio and video sampling, encoding, mixing, protocol upload program.

Objective-C 0.36% Objective-C++ 93.66% C++ 5.98%

camerartmpsdk's Introduction

Which is CameraRtmpSDK

CameraRtmpSDK is an audio and video based on ffmpeg SDK, is committed to creating a cross-platform audio and video sampling, encoding, mixing, protocol upload program. But all current creation is based on the iOS platform and CameraRtmpSDK was coded by c++.

Blog to Introduction

利用FFmpeg 开发音视频流(三)——将视频 YUV 格式编码成 H264

深入浅出理解视频编码H264结构

i did write a blog to introduce this project , hope it can help you to comprehend it.

How to Use

If you want to test Vido (H.264编码)

self.session = [[ABSSimpleSession alloc] initWithVideoSize:CGSizeMake(640, 480)
                                                       fps:30
                                                   bitrate:1000000
                                   useInterfaceOrientation:true
                                               cameraState:ABSCameraStateFront previewFrame:self.view.bounds];
self.session.delegate = self;
[self.view addSubview:self.session.previewView];

[self.session startVideoRecord];

// close it 
[self.session endVidoeRecord];

if you want to test audio for AAC (AAC编码)

self.session = [[ABSSimpleSession alloc] initWithAudioSampleRate:16000 bitRate:16000
                                                      channelCount:2 encode:ABSEncodeTypeAAC];
self.session.delegate = self;
[self.session startAudioRecord];

// close it 
[self.session endAudioRecord];

if you want to test audio for Opus (Opus编码)

self.session = [[ABSSimpleSession alloc] initWithAudioSampleRate:16000 bitRate:16000
                                                      channelCount:2 encode:ABSEncodeTypeOpus];
self.session.delegate = self;
[self.session startAudioRecord];

// close it 
[self.session endAudioRecord];

if you want to test amix(混音) of ffmpeg

NSString* path1 = [[NSBundle mainBundle] pathForResource:@"audio1.wav" ofType:nil];
NSString* path2 = [[NSBundle mainBundle] pathForResource:@"audio2.wav" ofType:nil];
NSString* outputPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true).lastObject 
stringByAppendingPathComponent:@"audio127.wav"];

const char* input1 = [path1 cStringUsingEncoding:NSUTF8StringEncoding];
const char* input2 = [path2 cStringUsingEncoding:NSUTF8StringEncoding];
const char* output = [outputPath cStringUsingEncoding:NSUTF8StringEncoding];

std::vector<std::string> inputs{std::string(input1), std::string(input2)};

PushSDK::ffmpeg::audio_mixer mixer(inputs, output);
mixer.StartMixAudio();

Update

2017.11.1 Update project to runnable and and modify test API, enjoy it.

2018.1.2 Fix audio encode bug, make it encode correctly,enjoy it.

Feature

As far as this moment, This project looks very confusing,i will take more time make it more usable. hope you can supports me, leaving you stars, Thanks.

camerartmpsdk's People

Contributors

warntbetter avatar

Watchers

James Cloos 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.