Mp4Composer-android-一个简单的mp4加工工具.zip
利用Android MediaCodec API 来加工mp4视频, 可实现滤镜、旋转、缩放Sample VideoNo filterGlGlayScaleFilterapplyGlMonochromeFilterapplyGlWatermarkFilterapplyGradle dependencies { // jCenter implementation 'com.daasuu:Mp4Composer-android:0.1.1' }Usage new Mp4Composer(srcMp4Path, destMp4Path) .rotation(Rotation.ROTATION_90) .size((width) 540, (height) 960) .fillMode(FillMode.PRESERVE_ASPECT_FIT) .filter(new GlSepiaFilter()) .listener(new Mp4Composer.Listener() { @Override public void onProgress(double progress) { Log.d(TAG, "onProgress = " progress); } @Override public void onCompleted() { Log.d(TAG, "onCompleted()"); runOnUiThread(() -> { Toast.makeText(context, "codec complete path =" destPath, Toast.LENGTH_SHORT).show(); }); } @Override public void onCanceled() { Log.d(TAG, "onCanceled"); } @Override public void onFailed(Exception exception) { Log.e(TAG, "onFailed()", exception); } }) .start();Builder MethodmethoddescriptionrotationRotation of the movie, default Rotation.NORMALsizeResolution of the movie, default same resolution of src moviefillModeOptions for scaling the bounds of an movie. PRESERVE_ASPECT_FIT is fit center. PRESERVE_ASPECT_CROP is center crop , default PRESERVE_ASPECT_FITfilterThis filter is OpenGL Shaders to apply effects on video. Custom filters can be created by inheriting GlFilter.java. , default GlFilter(No filter)videoBitrateSet Video Bitrate, default video bitrate is 0.25 * 30 * outputWidth * outputHeight
- 1
- 2
- 粉丝: 372
- 资源: 2万+
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助