Coder Social home page Coder Social logo

small-video-record's Introduction

small-video-record

利用FFmpeg视频录制与压缩处理,这里得感谢vitamio家的秒拍SO库,也感谢提出问题的朋友们!

###效果如下: sample ###特点: #####1:利用FFmpeg录制各种分辨率的视频。 #####2:可设置以H264编码压缩,6秒的1M视频压缩后为200多KB,且视频还比较清晰 #####3:录制简单,一行代码完成集成。 ###使用方法: ######1:添加依赖

compile 'com.mabeijianxi:small-video-record:1.0.7'

######2:在manifests里面添加

 <activity android:name="mabeijianxi.camera.MediaRecorderActivity"/>

######3:在Application里面初始化小视频录制:

public static void initSmallVideo(Context context) {
        // 设置拍摄视频缓存路径
        File dcim = Environment
                .getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);
        if (DeviceUtils.isZte()) {
            if (dcim.exists()) {
                VCamera.setVideoCachePath(dcim + "/mabeijianxi/");
            } else {
                VCamera.setVideoCachePath(dcim.getPath().replace("/sdcard/",
                        "/sdcard-ext/")
                        + "/mabeijianxi/");
            }
        } else {
            VCamera.setVideoCachePath(dcim + "/mabeijianxi/");
        }
        VCamera.setDebugMode(true);
        VCamera.initialize(context);
    }

######4:跳转录制界面:

MediaRecorderConfig config = new MediaRecorderConfig.Buidler()
                .doH264Compress(true)
                .smallVideoWidth(480)
                .smallVideoHeight(360)
                .recordTimeMax(6 * 1000)
                .maxFrameRate(20)
                .minFrameRate(8)
                .captureThumbnailsTime(1)
                .recordTimeMin((int) (1.5 * 1000))
                .build();
        MediaRecorderActivity.goSmallVideoRecorder(this, SendSmallVideoActivity.class.getName(), config);

######更新日志: 2016-10-26: 提交1.0.7,增强兼容性,防止录制尺寸不支持奔溃

2016-10-14:
提交1.0.6,修复在不支持的尺寸下无异常抛出。

2016-10-13:
提交小视频1.0.5,修复部分手机录制变形问题。

2016-10-12:
修复sample参数小bug。

2016-08-26:
提交小视频1.0.2,增加Buidler配置,可自定义更多内容。

2016-08-26:
提交小视频1.0.1,更新配置文件。

2016-08-25:
提交小视频1.0.0

###sample下载: sample Download Demo

small-video-record's People

Contributors

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