iphone10,compressVideo,压缩屏幕录制的视频,出现了编码参数不支持
如果是正常拍摄的视频,压缩不会出现这个问题
demo地址:https://yexu.tech/demo/testWxCompressVideo.zip
demo是uniApp开发,记得修改manifest.json的appid
具体代码如下
wx.chooseVideo({
sourceType: [“album”, “camera”],
compressed: true,//这里true和false,都试过了,结果是一样的
camera: “back”,
success(res) {
console.log(res);
let { tempFilePath, size } = res;
console.log("compressSize = ", size / 1024 / 1024 + “Mb”); //2735326
that.compressSize = size / 1024 / 1024 + “Mb”;
that.compressVideoUrl = tempFilePath;
wx.compressVideo({
src: tempFilePath,
quality: “medium”,
success: (highRes) => {
console.log("highRes = ", highRes);
},
fail: (failRes) => {
console.log("failRes = ", failRes);
},
});
},
});