How to specify maximum duration in an incoming transformation
I'm adding an incoming transformation in my unsigned upload preset to set a maximum duration of 9 sec per video whenever a video is uploaded client-side. So, if user uploads a video>9 sec, the video duration would be cut to 9 sec.
I'm using the conditional field in the incoming transformation section to set this up:
However, once this condition is added I get a 400 error when a video is uploaded (if I remove this condition everything works fine)
How could I specify this transformation correctly?
The error is because duration can’t be used in an if/else condition. https://cloudinary.com/documentation/conditional_transformations
In this case, you don't need the conditional anyway, because du_9 will return a max of 9 seconds, but shorter videos will stay the same length.
I hope that helps!0