Need help with XCVideoCompressor?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

jczmdeveloper
128 Stars 44 Forks 5 Commits 10 Opened issues

Description

A Video compressor which use ffmpeg lib for Android App- Android 视频压缩器

Services available

!
?

Need anything else?

Contributors list

# 542,599
5 commits

XCVideoCompressor

A Video compressor which uses ffmpeg lib for Android App- Android 视频压缩器

The Example for Use:

    String sdcardDir = Environment.getExternalStorageDirectory().getAbsolutePath();

String mInputStr = sdcardDir+"/DCIM/Camera/21s.mp4";
mStrResult = "Compress begin=========\n";
mResult.setText(mStrResult);
VideoCompressor.compress(this, mInputStr, new VideoCompressListener() {
    @Override
    public void onSuccess(final String outputFile, String filename, long duration) {
        Worker.postMain(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(mContext,"video compress success:"+outputFile,Toast.LENGTH_SHORT).show();
                SGLog.e("video compress success:"+outputFile);
                mStrResult +="Compress end=========onSuccess\n";
                mResult.setText(mStrResult);
                mScrollView.fullScroll(View.FOCUS_DOWN);

            }
        });
    }

    @Override
    public void onFail(final String reason) {
        Worker.postMain(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(mContext,"video compress failed:"+reason,Toast.LENGTH_SHORT).show();
                SGLog.e("video compress failed:"+reason);
                mStrResult+="Compress end=========onFail\n";
                mResult.setText(mStrResult);
                mScrollView.fullScroll(View.FOCUS_DOWN);
            }
        });
    }

    @Override
    public void onProgress(final int progress) {
        Worker.postMain(new Runnable() {
            @Override
            public void run() {
                SGLog.e("video compress progress:"+progress);
                mStrResult += "Compress progress:"+progress +"%\n";
                mResult.setText(mStrResult);
                mScrollView.fullScroll(View.FOCUS_DOWN);

            }
        });
    }
});

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.