React native 视频压缩

压缩 视频使用  工具 

react-native-video-processing

不改变清晰度的前提下 可以压缩到 原来视频大小的 十分之一

很强大 实现原理主要是抽针,缩小视频

地址 GitHub - shahen94/react-native-video-processing: Native Video editing/trimming/compressing library for React-Native

安装方法 稍微复杂 需要安装 GPUImage 库

import {ProcessingManager}from 'react-native-video-processing';

ProcessingManager.compress(videoPath,options).then((data)=> {

// 视频压缩一下

// console.warn(data)

    toast.modalLoadingHide();

this.props.onSend && this.props.onSend({

video: {

width: width,

height: height,

thumb: result.path,

path: data,

}

})

}).catch(e => {

console.log(e)

})

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容