美文网首页
React native 视频压缩

React native 视频压缩

作者: 海利昂 | 来源:发表于2019-02-26 10:34 被阅读0次

压缩 视频使用  工具 

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)

})

相关文章

网友评论

      本文标题:React native 视频压缩

      本文链接:https://www.haomeiwen.com/subject/cbgoyqtx.html