Skip to main content

Upload transformations wont work, file still get saved as the original file type.

Comments

5 comments

  • Marissa Masangcay

    Hi,

    In this situation you would want to actually just set the format outside of the transformation parameter so you would just need to do something like so:

    const pathToFile = '/tempFiles/filename.mp4';
    const options = {
    resource_type: 'video',
    format: 'webm'
    };

    cloudinary.v2.uploader.upload(pathToFile, options, (error, result) => {
        console.log(error, result);
    });


    Hope this helps!

    0
  • designboardzDev

    @maria i've tried that to no avail.

    0
  • Marissa Masangcay

    Hi,

    I took a look at your logs and I do see that some videos were successfully uploaded with the width and height parameters passed in. However, I was not able to see any format parameter passed in with the upload. Can you share your full code so that I can take a look at it?

    Please also feel free to open a support ticket with us directly at https://support.cloudinary.com/hc/en-us/requests/new if privacy is a concern.

    Thanks.

    0
  • designboardzDev

    Hey marrisa - me again

     

    So i am trying something similar to the above only this time i want to create a thumbnail image of the video  it wont work. however when i upload the video in normal way and set eager transformation - the transformation works perfectly fine.

     

    Here is a code example:

    url = 'https://res.cloudinary.com/designboardzdev/video/upload/v1547518241/5c38fbd7ccef881ecc4032b9/5c3cbc8a5a69877ad895dc96/5c3d4120d3463daeb28cd3b4.mp4';
    let cloudOptions = {
        resource_type: 'video',

        //format: 'png', tried with / without.
        transformation: {

          format: 'png',
          width: 250,
          height: 250,
          crop: 'fill'

          start_offset: '1'    

        }
    };

    cloudinary.v2.uploader.upload(url, cloudOptions , (error, result) => {

    console.log('result', result);

    });

    0
  • Marissa Masangcay

    Hi,

    In this situation you would need to generate the transformation eagerly as we treat the thumbnails generated from videos as derivatives.

    However, as stated in our documentation you can use the following method (shown in node):

    cloudinary.image("dog.jpg", {start_offset: "8.5", resource_type: "video"})

    And this will output the following image tag that you can embed in your site as a thumbnail:

     <img src='http://res.cloudinary.com/marissa/video/upload/so_8.5/dog.jpg' />

    Hope this helps!

    0

Post is closed for comments.