Upload transformations wont work, file still get saved as the original file type.
I am using your node JS library.
I upload a video with a transformation to convert it to 'webm', however the uploaded file still stay the original type.
I am following:
Here is what i do:
const pathToFile = '/tempFiles/filename.mp4';
const options = {
transformation: {
format: 'webm',
}
};
cloudinary.v2.uploader.upload(pathToFile, options, (error, result) => {
console.log(error, result);
});
I expect the uploaded file to be: filename.webm but it stays the same.
I've also tried to reduce the height / width to see if the file changes at all - nada.
-
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 -
@maria i've tried that to no avail.
0 -
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 -
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 -
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.
Comments
5 comments