【问题标题】:Cloudinary Axios TransformationCloudinary Axios 转换
【发布时间】:2019-07-11 09:08:38
【问题描述】:

我想在上传时使用 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);
  });

【问题讨论】:

    标签: javascript axios cloudinary


    【解决方案1】:

    您可以将转换直接添加到 Cloudinary URL。例如,这是将视频编解码器设置为 h264,将配置文件设置为基线,将级别设置为 3.1 https://res.cloudinary.com/demo/video/upload/vc_h264:baseline:3.1/dog.mp4

    【讨论】:

    • 是的。我知道。但这会消耗我每次下载的转换计划。所以我更喜欢在上传时对其进行一次转换。
    猜你喜欢
    • 2019-10-16
    • 2021-12-30
    • 2019-07-17
    • 2020-07-25
    • 2021-05-06
    • 2020-03-02
    • 1970-01-01
    • 2017-09-25
    • 2014-11-24
    相关资源
    最近更新 更多