我想在上传时使用h.265视频编解码器转换mp4视频,但我不知道如何转换。
我正在使用Axios连接到cloudinary,这是我的代码(它可以工作,但我不知道如何实现编解码器)。
//upload video
var formData2 = new FormData();
formData2.append('file', fileVideo);
formData2.append('upload_preset', CLOUDINARY_UPLOAD_PRESETS);
//formData2.append('format','png');
axios({
url: CLOUDINARY_URL,
method: 'POST',
headers:{
'Content-Type': 'application/x-www-form-urlencoded',
},
data: formData2
}).then(function(res){
console.log("video");
console.log(res.data);
//https://res.cloudinary.com/marvinq/video/upload/vc_h265/baea9vumoxllkwjx51uy.mp4"
VIDEO_LINK = "https://res.cloudinary.com/jamesbond/video/upload/"+res.data.public_id+".mp4";
}).catch(function(err){
console.log(err);
});
发布于 2019-02-18 16:14:35
您可以将转换直接添加到Cloudinary URL中。例如,将视频编解码器设置为h264,将配置文件设置为baseline,将级别设置为3.1 https://res.cloudinary.com/demo/video/upload/vc_h264:baseline:3.1/dog.mp4
https://stackoverflow.com/questions/54739551
复制相似问题