Code Monkey home page Code Monkey logo

librestreaming's Introduction

Android real-time effect filter rtmp streaming library

安卓实时滤镜RTMP推流库

Requirements

  • Android 4.3 or higher (MediaCodec&surfacetexture)

This library is based on Mediacodec & librtmp. You can create your custom filter extend with BaseVideoFilter. There are some demo filter using Java,NDK & RenderScript in sample. Access filter between acquireVideoFilter & releaseVideoFilter in 3ms. The colorformat in filter is NV21.

基于Mediacodec和librtmp. 你可以通过继承BaseVideoFilter创建自定义滤镜. sample中有一些使用Java,NDK和RenderScript的滤镜示例 在acquireVideoFilter和releaseVideoFilter之间更新滤镜的属性,不要超过3毫秒. 滤镜中的颜色格式为NV21

Sample use:

    @Override
    public void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity);
    
        RESConfig resConfig = RESConfig.obtain();
        resConfig.setTargetVideoSize(new Size(720, 480));
        resConfig.setBitRate(1000 * 1000);
        resConfig.setRtmpAddr("rtmp://****");
        resConfig.setDefaultCamera(Camera.CameraInfo.CAMERA_FACING_FRONT);
        resConfig.setFrontCameraDirectionMode(RESConfig.DirectionMode.FLAG_DIRECTION_ROATATION_90 | RESConfig.DirectionMode.FLAG_DIRECTION_FLIP_HORIZONTAL);
        resConfig.setBackCameraDirectionMode(RESConfig.DirectionMode.FLAG_DIRECTION_ROATATION_90);
        if (!resClient.prepare(resConfig)) {
            Log.e("Main", "prepare,failed!!");
        }
        /*
        *resClient.start();//start streaming & preview
        *resClient.stop();//stop streaming & preview
        */
    }
    @Override
    protected void onDestroy() {
        resClient.destroy();
        super.onDestroy();
    }

About

camera preivew using nv21. mediacodec using COLOR_FormatYUV420SemiPlanar or COLOR_FormatYUV420Planar

librestreaming's People

Contributors

lakeinchina avatar

Stargazers

 avatar

Watchers

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