Video effects and enhancements

Cloudinary's visual effects and enhancements are a great way to easily change the way your videos look and play within your site or application. For example, you can change the shape of your videos, blur them, apply quality improvements, make color adjustments, change the speed of playback, loop the video or add a progressbar and much more. You can also apply multiple effects to a video by applying each effect as a separate chained transformation.

Some transformations use fairly simple syntax, whereas others require more explanation - examples of these types of transformations are shown in the advanced syntax examples.

Besides the examples on this page, there are many more effects available and you can find a full list of them, including examples, by checking out our URL transformation reference.

Here are some examples of different effects and enhancements used on the same video:

Add progress indicator
e_progressbar
Reverse the video
e_reverse
Add visual noise
e_noise:100

Simple syntax examples

Here are some examples of effects and enhancements that use a simple transformation syntax. Click the links to see the full syntax for each transformation in the URL transformation reference.

Background color

Use the background parameter (b in URLs) to set the color in the case of padding added with the "pad" crop mode. The color can be set as an RGB hex triplet (e.g. b_rgb:3e2222), a 3 character RGB hex (e.g. b_rgb:777) or a named color (e.g. b_green). Cloudinary's client libraries also support a # shortcut for RGB (e.g. setting background to #3e2222 which is then translated to b_rgb:3e2222). In this example, the video is padded to a width and height of 200 pixels with a green background:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :background=>"green", :height=>200, :width=>200, :crop=>"pad")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->resize(Resize::pad()->width(200)
->height(200)
  ->background(
  Background::color(Color::GREEN))
  );
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("background"=>"green", "height"=>200, "width"=>200, "crop"=>"pad"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(background="green", height=200, width=200, crop="pad")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {background: "green", height: 200, width: 200, crop: "pad"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().background("green").height(200).width(200).crop("pad")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("dog.mp4").resize(
  pad()
    .width(200)
    .height(200)
    .background(color("green"))
);
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {background: "green", height: 200, width: 200, crop: "pad"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {background: "green", height: 200, width: 200, crop: "pad"})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").resize(
  pad()
    .width(200)
    .height(200)
    .background(color("green"))
);
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation background="green" height="200" width="200" crop="pad" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation background="green" height="200" width="200" crop="pad" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").resize(
  pad()
    .width(200)
    .height(200)
    .background(color("green"))
);
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation background="green" height="200" width="200" crop="pad">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Background("green").Height(200).Width(200).Crop("pad")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setBackground("green").setHeight(200).setWidth(200).setCrop("pad")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().background("green").height(200).width(200).crop("pad")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("dog.mp4")
   resize(Resize.pad() { width(200)
 height(200)
   background(
  Background.color(Color.GREEN))
   }) 
}.generate()

See full syntax: b (background) in the Transformation Reference.

Blur

Use the blur video effect to add a level of blurriness to a video. You can control the strength of the blur with a parameter (range: 1 to 2000). When working with video overlays, you can also add the blur to the container or to the overlay.

For example, the container video plays a blurred version of the video, while a smaller overlay plays the video clearly:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :transformation=>[
  {:effect=>"blur:500"},
  {:overlay=>"video:dog"},
  {:width=>600, :crop=>"scale"},
  {:flags=>"layer_apply"},
  {:width=>500, :crop=>"scale"}
  ])
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->effect(Effect::blur()->strength(500))
  ->overlay(Overlay::source(
  Source::video("dog")
  ->transformation((new Transformation())
  ->resize(Resize::scale()->width(600)))
  ))
  ->resize(Resize::scale()->width(500));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("transformation"=>array(
  array("effect"=>"blur:500"),
  array("overlay"=>"video:dog"),
  array("width"=>600, "crop"=>"scale"),
  array("flags"=>"layer_apply"),
  array("width"=>500, "crop"=>"scale")
  )))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(transformation=[
  {'effect': "blur:500"},
  {'overlay': "video:dog"},
  {'width': 600, 'crop': "scale"},
  {'flags': "layer_apply"},
  {'width': 500, 'crop': "scale"}
  ])
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {transformation: [
  {effect: "blur:500"},
  {overlay: "video:dog"},
  {width: 600, crop: "scale"},
  {flags: "layer_apply"},
  {width: 500, crop: "scale"}
  ]})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation()
  .effect("blur:500").chain()
  .overlay(new Layer().publicId("video:dog")).chain()
  .width(600).crop("scale").chain()
  .flags("layer_apply").chain()
  .width(500).crop("scale")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("dog.mp4")
  .effect(blur().strength(500))
  .overlay(
    source(
      video("dog").transformation(
        new Transformation().resize(scale().width(600))
      )
    )
  )
  .resize(scale().width(500));
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {transformation: [
  {effect: "blur:500"},
  {overlay: new cloudinary.Layer().publicId("video:dog")},
  {width: 600, crop: "scale"},
  {flags: "layer_apply"},
  {width: 500, crop: "scale"}
  ]}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {transformation: [
  {effect: "blur:500"},
  {overlay: new cloudinary.Layer().publicId("video:dog")},
  {width: 600, crop: "scale"},
  {flags: "layer_apply"},
  {width: 500, crop: "scale"}
  ]})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4")
  .effect(blur().strength(500))
  .overlay(
    source(
      video("dog").transformation(
        new Transformation().resize(scale().width(600))
      )
    )
  )
  .resize(scale().width(500));
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation effect="blur:500" />
  <Transformation overlay="video:dog" />
  <Transformation width="600" crop="scale" />
  <Transformation flags="layer_apply" />
  <Transformation width="500" crop="scale" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation effect="blur:500" />
  <cld-transformation :overlay="video:dog" />
  <cld-transformation width="600" crop="scale" />
  <cld-transformation flags="layer_apply" />
  <cld-transformation width="500" crop="scale" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4")
  .effect(blur().strength(500))
  .overlay(
    source(
      video("dog").transformation(
        new Transformation().resize(scale().width(600))
      )
    )
  )
  .resize(scale().width(500));
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation effect="blur:500">
  </cl-transformation>
  <cl-transformation overlay="video:dog">
  </cl-transformation>
  <cl-transformation width="600" crop="scale">
  </cl-transformation>
  <cl-transformation flags="layer_apply">
  </cl-transformation>
  <cl-transformation width="500" crop="scale">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Effect("blur:500").Chain()
  .Overlay(new Layer().PublicId("video:dog")).Chain()
  .Width(600).Crop("scale").Chain()
  .Flags("layer_apply").Chain()
  .Width(500).Crop("scale")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setEffect("blur:500").chain()
  .setOverlay("video:dog").chain()
  .setWidth(600).setCrop("scale").chain()
  .setFlags("layer_apply").chain()
  .setWidth(500).setCrop("scale")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
  .effect("blur:500").chain()
  .overlay(new Layer().publicId("video:dog")).chain()
  .width(600).crop("scale").chain()
  .flags("layer_apply").chain()
  .width(500).crop("scale")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("dog.mp4")
   effect(Effect.blur() { strength(500) })
   overlay(Overlay.source(
  Source.video("dog") {
   transformation(Transformation {
   resize(Resize.scale() { width(600) }) })
   }))
   resize(Resize.scale() { width(500) }) 
}.generate()

See full syntax: e_blur in the Transformation Reference.

Tip
There's also an option to use a blurred version of your video in the background when the video's aspect ratio is different than the video player dimensions you specify. To do this, use the pad cropping option and set the background value to blurred. For details, see pad with blurred video background

Deshake

The deshake video effect applies a filter that attempts to fix small changes in horizontal and vertical motion shift. This filter helps remove camera shake from hand-holding a camera, bumping a tripod, moving on a vehicle, etc. A value between 0-64 can also be specified that determines the maximum extent of movement in the horizontal and/or vertical direction in pixels, with the default set to 16 pixels. In this example the deshake effect is applied to the video with a maximum motion shift of 32 pixels:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :effect=>"deshake:32")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->effect(Effect::deshake()
  ->shakeStrength(
  ShakeStrength::pixels32())
  );
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("effect"=>"deshake:32"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(effect="deshake:32")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {effect: "deshake:32"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().effect("deshake:32")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("dog.mp4").effect(deshake().shakeStrength(pixels32()));
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {effect: "deshake:32"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {effect: "deshake:32"})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").effect(deshake().shakeStrength(pixels32()));
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation effect="deshake:32" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation effect="deshake:32" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").effect(deshake().shakeStrength(pixels32()));
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation effect="deshake:32">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Effect("deshake:32")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setEffect("deshake:32")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().effect("deshake:32")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("dog.mp4")
   effect(Effect.deshake() {
   shakeStrength(
  ShakeStrength.pixels32())
   }) 
}.generate()

See full syntax: e_deshake in the Transformation Reference.

Fade in/out

Use the fade video effect to either fade in at the beginning of a video or fade out at the end. The effect accepts a parameter that determines the duration of the fade effect in milliseconds, with a positive value for fading in at the beginning of the video, and a negative value for fading out at the end of the video. In this example the fade effect is applied first at the beginning of the video over 2 seconds and then at the end of the video over 4 seconds:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :transformation=>[
  {:effect=>"fade:2000"},
  {:effect=>"fade:-4000"}
  ])
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->effect(Effect::fadeIn()->duration(2000))
  ->effect(Effect::fadeOut()->duration(4000));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("transformation"=>array(
  array("effect"=>"fade:2000"),
  array("effect"=>"fade:-4000")
  )))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(transformation=[
  {'effect': "fade:2000"},
  {'effect': "fade:-4000"}
  ])
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {transformation: [
  {effect: "fade:2000"},
  {effect: "fade:-4000"}
  ]})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation()
  .effect("fade:2000").chain()
  .effect("fade:-4000")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("dog.mp4")
  .effect(fadeIn().duration(2000))
  .effect(fadeOut().duration(4000));
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {transformation: [
  {effect: "fade:2000"},
  {effect: "fade:-4000"}
  ]}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {transformation: [
  {effect: "fade:2000"},
  {effect: "fade:-4000"}
  ]})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4")
  .effect(fadeIn().duration(2000))
  .effect(fadeOut().duration(4000));
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation effect="fade:2000" />
  <Transformation effect="fade:-4000" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation effect="fade:2000" />
  <cld-transformation effect="fade:-4000" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4")
  .effect(fadeIn().duration(2000))
  .effect(fadeOut().duration(4000));
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation effect="fade:2000">
  </cl-transformation>
  <cl-transformation effect="fade:-4000">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Effect("fade:2000").Chain()
  .Effect("fade:-4000")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setEffect("fade:2000").chain()
  .setEffect("fade:-4000")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
  .effect("fade:2000").chain()
  .effect("fade:-4000")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
// This code example is not currently available.

The fade effect is also useful for fading in and out of video overlays. For example, adding an overlay of kitten_fighting scaled to a width of 100 pixels to the mp4 video named dog, that fades in over 3 seconds:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :transformation=>[
  {:overlay=>"video:kitten_fighting"},
  {:width=>100, :crop=>"scale"},
  {:effect=>"fade:3000"},
  {:flags=>"layer_apply"}
  ])
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->overlay(Overlay::source(
  Source::video("kitten_fighting")
  ->transformation((new Transformation())
  ->resize(Resize::scale()->width(100))
  ->effect(Effect::fadeIn()->duration(3000)))
  ));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("transformation"=>array(
  array("overlay"=>"video:kitten_fighting"),
  array("width"=>100, "crop"=>"scale"),
  array("effect"=>"fade:3000"),
  array("flags"=>"layer_apply")
  )))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(transformation=[
  {'overlay': "video:kitten_fighting"},
  {'width': 100, 'crop': "scale"},
  {'effect': "fade:3000"},
  {'flags': "layer_apply"}
  ])
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {transformation: [
  {overlay: "video:kitten_fighting"},
  {width: 100, crop: "scale"},
  {effect: "fade:3000"},
  {flags: "layer_apply"}
  ]})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation()
  .overlay(new Layer().publicId("video:kitten_fighting")).chain()
  .width(100).crop("scale").chain()
  .effect("fade:3000").chain()
  .flags("layer_apply")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("dog.mp4").overlay(
  source(
    video("kitten_fighting").transformation(
      new Transformation()
        .resize(scale().width(100))
        .effect(fadeIn().duration(3000))
    )
  )
);
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {transformation: [
  {overlay: new cloudinary.Layer().publicId("video:kitten_fighting")},
  {width: 100, crop: "scale"},
  {effect: "fade:3000"},
  {flags: "layer_apply"}
  ]}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {transformation: [
  {overlay: new cloudinary.Layer().publicId("video:kitten_fighting")},
  {width: 100, crop: "scale"},
  {effect: "fade:3000"},
  {flags: "layer_apply"}
  ]})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").overlay(
  source(
    video("kitten_fighting").transformation(
      new Transformation()
        .resize(scale().width(100))
        .effect(fadeIn().duration(3000))
    )
  )
);
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation overlay="video:kitten_fighting" />
  <Transformation width="100" crop="scale" />
  <Transformation effect="fade:3000" />
  <Transformation flags="layer_apply" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation :overlay="video:kitten_fighting" />
  <cld-transformation width="100" crop="scale" />
  <cld-transformation effect="fade:3000" />
  <cld-transformation flags="layer_apply" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").overlay(
  source(
    video("kitten_fighting").transformation(
      new Transformation()
        .resize(scale().width(100))
        .effect(fadeIn().duration(3000))
    )
  )
);
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation overlay="video:kitten_fighting">
  </cl-transformation>
  <cl-transformation width="100" crop="scale">
  </cl-transformation>
  <cl-transformation effect="fade:3000">
  </cl-transformation>
  <cl-transformation flags="layer_apply">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Overlay(new Layer().PublicId("video:kitten_fighting")).Chain()
  .Width(100).Crop("scale").Chain()
  .Effect("fade:3000").Chain()
  .Flags("layer_apply")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setOverlay("video:kitten_fighting").chain()
  .setWidth(100).setCrop("scale").chain()
  .setEffect("fade:3000").chain()
  .setFlags("layer_apply")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
  .overlay(new Layer().publicId("video:kitten_fighting")).chain()
  .width(100).crop("scale").chain()
  .effect("fade:3000").chain()
  .flags("layer_apply")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
// This code example is not currently available.

Loop

Use the loop effect to deliver a video that loops a specified number of times. The loop parameter value indicates the number of times the video repeats (after the initial run).

Note
This parameter differs from the loop attribute of the HTML5 tag, which instructs the video player to play the delivered video in an infinite loop.

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("ski_jump", :effect=>"loop:2")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('ski_jump.mp4'))
  ->effect(Effect::loop()->additionalIterations(2));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("ski_jump", array("effect"=>"loop:2"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("ski_jump").video(effect="loop:2")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("ski_jump", {effect: "loop:2"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().effect("loop:2")).videoTag("ski_jump");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("ski_jump.mp4").effect(loop().additionalIterations(2));
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('ski_jump', {effect: "loop:2"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("ski_jump", {effect: "loop:2"})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("ski_jump.mp4").effect(loop().additionalIterations(2));
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="ski_jump" >
  <Transformation effect="loop:2" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="ski_jump" >
  <cld-transformation effect="loop:2" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("ski_jump.mp4").effect(loop().additionalIterations(2));
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="ski_jump" >
  <cl-transformation effect="loop:2">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Effect("loop:2")).BuildVideoTag("ski_jump")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setEffect("loop:2")).generate("ski_jump.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().effect("loop:2")).resourceType("video").generate("ski_jump.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("ski_jump.mp4")
   effect(Effect.loop() { additionalIterations(2) }) 
}.generate()

Tip
You can also use the loop parameter when you convert a video to an animated GIF so that it will run infinitely (or a specified number of times). For details, see Delivering animated GIFs.

See full syntax: e_loop in the Transformation Reference.

Playback speed

Use the accelerate video effect to either speed up or slow down the video playback speed. The effect accepts an integer value between -50 and 100 that determines how to change the playback speed (in percent), with a positive value for speeding up the video, and a negative value for slowing down the video. In this example, the video is accelerated by 100% (twice normal speed):

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :effect=>"accelerate:100")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->effect(Effect::accelerate()->rate(100));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("effect"=>"accelerate:100"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(effect="accelerate:100")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {effect: "accelerate:100"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().effect("accelerate:100")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("dog.mp4").effect(accelerate().rate(100));
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {effect: "accelerate:100"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {effect: "accelerate:100"})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").effect(accelerate().rate(100));
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation effect="accelerate:100" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation effect="accelerate:100" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").effect(accelerate().rate(100));
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation effect="accelerate:100">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Effect("accelerate:100")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setEffect("accelerate:100")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().effect("accelerate:100")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("dog.mp4")
   effect(Effect.accelerate() { rate(100) }) 
}.generate()

See full syntax: e_accelerate in the Transformation Reference.

Reverse

Use the reverse effect to play a video or audio file backwards.

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("pencil_sketch", :effect=>"reverse")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('pencil_sketch.mp4'))
  ->effect(Effect::reverse());
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("pencil_sketch", array("effect"=>"reverse"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("pencil_sketch").video(effect="reverse")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("pencil_sketch", {effect: "reverse"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().effect("reverse")).videoTag("pencil_sketch");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("pencil_sketch.mp4").effect(reverse());
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('pencil_sketch', {effect: "reverse"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("pencil_sketch", {effect: "reverse"})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("pencil_sketch.mp4").effect(reverse());
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="pencil_sketch" >
  <Transformation effect="reverse" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="pencil_sketch" >
  <cld-transformation effect="reverse" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("pencil_sketch.mp4").effect(reverse());
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="pencil_sketch" >
  <cl-transformation effect="reverse">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Effect("reverse")).BuildVideoTag("pencil_sketch")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setEffect("reverse")).generate("pencil_sketch.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().effect("reverse")).resourceType("video").generate("pencil_sketch.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("pencil_sketch.mp4")
   effect(Effect.reverse()) 
}.generate()

See full syntax: e_reverse in the Transformation Reference.

Vignette

Fade the edges of videos into the background using the vignette effect.

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :effect=>"vignette")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->effect(Effect::vignette());
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("effect"=>"vignette"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(effect="vignette")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {effect: "vignette"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().effect("vignette")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("dog.mp4").effect(vignette());
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {effect: "vignette"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {effect: "vignette"})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").effect(vignette());
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation effect="vignette" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation effect="vignette" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").effect(vignette());
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation effect="vignette">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Effect("vignette")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setEffect("vignette")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().effect("vignette")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("dog.mp4")
   effect(Effect.vignette()) 
}.generate()

See full syntax: e_vignette in the Transformation Reference.

Visual noise

Use the noise video effect to add visual noise to a video. Noise is a random pattern superimposed on the video, visible as a random flicker of "dots" or "snow". The amount of noise added to the video is set by adding an integer value to the parameter, ranging from 0 (no noise) up to 100. In this example the noise effect is added to the video with a value of 50:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :effect=>"noise:50")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->effect(Effect::noise()->level(50));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("effect"=>"noise:50"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(effect="noise:50")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {effect: "noise:50"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().effect("noise:50")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("dog.mp4").effect(noise().level(50));
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {effect: "noise:50"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {effect: "noise:50"})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").effect(noise().level(50));
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation effect="noise:50" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation effect="noise:50" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").effect(noise().level(50));
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation effect="noise:50">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Effect("noise:50")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setEffect("noise:50")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().effect("noise:50")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("dog.mp4")
   effect(Effect.noise() { level(50) }) 
}.generate()

See full syntax: e_noise in the Transformation Reference.

Advanced syntax examples

In general, most of the effects and enhancements can take an additional option to tailor the effect to your liking. For some, however, you may need to provide additional syntax and use some more complex concepts. It is important to understand how these advanced transformations work when attempting to use them. The sections below outline some of the more advanced transformations and help you to use these with your own assets.

Remember, there are many more transformations available and you can find a full list of them, including examples, by checking out our URL transformation reference.

3D LUTs

3D lookup tables (3D LUTs) are used to map one color space to another. They can be used to adjust colors, contrast, and/or saturation, so that you can correct contrast of flat footage, fix a camera's inability to see a particular color shade, or give a final finished look or a particular style to your video.

After uploading a .3dl file to your account as a raw file, you can apply it to any video using the lut: property of the overlay parameter ( l_lut: in URLs), followed by the LUT public ID (including the .3dl extension).

Below you can see the dog.mp4 video file in it's original color, compared to the video with different LUT files applied.

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog")
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video()
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog")
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("dog.mp4");
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog').toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog")
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4");
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >

</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >

</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4");
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >

</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("dog.mp4") 
}.generate()

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :transformation=>[
  {:overlay=>"lut:iwltbap_aspen.3dl"},
  {:flags=>"layer_apply"}
  ])
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->adjust(Adjust::by3dLut("iwltbap_aspen.3dl"));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("transformation"=>array(
  array("overlay"=>"lut:iwltbap_aspen.3dl"),
  array("flags"=>"layer_apply")
  )))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(transformation=[
  {'overlay': "lut:iwltbap_aspen.3dl"},
  {'flags': "layer_apply"}
  ])
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {transformation: [
  {overlay: "lut:iwltbap_aspen.3dl"},
  {flags: "layer_apply"}
  ]})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation()
  .overlay(new Layer().publicId("lut:iwltbap_aspen.3dl")).chain()
  .flags("layer_apply")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("dog.mp4").adjust(by3dLut("iwltbap_aspen.3dl"));
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {transformation: [
  {overlay: new cloudinary.Layer().publicId("lut:iwltbap_aspen.3dl")},
  {flags: "layer_apply"}
  ]}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {transformation: [
  {overlay: new cloudinary.Layer().publicId("lut:iwltbap_aspen.3dl")},
  {flags: "layer_apply"}
  ]})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").adjust(by3dLut("iwltbap_aspen.3dl"));
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation overlay="lut:iwltbap_aspen.3dl" />
  <Transformation flags="layer_apply" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation :overlay="lut:iwltbap_aspen.3dl" />
  <cld-transformation flags="layer_apply" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").adjust(by3dLut("iwltbap_aspen.3dl"));
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation overlay="lut:iwltbap_aspen.3dl">
  </cl-transformation>
  <cl-transformation flags="layer_apply">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Overlay(new Layer().PublicId("lut:iwltbap_aspen.3dl")).Chain()
  .Flags("layer_apply")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setOverlay("lut:iwltbap_aspen.3dl").chain()
  .setFlags("layer_apply")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
  .overlay(new Layer().publicId("lut:iwltbap_aspen.3dl")).chain()
  .flags("layer_apply")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("dog.mp4")
   adjust(Adjust.by3dLut("iwltbap_aspen.3dl")) 
}.generate()

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :transformation=>[
  {:overlay=>"lut:iwltbap_sedona.3dl"},
  {:flags=>"layer_apply"}
  ])
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->adjust(Adjust::by3dLut("iwltbap_sedona.3dl"));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("transformation"=>array(
  array("overlay"=>"lut:iwltbap_sedona.3dl"),
  array("flags"=>"layer_apply")
  )))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(transformation=[
  {'overlay': "lut:iwltbap_sedona.3dl"},
  {'flags': "layer_apply"}
  ])
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {transformation: [
  {overlay: "lut:iwltbap_sedona.3dl"},
  {flags: "layer_apply"}
  ]})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation()
  .overlay(new Layer().publicId("lut:iwltbap_sedona.3dl")).chain()
  .flags("layer_apply")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("dog.mp4").adjust(by3dLut("iwltbap_sedona.3dl"));
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {transformation: [
  {overlay: new cloudinary.Layer().publicId("lut:iwltbap_sedona.3dl")},
  {flags: "layer_apply"}
  ]}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {transformation: [
  {overlay: new cloudinary.Layer().publicId("lut:iwltbap_sedona.3dl")},
  {flags: "layer_apply"}
  ]})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").adjust(by3dLut("iwltbap_sedona.3dl"));
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation overlay="lut:iwltbap_sedona.3dl" />
  <Transformation flags="layer_apply" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation :overlay="lut:iwltbap_sedona.3dl" />
  <cld-transformation flags="layer_apply" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").adjust(by3dLut("iwltbap_sedona.3dl"));
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation overlay="lut:iwltbap_sedona.3dl">
  </cl-transformation>
  <cl-transformation flags="layer_apply">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Overlay(new Layer().PublicId("lut:iwltbap_sedona.3dl")).Chain()
  .Flags("layer_apply")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setOverlay("lut:iwltbap_sedona.3dl").chain()
  .setFlags("layer_apply")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
  .overlay(new Layer().publicId("lut:iwltbap_sedona.3dl")).chain()
  .flags("layer_apply")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("dog.mp4")
   adjust(Adjust.by3dLut("iwltbap_sedona.3dl")) 
}.generate()

AI-based video preview

A video preview is a short excerpt from a video that can be used to engage your audience and help them select the video content that interests them.

The preview transformation effect (e_preview in URLs) generates video previews automatically by activating deep learning algorithms that identify the most interesting video segments. You can optionally control the length of the generated preview using the duration option (default: 5 seconds), and the number and duration of the video segments using the max_seg and min_seg_dur parameters. The three parameters are separated with a colon.

The default number of segments changes if you specify a longer duration, the table below shows the default values:

Preview duration Max segments Minimum segment duration
up to 5 seconds 1 = duration
6 to 10 seconds 3 3 seconds
11 to 15 seconds 4 3 seconds
16 to 20 seconds 5 4 seconds
21 seconds and greater 6 5 seconds

The following transformation generates a single 5 second preview of this video of elephants walking:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("elephants", :effect=>"preview:duration_5")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('elephants.mp4'))
  ->videoEdit(VideoEdit::preview()->duration(5.0));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("elephants", array("effect"=>"preview:duration_5"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("elephants").video(effect="preview:duration_5")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("elephants", {effect: "preview:duration_5"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().effect("preview:duration_5")).videoTag("elephants");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("elephants.mp4").videoEdit(preview().duration("5.0"));
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('elephants', {effect: "preview:duration_5"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("elephants", {effect: "preview:duration_5"})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("elephants.mp4").videoEdit(preview().duration("5.0"));
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="elephants" >
  <Transformation effect="preview:duration_5" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="elephants" >
  <cld-transformation effect="preview:duration_5" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("elephants.mp4").videoEdit(preview().duration("5.0"));
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="elephants" >
  <cl-transformation effect="preview:duration_5">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Effect("preview:duration_5")).BuildVideoTag("elephants")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setEffect("preview:duration_5")).generate("elephants.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().effect("preview:duration_5")).resourceType("video").generate("elephants.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("elephants.mp4")
   videoEdit(VideoEdit.preview() { duration(5.0F) }) 
}.generate()

The following transformation generates a 12 second preview with a maximum of 3 segments and a minimum segment duration of 3 seconds from this ImageCon lecture about responsive images by Jason Grigsby:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("imagecon_grigsby_intro", :effect=>"preview:duration_12:max_seg_3:min_seg_dur_3")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('imagecon_grigsby_intro.mp4'))
  ->videoEdit(VideoEdit::preview()->duration(12.0)
->maximumSegments(3)
->minimumSegmentDuration(3.0));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("imagecon_grigsby_intro", array("effect"=>"preview:duration_12:max_seg_3:min_seg_dur_3"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("imagecon_grigsby_intro").video(effect="preview:duration_12:max_seg_3:min_seg_dur_3")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("imagecon_grigsby_intro", {effect: "preview:duration_12:max_seg_3:min_seg_dur_3"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().effect("preview:duration_12:max_seg_3:min_seg_dur_3")).videoTag("imagecon_grigsby_intro");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("imagecon_grigsby_intro.mp4").videoEdit(
  preview().duration("12.0").maximumSegments(3).minimumSegmentDuration("3.0")
);
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('imagecon_grigsby_intro', {effect: "preview:duration_12:max_seg_3:min_seg_dur_3"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("imagecon_grigsby_intro", {effect: "preview:duration_12:max_seg_3:min_seg_dur_3"})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("imagecon_grigsby_intro.mp4").videoEdit(
  preview().duration("12.0").maximumSegments(3).minimumSegmentDuration("3.0")
);
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="imagecon_grigsby_intro" >
  <Transformation effect="preview:duration_12:max_seg_3:min_seg_dur_3" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="imagecon_grigsby_intro" >
  <cld-transformation effect="preview:duration_12:max_seg_3:min_seg_dur_3" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("imagecon_grigsby_intro.mp4").videoEdit(
  preview().duration("12.0").maximumSegments(3).minimumSegmentDuration("3.0")
);
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="imagecon_grigsby_intro" >
  <cl-transformation effect="preview:duration_12:max_seg_3:min_seg_dur_3">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Effect("preview:duration_12:max_seg_3:min_seg_dur_3")).BuildVideoTag("imagecon_grigsby_intro")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setEffect("preview:duration_12:max_seg_3:min_seg_dur_3")).generate("imagecon_grigsby_intro.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().effect("preview:duration_12:max_seg_3:min_seg_dur_3")).resourceType("video").generate("imagecon_grigsby_intro.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("imagecon_grigsby_intro.mp4")
   videoEdit(VideoEdit.preview() { duration(12.0F)
 maximumSegments(3)
 minimumSegmentDuration(3.0F) }) 
}.generate()

See full syntax: e_preview in the Transformation Reference.

Code explorer: Thumbnail previews and embedded video player

A common use-case for video previews is to display a selection of different videos as thumbnails, which display a short video preview on hover and open the full video in a video player on click.

The following code explorer demonstrates this use case where any clicked thumbnail plays in a <div> containing the Cloudinary Video Player. Click the index.html or script.js tabs to see the code behind this demo.

This code is also available in GitHub.

Tip
This demo does not address mobile browsers that do not support 'hover' functionality. If you want to offer hover previews to web users, it's recommended to capture the device and implement alternative functionality for mobile users. For example, you might add links for mobile users under each thumbnail for 'activate preview' and 'watch video'.

Return video importance histogram

As part of generating the preview, a video importance histogram is created. This histogram is a JSON representation of the importance score for each frame of the video. You can return this histogram and pass it to an external application or to pick out your own key parts of a video using the importance scores.

To return the histogram, use the fl_getinfo flag with e_preview and remove the file extension. Ensure that you don't include any other transformations. For example, to return the importance histogram for the ImageCon video we used above:

Video preview tips and guidelines

  • The preview algorithm analyzes the entire video to determine the ideal segment(s) to use, which means it can take several seconds or minutes, depending on the length of the original video, to generate your preview. Therefore, it's recommended to generate the preview effect transformation eagerly during upload or using an explicit method call for existing videos, along with an eager_notification_url parameter to notify your application when the video preview transformation is ready for delivery.

  • Due to the advanced analysis required, video preview generation is not supported as an incoming transformation.

  • As explained above, dynamic delivery of this transformation is not relevant in production. However, for experimentation purposes, you can add the e_preview parameter directly to a URL in your browser. In most cases, the immediate result will be a broken video (An HTTP 423 error will be returned). Refresh your browser after several seconds or minutes to see the result. Once the initial analysis has been completed, any subsequent transformations will happen on the fly as usual.

  • When generating video previews, keep in mind that the AI algorithm takes the requested preview duration into account when selecting the most relevant content. Therefore, when you set a different preview duration for the same video, different segments of your video may be selected.

  • As with any video, you can transcode your generated preview to an animated image (.gif or animated .webp) by changing the URL extension or using the format SDK parameter. Remember that animated images that were transcoded from video (and thus have a resource_type of video) only run a single time by default. If you want the animated image to loop, add a new component to your transformation chain with the loop effect. For example:

    Ruby (cloudinary 1.x):
    Copy to clipboard
    cl_image_tag("Marketing/digital-asset-management-with-cloudinary.gif", :resource_type=>"video", :transformation=>[
      {:effect=>"preview:duration_8.0"},
      {:height=>800, :width=>1600, :crop=>"crop"},
      {:effect=>"loop"}
      ])
    PHP (cloudinary_php 2.x):
    Copy to clipboard
    (new ImageTag('Marketing/digital-asset-management-with-cloudinary.gif'))
      ->videoEdit(VideoEdit::preview()->duration(8.0))
      ->resize(Resize::crop()->width(1600)
    ->height(800))
      ->animated(Animated::edit()->loop())
      ->assetType("video");
    PHP (cloudinary_php 1.x (legacy)):
    Copy to clipboard
    cl_image_tag("Marketing/digital-asset-management-with-cloudinary.gif", array("resource_type"=>"video", "transformation"=>array(
      array("effect"=>"preview:duration_8.0"),
      array("height"=>800, "width"=>1600, "crop"=>"crop"),
      array("effect"=>"loop")
      )))
    Python (cloudinary 1.x):
    Copy to clipboard
    CloudinaryVideo("Marketing/digital-asset-management-with-cloudinary.gif").image(transformation=[
      {'effect': "preview:duration_8.0"},
      {'height': 800, 'width': 1600, 'crop': "crop"},
      {'effect': "loop"}
      ])
    Node.js (cloudinary 1.x):
    Copy to clipboard
    cloudinary.image("Marketing/digital-asset-management-with-cloudinary.gif", {resource_type: "video", transformation: [
      {effect: "preview:duration_8.0"},
      {height: 800, width: 1600, crop: "crop"},
      {effect: "loop"}
      ]})
    Java (cloudinary 1.x):
    Copy to clipboard
    cloudinary.url().transformation(new Transformation()
      .effect("preview:duration_8.0").chain()
      .height(800).width(1600).crop("crop").chain()
      .effect("loop")).resourceType("video").imageTag("Marketing/digital-asset-management-with-cloudinary.gif");
    JS (@cloudinary/url-gen 1.x):
    Copy to clipboard
    new CloudinaryImage("Marketing/digital-asset-management-with-cloudinary.gif")
      .videoEdit(preview().duration("8.0"))
      .resize(crop().width(1600).height(800))
      .animated(edit().loop())
      .setAssetType("video");
    JS (cloudinary-core 2.x (legacy)):
    Copy to clipboard
    cloudinary.videoTag('Marketing/digital-asset-management-with-cloudinary.gif', {transformation: [
      {effect: "preview:duration_8.0"},
      {height: 800, width: 1600, crop: "crop"},
      {effect: "loop"}
      ]}).toHtml();
    jQuery (cloudinary-jquery 2.x):
    Copy to clipboard
    $.cloudinary.image("Marketing/digital-asset-management-with-cloudinary.gif", {resource_type: "video", transformation: [
      {effect: "preview:duration_8.0"},
      {height: 800, width: 1600, crop: "crop"},
      {effect: "loop"}
      ]})
    React (@cloudinary/react 1.x):
    Copy to clipboard
    //React SDK transformations are created using @cloudinary/url-gen.
    new CloudinaryImage("Marketing/digital-asset-management-with-cloudinary.gif")
      .videoEdit(preview().duration("8.0"))
      .resize(crop().width(1600).height(800))
      .animated(edit().loop())
      .setAssetType("video");
    React (cloudinary-react 1.x):
    Copy to clipboard
    <Video publicId="Marketing/digital-asset-management-with-cloudinary.gif" resourceType="video">
      <Transformation effect="preview:duration_8.0" />
      <Transformation height="800" width="1600" crop="crop" />
      <Transformation effect="loop" />
    </Video>
    Vue.js (cloudinary-vue 1.x):
    Copy to clipboard
    <cld-video public-id="Marketing/digital-asset-management-with-cloudinary.gif" resource-type="video">
      <cld-transformation effect="preview:duration_8.0" />
      <cld-transformation height="800" width="1600" crop="crop" />
      <cld-transformation effect="loop" />
    </cld-video>
    Angular (@cloudinary/ng 1.x):
    Copy to clipboard
    //Angular SDK transformations are created using @cloudinary/url-gen.
    new CloudinaryImage("Marketing/digital-asset-management-with-cloudinary.gif")
      .videoEdit(preview().duration("8.0"))
      .resize(crop().width(1600).height(800))
      .animated(edit().loop())
      .setAssetType("video");
    Angular (@cloudinary/angular-5.x 1.x (legacy)):
    Copy to clipboard
    <cl-video public-id="Marketing/digital-asset-management-with-cloudinary.gif" resource-type="video">
      <cl-transformation effect="preview:duration_8.0">
      </cl-transformation>
      <cl-transformation height="800" width="1600" crop="crop">
      </cl-transformation>
      <cl-transformation effect="loop">
      </cl-transformation>
    </cl-video>
    .NET (CloudinaryDotNet 1.x):
    Copy to clipboard
    cloudinary.Api.UrlVideoUp.Transform(new Transformation()
      .Effect("preview:duration_8.0").Chain()
      .Height(800).Width(1600).Crop("crop").Chain()
      .Effect("loop")).BuildImageTag("Marketing/digital-asset-management-with-cloudinary.gif")
    iOS (cloudinary 3.x):
    Copy to clipboard
    cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
      .setEffect("preview:duration_8.0").chain()
      .setHeight(800).setWidth(1600).setCrop("crop").chain()
      .setEffect("loop")).generate("Marketing/digital-asset-management-with-cloudinary.gif")
    Android (cloudinary-android 1.x):
    Copy to clipboard
    MediaManager.get().url().transformation(new Transformation()
      .effect("preview:duration_8.0").chain()
      .height(800).width(1600).crop("crop").chain()
      .effect("loop")).resourceType("video").generate("Marketing/digital-asset-management-with-cloudinary.gif");
    Kotlin (kotlin-url-gen 1.x):
    Copy to clipboard
    // This code example is not currently available.
    Animated GIF preview

Boomerang

A boomerang video is a (usually very short) video clip that plays forwards and then backwards. This effect has become quite popular on many social media and video editing apps. You can create a boomerang effect on any video by adding the boomerang effect to your transformation.

To ensure your video is short enough to produce the desired effect, you can use the boomerang effect in conjunction with the duration, start_offset, or end_offset trimming parameters. Keep in mind that the total length of a single repetition of the boomerang effect will be double the length you set for the video using the trimming parameters.

By default, the boomerang effect runs a single time. To get the repetitive effect that is characteristic of boomerang videos, you need to add looping functionality. To do this, you can either:

  • Include the HTML5 loop attribute in the relevant video_tag SDK method call or when embedding a Cloudinary video player in your webpage. If delivering your boomerang clip in a video format, this is the recommended method.

  • Use the loop transformation effect. If delivering your boomerang video as an animated GIF, this is the recommended method.

For example, the following transformation delivers a selected 2 second clip of the snow_deer video as an animated GIF with an infinitely looping boomerang effect:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_image_tag("snow_deer.gif", :resource_type=>"video", :transformation=>[
  {:end_offset=>"5.0", :start_offset=>"3.0"},
  {:effect=>"boomerang"},
  {:effect=>"loop"}
  ])
PHP (cloudinary_php 2.x):
Copy to clipboard
(new ImageTag('snow_deer.gif'))
  ->videoEdit(VideoEdit::trim()->startOffset(3.0)
->endOffset(5.0))
  ->effect(Effect::boomerang())
  ->animated(Animated::edit()->loop())
  ->assetType("video");
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_image_tag("snow_deer.gif", array("resource_type"=>"video", "transformation"=>array(
  array("end_offset"=>"5.0", "start_offset"=>"3.0"),
  array("effect"=>"boomerang"),
  array("effect"=>"loop")
  )))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("snow_deer.gif").image(transformation=[
  {'end_offset': "5.0", 'start_offset': "3.0"},
  {'effect': "boomerang"},
  {'effect': "loop"}
  ])
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.image("snow_deer.gif", {resource_type: "video", transformation: [
  {end_offset: "5.0", start_offset: "3.0"},
  {effect: "boomerang"},
  {effect: "loop"}
  ]})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation()
  .endOffset("5.0").startOffset("3.0").chain()
  .effect("boomerang").chain()
  .effect("loop")).resourceType("video").imageTag("snow_deer.gif");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryImage("snow_deer.gif")
  .videoEdit(trim().startOffset("3.0").endOffset("5.0"))
  .effect(boomerang())
  .animated(edit().loop())
  .setAssetType("video");
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('snow_deer.gif', {transformation: [
  {endOffset: "5.0", startOffset: "3.0"},
  {effect: "boomerang"},
  {effect: "loop"}
  ]}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.image("snow_deer.gif", {resource_type: "video", transformation: [
  {end_offset: "5.0", start_offset: "3.0"},
  {effect: "boomerang"},
  {effect: "loop"}
  ]})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryImage("snow_deer.gif")
  .videoEdit(trim().startOffset("3.0").endOffset("5.0"))
  .effect(boomerang())
  .animated(edit().loop())
  .setAssetType("video");
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="snow_deer.gif" resourceType="video">
  <Transformation endOffset="5.0" startOffset="3.0" />
  <Transformation effect="boomerang" />
  <Transformation effect="loop" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="snow_deer.gif" resource-type="video">
  <cld-transformation end-offset="5.0" start-offset="3.0" />
  <cld-transformation effect="boomerang" />
  <cld-transformation effect="loop" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryImage("snow_deer.gif")
  .videoEdit(trim().startOffset("3.0").endOffset("5.0"))
  .effect(boomerang())
  .animated(edit().loop())
  .setAssetType("video");
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="snow_deer.gif" resource-type="video">
  <cl-transformation end-offset="5.0" start-offset="3.0">
  </cl-transformation>
  <cl-transformation effect="boomerang">
  </cl-transformation>
  <cl-transformation effect="loop">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .EndOffset("5.0").StartOffset("3.0").Chain()
  .Effect("boomerang").Chain()
  .Effect("loop")).BuildImageTag("snow_deer.gif")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setEndOffset("5.0").setStartOffset("3.0").chain()
  .setEffect("boomerang").chain()
  .setEffect("loop")).generate("snow_deer.gif")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
  .endOffset("5.0").startOffset("3.0").chain()
  .effect("boomerang").chain()
  .effect("loop")).resourceType("video").generate("snow_deer.gif");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
// This code example is not currently available.
Boomerang animated GIF

See full syntax: e_boomerang in the Transformation Reference.

Borders

Add a solid border around videos with the border parameter (bo in URLs). The parameter accepts a value with a CSS-like format: width_style_color (e.g., 3px_solid_black).

An opaque color can be set as an RGB hex triplet (e.g., rgb:3e2222), a 3-digit RGB hex (e.g., rgb:777) or a named color (e.g., green).

You can also use a 4-digit or 8-digit RGBA hex quadruplet for the color, where the 4th hex value represents the alpha (opacity) value (e.g., co_rgb:3e222240 results in 25% opacity).

Additionally, Cloudinary's client libraries also support a # shortcut for RGB (e.g., setting color to #3e2222 which is then translated to rgb:3e2222), and when using Cloudinary's client libraries, you can optionally set the border values programmatically instead of as a single string (e.g., :border => { :width => 4, :color => 'black' }).

Note
Currently only the 'solid' border style is supported.

For example, the uploaded mp4 video named dog delivered with a 5 pixel red border:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :border=>"5px_solid_red")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->border(Border::solid(5,Color::RED));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("border"=>"5px_solid_red"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(border="5px_solid_red")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {border: "5px_solid_red"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().border("5px_solid_red")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("dog.mp4").border(solid(5, "red"));
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {border: "5px_solid_red"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {border: "5px_solid_red"})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").border(solid(5, "red"));
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation border="5px_solid_red" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation border="5px_solid_red" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("dog.mp4").border(solid(5, "red"));
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation border="5px_solid_red">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Border("5px_solid_red")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setBorder("5px_solid_red")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().border("5px_solid_red")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("dog.mp4")
   border(Border.solid(5,Color.RED)) 
}.generate()

Borders are also useful for adding to overlays to clearly define the overlaying image, and also automatically adapt to any rounded corner transformations. For example, the base video given rounded corners with a 10 pixel grey border, and an overlay of the image of young_couple resized to a 150x150 thumbnail with face detection and a black 3 pixel border, added to the northeast corner:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :transformation=>[
  {:width=>500, :crop=>"crop"},
  {:border=>"10px_solid_grey", :radius=>75},
  {:overlay=>"young_couple"},
  {:gravity=>"faces", :height=>150, :width=>150, :crop=>"thumb"},
  {:border=>"3px_solid_black"},
  {:flags=>"layer_apply", :gravity=>"north_east"}
  ])
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->resize(Resize::crop()->width(500))
  ->border(Border::solid(10,Color::GREY)
  ->roundCorners(
  RoundCorners::byRadius(75))
  )
  ->overlay(Overlay::source(
  Source::image("young_couple")
  ->transformation((new Transformation())
  ->resize(Resize::thumbnail()->width(150)
->height(150)
  ->gravity(
  Gravity::focusOn(
  FocusOn::faces()))
  )
  ->border(Border::solid(3,Color::BLACK)))
  )
  ->position((new Position())
  ->gravity(
  Gravity::compass(
  Compass::northEast()))
  )
  );
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("transformation"=>array(
  array("width"=>500, "crop"=>"crop"),
  array("border"=>"10px_solid_grey", "radius"=>75),
  array("overlay"=>"young_couple"),
  array("gravity"=>"faces", "height"=>150, "width"=>150, "crop"=>"thumb"),
  array("border"=>"3px_solid_black"),
  array("flags"=>"layer_apply", "gravity"=>"north_east")
  )))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(transformation=[
  {'width': 500, 'crop': "crop"},
  {'border': "10px_solid_grey", 'radius': 75},
  {'overlay': "young_couple"},
  {'gravity': "faces", 'height': 150, 'width': 150, 'crop': "thumb"},
  {'border': "3px_solid_black"},
  {'flags': "layer_apply", 'gravity': "north_east"}
  ])
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {transformation: [
  {width: 500, crop: "crop"},
  {border: "10px_solid_grey", radius: 75},
  {overlay: "young_couple"},
  {gravity: "faces", height: 150, width: 150, crop: "thumb"},
  {border: "3px_solid_black"},
  {flags: "layer_apply", gravity: "north_east"}
  ]})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation()
  .width(500).crop("crop").chain()
  .border("10px_solid_grey").radius(75).chain()
  .overlay(new Layer().publicId("young_couple")).chain()
  .gravity("faces").height(150).width(150).crop("thumb").chain()
  .border("3px_solid_black").chain()
  .flags("layer_apply").gravity("north_east")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
// This code example is not currently available.
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {transformation: [
  {width: 500, crop: "crop"},
  {border: "10px_solid_grey", radius: 75},
  {overlay: new cloudinary.Layer().publicId("young_couple")},
  {gravity: "faces", height: 150, width: 150, crop: "thumb"},
  {border: "3px_solid_black"},
  {flags: "layer_apply", gravity: "north_east"}
  ]}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {transformation: [
  {width: 500, crop: "crop"},
  {border: "10px_solid_grey", radius: 75},
  {overlay: new cloudinary.Layer().publicId("young_couple")},
  {gravity: "faces", height: 150, width: 150, crop: "thumb"},
  {border: "3px_solid_black"},
  {flags: "layer_apply", gravity: "north_east"}
  ]})
React (@cloudinary/react 1.x):
Copy to clipboard
// This code example is not currently available.
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation width="500" crop="crop" />
  <Transformation border="10px_solid_grey" radius="75" />
  <Transformation overlay="young_couple" />
  <Transformation gravity="faces" height="150" width="150" crop="thumb" />
  <Transformation border="3px_solid_black" />
  <Transformation flags="layer_apply" gravity="north_east" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation width="500" crop="crop" />
  <cld-transformation border="10px_solid_grey" radius="75" />
  <cld-transformation :overlay="young_couple" />
  <cld-transformation gravity="faces" height="150" width="150" crop="thumb" />
  <cld-transformation border="3px_solid_black" />
  <cld-transformation flags="layer_apply" gravity="north_east" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
// This code example is not currently available.
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation width="500" crop="crop">
  </cl-transformation>
  <cl-transformation border="10px_solid_grey" radius="75">
  </cl-transformation>
  <cl-transformation overlay="young_couple">
  </cl-transformation>
  <cl-transformation gravity="faces" height="150" width="150" crop="thumb">
  </cl-transformation>
  <cl-transformation border="3px_solid_black">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="north_east">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Width(500).Crop("crop").Chain()
  .Border("10px_solid_grey").Radius(75).Chain()
  .Overlay(new Layer().PublicId("young_couple")).Chain()
  .Gravity("faces").Height(150).Width(150).Crop("thumb").Chain()
  .Border("3px_solid_black").Chain()
  .Flags("layer_apply").Gravity("north_east")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setWidth(500).setCrop("crop").chain()
  .setBorder("10px_solid_grey").setRadius(75).chain()
  .setOverlay("young_couple").chain()
  .setGravity("faces").setHeight(150).setWidth(150).setCrop("thumb").chain()
  .setBorder("3px_solid_black").chain()
  .setFlags("layer_apply").setGravity("north_east")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
  .width(500).crop("crop").chain()
  .border("10px_solid_grey").radius(75).chain()
  .overlay(new Layer().publicId("young_couple")).chain()
  .gravity("faces").height(150).width(150).crop("thumb").chain()
  .border("3px_solid_black").chain()
  .flags("layer_apply").gravity("north_east")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
// This code example is not currently available.

See full syntax: bo (border) in the Transformation Reference.

Progress indicator

Use the progressbar effect (e_progressbar in URLs) to add a progress indicator overlay to your videos. This can be used to show video progress when a video is played inline and the controls are hidden. You can customize the indicator using the type, color and width parameters:

  • type - Specifies the type of progress indicator to overlay.
    • bar - Draws a single progress bar across the bottom of the video, starting on the left and ending on the right. Default.
    • frame - Draws a frame around the video, starting in the bottom left and going both ways around the video, ending in the top right.
  • color - Specifies the color of the indicator. It can be specified as an RGB hex triplet (e.g. 3e2222) or a named color (e.g. green). Default: Red.
  • width - Specifies the width (in pixels) of the indicator. Default: 10px.

Parameter values will be evaluated in the following specific order: [type]:[color]:[width]; therefore to set the color or width, you must also specify the value(s) to the left. Alternatively, you can set named parameters (in any order), with the parameter name and value separated by an underscore (_): [type_<type>]:[color_<color>]:[width_<width>].

For example, to add a red frame type progress indicator with a width of 12 pixels to the video of a dog (click video to play):

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :effect=>"progressbar:frame:FF0000:12")
PHP (cloudinary_php 2.x):
Copy to clipboard
// This code example is not currently available.
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("effect"=>"progressbar:frame:FF0000:12"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(effect="progressbar:frame:FF0000:12")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {effect: "progressbar:frame:FF0000:12"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().effect("progressbar:frame:FF0000:12")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
// This code example is not currently available.
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {effect: "progressbar:frame:FF0000:12"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {effect: "progressbar:frame:FF0000:12"})
React (@cloudinary/react 1.x):
Copy to clipboard
// This code example is not currently available.
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation effect="progressbar:frame:FF0000:12" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation effect="progressbar:frame:FF0000:12" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
// This code example is not currently available.
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation effect="progressbar:frame:FF0000:12">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Effect("progressbar:frame:FF0000:12")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setEffect("progressbar:frame:FF0000:12")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().effect("progressbar:frame:FF0000:12")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
// This code example is not currently available.

or:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :effect=>"progressbar:color_FF0000:width_12:type_frame")
PHP (cloudinary_php 2.x):
Copy to clipboard
// This code example is not currently available.
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("effect"=>"progressbar:color_FF0000:width_12:type_frame"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(effect="progressbar:color_FF0000:width_12:type_frame")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {effect: "progressbar:color_FF0000:width_12:type_frame"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().effect("progressbar:color_FF0000:width_12:type_frame")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
// This code example is not currently available.
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {effect: "progressbar:color_FF0000:width_12:type_frame"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {effect: "progressbar:color_FF0000:width_12:type_frame"})
React (@cloudinary/react 1.x):
Copy to clipboard
// This code example is not currently available.
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation effect="progressbar:color_FF0000:width_12:type_frame" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation effect="progressbar:color_FF0000:width_12:type_frame" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
// This code example is not currently available.
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation effect="progressbar:color_FF0000:width_12:type_frame">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Effect("progressbar:color_FF0000:width_12:type_frame")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setEffect("progressbar:color_FF0000:width_12:type_frame")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().effect("progressbar:color_FF0000:width_12:type_frame")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
// This code example is not currently available.


Here's the same video as above with a blue "bar" indicator that is 6 pixels wide:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :effect=>"progressbar:bar:blue:6")
PHP (cloudinary_php 2.x):
Copy to clipboard
// This code example is not currently available.
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("effect"=>"progressbar:bar:blue:6"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(effect="progressbar:bar:blue:6")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {effect: "progressbar:bar:blue:6"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().effect("progressbar:bar:blue:6")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
// This code example is not currently available.
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {effect: "progressbar:bar:blue:6"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {effect: "progressbar:bar:blue:6"})
React (@cloudinary/react 1.x):
Copy to clipboard
// This code example is not currently available.
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation effect="progressbar:bar:blue:6" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation effect="progressbar:bar:blue:6" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
// This code example is not currently available.
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation effect="progressbar:bar:blue:6">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Effect("progressbar:bar:blue:6")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setEffect("progressbar:bar:blue:6")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().effect("progressbar:bar:blue:6")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
// This code example is not currently available.

See full syntax: e_progressbar in the Transformation Reference.

Rotation

Rotate a video by any arbitrary angle in degrees with the angle parameter (a in URLs). A positive integer value rotates the video clockwise, and a negative integer value rotates the video counterclockwise. If the angle is not a multiple of 90 then a rectangular bounding box is added containing the rotated video and empty space.

Note
If either the width or height of a video exceeds 3000 pixels, the video is automatically downscaled first, and then rotated. This applies to the video that is the input to the rotation, be it the output of a chained transformation or the original video.

Other possible rotation values instead of an integer value include:

  • auto_right - Rotate the video 90 degrees clockwise only if the requested aspect ratio does not match the video's aspect ratio.
  • auto_left - Rotate the video 90 degrees counterclockwise only if the requested aspect ratio does not match the video's aspect ratio.
  • vflip - Vertical mirror flip of the video.
  • hflip - Horizontal mirror flip of the video.
  • ignore - By default, the video is automatically rotated according to the EXIF data stored by the camera when the video was taken. Set the rotation to 'ignore' if you do not want the video to be automatically rotated.

Note
To apply multiple values, separate each value with a dot (.). For example to horizontally flip the video and rotate it by 45 degrees: angle: hflip.45

Examples with the uploaded video named dog (all videos are also scaled down to a width of 100 pixels):

  1. Rotate the video by 90 degrees:
    Ruby (cloudinary 1.x):
    Copy to clipboard
    cl_video_tag("dog", :transformation=>[
      {:width=>100, :crop=>"scale"},
      {:angle=>90}
      ])
    PHP (cloudinary_php 2.x):
    Copy to clipboard
    (new VideoTag('dog.mp4'))
      ->resize(Resize::scale()->width(100))
      ->rotate(Rotate::byAngle(90));
    PHP (cloudinary_php 1.x (legacy)):
    Copy to clipboard
    cl_video_tag("dog", array("transformation"=>array(
      array("width"=>100, "crop"=>"scale"),
      array("angle"=>90)
      )))
    Python (cloudinary 1.x):
    Copy to clipboard
    CloudinaryVideo("dog").video(transformation=[
      {'width': 100, 'crop': "scale"},
      {'angle': 90}
      ])
    Node.js (cloudinary 1.x):
    Copy to clipboard
    cloudinary.video("dog", {transformation: [
      {width: 100, crop: "scale"},
      {angle: 90}
      ]})
    Java (cloudinary 1.x):
    Copy to clipboard
    cloudinary.url().transformation(new Transformation()
      .width(100).crop("scale").chain()
      .angle(90)).videoTag("dog");
    JS (@cloudinary/url-gen 1.x):
    Copy to clipboard
    new CloudinaryVideo("dog.mp4").resize(scale().width(100)).rotate(byAngle(90));
    JS (cloudinary-core 2.x (legacy)):
    Copy to clipboard
    cloudinary.videoTag('dog', {transformation: [
      {width: 100, crop: "scale"},
      {angle: 90}
      ]}).toHtml();
    jQuery (cloudinary-jquery 2.x):
    Copy to clipboard
    $.cloudinary.video("dog", {transformation: [
      {width: 100, crop: "scale"},
      {angle: 90}
      ]})
    React (@cloudinary/react 1.x):
    Copy to clipboard
    //React SDK transformations are created using @cloudinary/url-gen.
    new CloudinaryVideo("dog.mp4").resize(scale().width(100)).rotate(byAngle(90));
    React (cloudinary-react 1.x):
    Copy to clipboard
    <Video publicId="dog" >
      <Transformation width="100" crop="scale" />
      <Transformation angle="90" />
    </Video>
    Vue.js (cloudinary-vue 1.x):
    Copy to clipboard
    <cld-video public-id="dog" >
      <cld-transformation width="100" crop="scale" />
      <cld-transformation angle="90" />
    </cld-video>
    Angular (@cloudinary/ng 1.x):
    Copy to clipboard
    //Angular SDK transformations are created using @cloudinary/url-gen.
    new CloudinaryVideo("dog.mp4").resize(scale().width(100)).rotate(byAngle(90));
    Angular (@cloudinary/angular-5.x 1.x (legacy)):
    Copy to clipboard
    <cl-video public-id="dog" >
      <cl-transformation width="100" crop="scale">
      </cl-transformation>
      <cl-transformation angle="90">
      </cl-transformation>
    </cl-video>
    .NET (CloudinaryDotNet 1.x):
    Copy to clipboard
    cloudinary.Api.UrlVideoUp.Transform(new Transformation()
      .Width(100).Crop("scale").Chain()
      .Angle(90)).BuildVideoTag("dog")
    iOS (cloudinary 3.x):
    Copy to clipboard
    cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
      .setWidth(100).setCrop("scale").chain()
      .setAngle(90)).generate("dog.mp4")
    Android (cloudinary-android 1.x):
    Copy to clipboard
    MediaManager.get().url().transformation(new Transformation()
      .width(100).crop("scale").chain()
      .angle(90)).resourceType("video").generate("dog.mp4");
    Kotlin (kotlin-url-gen 1.x):
    Copy to clipboard
    cloudinary.video {
      publicId("dog.mp4")
       resize(Resize.scale() { width(100) })
       rotate(Rotate.byAngle(90)) 
    }.generate()
  2. Rotate the video by -20 degrees (automatically adds a bounding box):
    Ruby (cloudinary 1.x):
    Copy to clipboard
    cl_video_tag("dog", :transformation=>[
      {:width=>100, :crop=>"scale"},
      {:angle=>-20}
      ])
    PHP (cloudinary_php 2.x):
    Copy to clipboard
    (new VideoTag('dog.mp4'))
      ->resize(Resize::scale()->width(100))
      ->rotate(Rotate::byAngle(-20));
    PHP (cloudinary_php 1.x (legacy)):
    Copy to clipboard
    cl_video_tag("dog", array("transformation"=>array(
      array("width"=>100, "crop"=>"scale"),
      array("angle"=>-20)
      )))
    Python (cloudinary 1.x):
    Copy to clipboard
    CloudinaryVideo("dog").video(transformation=[
      {'width': 100, 'crop': "scale"},
      {'angle': -20}
      ])
    Node.js (cloudinary 1.x):
    Copy to clipboard
    cloudinary.video("dog", {transformation: [
      {width: 100, crop: "scale"},
      {angle: -20}
      ]})
    Java (cloudinary 1.x):
    Copy to clipboard
    cloudinary.url().transformation(new Transformation()
      .width(100).crop("scale").chain()
      .angle(-20)).videoTag("dog");
    JS (@cloudinary/url-gen 1.x):
    Copy to clipboard
    new CloudinaryVideo("dog.mp4").resize(scale().width(100)).rotate(byAngle(-20));
    JS (cloudinary-core 2.x (legacy)):
    Copy to clipboard
    cloudinary.videoTag('dog', {transformation: [
      {width: 100, crop: "scale"},
      {angle: -20}
      ]}).toHtml();
    jQuery (cloudinary-jquery 2.x):
    Copy to clipboard
    $.cloudinary.video("dog", {transformation: [
      {width: 100, crop: "scale"},
      {angle: -20}
      ]})
    React (@cloudinary/react 1.x):
    Copy to clipboard
    //React SDK transformations are created using @cloudinary/url-gen.
    new CloudinaryVideo("dog.mp4").resize(scale().width(100)).rotate(byAngle(-20));
    React (cloudinary-react 1.x):
    Copy to clipboard
    <Video publicId="dog" >
      <Transformation width="100" crop="scale" />
      <Transformation angle="-20" />
    </Video>
    Vue.js (cloudinary-vue 1.x):
    Copy to clipboard
    <cld-video public-id="dog" >
      <cld-transformation width="100" crop="scale" />
      <cld-transformation angle="-20" />
    </cld-video>
    Angular (@cloudinary/ng 1.x):
    Copy to clipboard
    //Angular SDK transformations are created using @cloudinary/url-gen.
    new CloudinaryVideo("dog.mp4").resize(scale().width(100)).rotate(byAngle(-20));
    Angular (@cloudinary/angular-5.x 1.x (legacy)):
    Copy to clipboard
    <cl-video public-id="dog" >
      <cl-transformation width="100" crop="scale">
      </cl-transformation>
      <cl-transformation angle="-20">
      </cl-transformation>
    </cl-video>
    .NET (CloudinaryDotNet 1.x):
    Copy to clipboard
    cloudinary.Api.UrlVideoUp.Transform(new Transformation()
      .Width(100).Crop("scale").Chain()
      .Angle(-20)).BuildVideoTag("dog")
    iOS (cloudinary 3.x):
    Copy to clipboard
    cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
      .setWidth(100).setCrop("scale").chain()
      .setAngle(-20)).generate("dog.mp4")
    Android (cloudinary-android 1.x):
    Copy to clipboard
    MediaManager.get().url().transformation(new Transformation()
      .width(100).crop("scale").chain()
      .angle(-20)).resourceType("video").generate("dog.mp4");
    Kotlin (kotlin-url-gen 1.x):
    Copy to clipboard
    cloudinary.video {
      publicId("dog.mp4")
       resize(Resize.scale() { width(100) })
       rotate(Rotate.byAngle(-20)) 
    }.generate()
  3. Vertically mirror flip the video and rotate by 45 degrees (automatically adds a bounding box):
    Ruby (cloudinary 1.x):
    Copy to clipboard
    cl_video_tag("dog", :transformation=>[
      {:width=>100, :crop=>"scale"},
      {:angle=>"vflip"},
      {:angle=>45}
      ])
    PHP (cloudinary_php 2.x):
    Copy to clipboard
    (new VideoTag('dog.mp4'))
      ->resize(Resize::scale()->width(100))
      ->rotate(Rotate::mode(
      RotationMode::verticalFlip()))
      ->rotate(Rotate::byAngle(45));
    PHP (cloudinary_php 1.x (legacy)):
    Copy to clipboard
    cl_video_tag("dog", array("transformation"=>array(
      array("width"=>100, "crop"=>"scale"),
      array("angle"=>"vflip"),
      array("angle"=>45)
      )))
    Python (cloudinary 1.x):
    Copy to clipboard
    CloudinaryVideo("dog").video(transformation=[
      {'width': 100, 'crop': "scale"},
      {'angle': "vflip"},
      {'angle': 45}
      ])
    Node.js (cloudinary 1.x):
    Copy to clipboard
    cloudinary.video("dog", {transformation: [
      {width: 100, crop: "scale"},
      {angle: "vflip"},
      {angle: 45}
      ]})
    Java (cloudinary 1.x):
    Copy to clipboard
    cloudinary.url().transformation(new Transformation()
      .width(100).crop("scale").chain()
      .angle("vflip").chain()
      .angle(45)).videoTag("dog");
    JS (@cloudinary/url-gen 1.x):
    Copy to clipboard
    new CloudinaryVideo("dog.mp4")
      .resize(scale().width(100))
      .rotate(mode(verticalFlip()))
      .rotate(byAngle(45));
    JS (cloudinary-core 2.x (legacy)):
    Copy to clipboard
    cloudinary.videoTag('dog', {transformation: [
      {width: 100, crop: "scale"},
      {angle: "vflip"},
      {angle: 45}
      ]}).toHtml();
    jQuery (cloudinary-jquery 2.x):
    Copy to clipboard
    $.cloudinary.video("dog", {transformation: [
      {width: 100, crop: "scale"},
      {angle: "vflip"},
      {angle: 45}
      ]})
    React (@cloudinary/react 1.x):
    Copy to clipboard
    //React SDK transformations are created using @cloudinary/url-gen.
    new CloudinaryVideo("dog.mp4")
      .resize(scale().width(100))
      .rotate(mode(verticalFlip()))
      .rotate(byAngle(45));
    React (cloudinary-react 1.x):
    Copy to clipboard
    <Video publicId="dog" >
      <Transformation width="100" crop="scale" />
      <Transformation angle="vflip" />
      <Transformation angle="45" />
    </Video>
    Vue.js (cloudinary-vue 1.x):
    Copy to clipboard
    <cld-video public-id="dog" >
      <cld-transformation width="100" crop="scale" />
      <cld-transformation angle="vflip" />
      <cld-transformation angle="45" />
    </cld-video>
    Angular (@cloudinary/ng 1.x):
    Copy to clipboard
    //Angular SDK transformations are created using @cloudinary/url-gen.
    new CloudinaryVideo("dog.mp4")
      .resize(scale().width(100))
      .rotate(mode(verticalFlip()))
      .rotate(byAngle(45));
    Angular (@cloudinary/angular-5.x 1.x (legacy)):
    Copy to clipboard
    <cl-video public-id="dog" >
      <cl-transformation width="100" crop="scale">
      </cl-transformation>
      <cl-transformation angle="vflip">
      </cl-transformation>
      <cl-transformation angle="45">
      </cl-transformation>
    </cl-video>
    .NET (CloudinaryDotNet 1.x):
    Copy to clipboard
    cloudinary.Api.UrlVideoUp.Transform(new Transformation()
      .Width(100).Crop("scale").Chain()
      .Angle("vflip").Chain()
      .Angle(45)).BuildVideoTag("dog")
    iOS (cloudinary 3.x):
    Copy to clipboard
    cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
      .setWidth(100).setCrop("scale").chain()
      .setAngle("vflip").chain()
      .setAngle(45)).generate("dog.mp4")
    Android (cloudinary-android 1.x):
    Copy to clipboard
    MediaManager.get().url().transformation(new Transformation()
      .width(100).crop("scale").chain()
      .angle("vflip").chain()
      .angle(45)).resourceType("video").generate("dog.mp4");
    Kotlin (kotlin-url-gen 1.x):
    Copy to clipboard
    cloudinary.video {
      publicId("dog.mp4")
       resize(Resize.scale() { width(100) })
       rotate(Rotate.mode(
      RotationMode.verticalFlip()))
       rotate(Rotate.byAngle(45)) 
    }.generate()
  4. Crop the video to a 200x200 circle, then rotate the video by 30 degrees (automatically adds a bounding box) and finally trim the extra whitespace added:
    Ruby (cloudinary 1.x):
    Copy to clipboard
    cl_video_tag("dog", :transformation=>[
      {:height=>200, :width=>200, :crop=>"fill"},
      {:radius=>"max"},
      {:angle=>30},
      {:effect=>"trim"}
      ])
    PHP (cloudinary_php 2.x):
    Copy to clipboard
    (new VideoTag('dog.mp4'))
      ->resize(Resize::fill()->width(200)
    ->height(200))
      ->roundCorners(RoundCorners::max())
      ->rotate(Rotate::byAngle(30))
      ->reshape(Reshape::trim());
    PHP (cloudinary_php 1.x (legacy)):
    Copy to clipboard
    cl_video_tag("dog", array("transformation"=>array(
      array("height"=>200, "width"=>200, "crop"=>"fill"),
      array("radius"=>"max"),
      array("angle"=>30),
      array("effect"=>"trim")
      )))
    Python (cloudinary 1.x):
    Copy to clipboard
    CloudinaryVideo("dog").video(transformation=[
      {'height': 200, 'width': 200, 'crop': "fill"},
      {'radius': "max"},
      {'angle': 30},
      {'effect': "trim"}
      ])
    Node.js (cloudinary 1.x):
    Copy to clipboard
    cloudinary.video("dog", {transformation: [
      {height: 200, width: 200, crop: "fill"},
      {radius: "max"},
      {angle: 30},
      {effect: "trim"}
      ]})
    Java (cloudinary 1.x):
    Copy to clipboard
    cloudinary.url().transformation(new Transformation()
      .height(200).width(200).crop("fill").chain()
      .radius("max").chain()
      .angle(30).chain()
      .effect("trim")).videoTag("dog");
    JS (@cloudinary/url-gen 1.x):
    Copy to clipboard
    // This code example is not currently available.
    JS (cloudinary-core 2.x (legacy)):
    Copy to clipboard
    cloudinary.videoTag('dog', {transformation: [
      {height: 200, width: 200, crop: "fill"},
      {radius: "max"},
      {angle: 30},
      {effect: "trim"}
      ]}).toHtml();
    jQuery (cloudinary-jquery 2.x):
    Copy to clipboard
    $.cloudinary.video("dog", {transformation: [
      {height: 200, width: 200, crop: "fill"},
      {radius: "max"},
      {angle: 30},
      {effect: "trim"}
      ]})
    React (@cloudinary/react 1.x):
    Copy to clipboard
    // This code example is not currently available.
    React (cloudinary-react 1.x):
    Copy to clipboard
    <Video publicId="dog" >
      <Transformation height="200" width="200" crop="fill" />
      <Transformation radius="max" />
      <Transformation angle="30" />
      <Transformation effect="trim" />
    </Video>
    Vue.js (cloudinary-vue 1.x):
    Copy to clipboard
    <cld-video public-id="dog" >
      <cld-transformation height="200" width="200" crop="fill" />
      <cld-transformation radius="max" />
      <cld-transformation angle="30" />
      <cld-transformation effect="trim" />
    </cld-video>
    Angular (@cloudinary/ng 1.x):
    Copy to clipboard
    // This code example is not currently available.
    Angular (@cloudinary/angular-5.x 1.x (legacy)):
    Copy to clipboard
    <cl-video public-id="dog" >
      <cl-transformation height="200" width="200" crop="fill">
      </cl-transformation>
      <cl-transformation radius="max">
      </cl-transformation>
      <cl-transformation angle="30">
      </cl-transformation>
      <cl-transformation effect="trim">
      </cl-transformation>
    </cl-video>
    .NET (CloudinaryDotNet 1.x):
    Copy to clipboard
    cloudinary.Api.UrlVideoUp.Transform(new Transformation()
      .Height(200).Width(200).Crop("fill").Chain()
      .Radius("max").Chain()
      .Angle(30).Chain()
      .Effect("trim")).BuildVideoTag("dog")
    iOS (cloudinary 3.x):
    Copy to clipboard
    cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
      .setHeight(200).setWidth(200).setCrop("fill").chain()
      .setRadius("max").chain()
      .setAngle(30).chain()
      .setEffect("trim")).generate("dog.mp4")
    Android (cloudinary-android 1.x):
    Copy to clipboard
    MediaManager.get().url().transformation(new Transformation()
      .height(200).width(200).crop("fill").chain()
      .radius("max").chain()
      .angle(30).chain()
      .effect("trim")).resourceType("video").generate("dog.mp4");
    Kotlin (kotlin-url-gen 1.x):
    Copy to clipboard
    // This code example is not currently available.

See full syntax: a (angle) in the Transformation Reference.

Rounding

Transforming a video to a rounded version is done using the radius parameter (r in URLs) set to the number of pixels the radius of all four corners should be. For example, the uploaded mp4 video named dog resized to a width of 300 pixels and with rounded corners set to a radius of 30 pixels:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :transformation=>[
  {:width=>300, :crop=>"scale"},
  {:radius=>30}
  ])
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->resize(Resize::scale()->width(300))
  ->roundCorners(RoundCorners::byRadius(30));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("transformation"=>array(
  array("width"=>300, "crop"=>"scale"),
  array("radius"=>30)
  )))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(transformation=[
  {'width': 300, 'crop': "scale"},
  {'radius': 30}
  ])
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {transformation: [
  {width: 300, crop: "scale"},
  {radius: 30}
  ]})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation()
  .width(300).crop("scale").chain()
  .radius(30)).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
// This code example is not currently available.
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {transformation: [
  {width: 300, crop: "scale"},
  {radius: 30}
  ]}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {transformation: [
  {width: 300, crop: "scale"},
  {radius: 30}
  ]})
React (@cloudinary/react 1.x):
Copy to clipboard
// This code example is not currently available.
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation width="300" crop="scale" />
  <Transformation radius="30" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation width="300" crop="scale" />
  <cld-transformation radius="30" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
// This code example is not currently available.
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation width="300" crop="scale">
  </cl-transformation>
  <cl-transformation radius="30">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Width(300).Crop("scale").Chain()
  .Radius(30)).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setWidth(300).setCrop("scale").chain()
  .setRadius(30)).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
  .width(300).crop("scale").chain()
  .radius(30)).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
// This code example is not currently available.

Cloudinary also supports cropping videos to the shape of an ellipse. Simply pass max as the value of the radius parameter. For example, the uploaded mp4 video named dog resized to a width of 300 pixels and with maximum radius cropping:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :transformation=>[
  {:width=>300, :crop=>"scale"},
  {:radius=>"max"}
  ])
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->resize(Resize::scale()->width(300))
  ->roundCorners(RoundCorners::max());
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("transformation"=>array(
  array("width"=>300, "crop"=>"scale"),
  array("radius"=>"max")
  )))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(transformation=[
  {'width': 300, 'crop': "scale"},
  {'radius': "max"}
  ])
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {transformation: [
  {width: 300, crop: "scale"},
  {radius: "max"}
  ]})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation()
  .width(300).crop("scale").chain()
  .radius("max")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
// This code example is not currently available.
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {transformation: [
  {width: 300, crop: "scale"},
  {radius: "max"}
  ]}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {transformation: [
  {width: 300, crop: "scale"},
  {radius: "max"}
  ]})
React (@cloudinary/react 1.x):
Copy to clipboard
// This code example is not currently available.
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation width="300" crop="scale" />
  <Transformation radius="max" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation width="300" crop="scale" />
  <cld-transformation radius="max" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
// This code example is not currently available.
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation width="300" crop="scale">
  </cl-transformation>
  <cl-transformation radius="max">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Width(300).Crop("scale").Chain()
  .Radius("max")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setWidth(300).setCrop("scale").chain()
  .setRadius("max")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
  .width(300).crop("scale").chain()
  .radius("max")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
// This code example is not currently available.

You can also change the background color of the video from the default white color using the background parameter. If the width and height of the video are identical (i.e., the same value) then setting the radius parameter to max generates a circular video. For example, the uploaded mp4 video named dog with width and height set to 300 pixels, and with maximum radius cropping using a blue background:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :background=>"blue", :height=>300, :radius=>"max", :width=>300, :crop=>"fill")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->resize(Resize::fill()->width(300)
->height(300))
  ->roundCorners(RoundCorners::max())
  ->backgroundColor(Color::BLUE);
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("background"=>"blue", "height"=>300, "radius"=>"max", "width"=>300, "crop"=>"fill"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(background="blue", height=300, radius="max", width=300, crop="fill")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {background: "blue", height: 300, radius: "max", width: 300, crop: "fill"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().background("blue").height(300).radius("max").width(300).crop("fill")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
// This code example is not currently available.
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {background: "blue", height: 300, radius: "max", width: 300, crop: "fill"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {background: "blue", height: 300, radius: "max", width: 300, crop: "fill"})
React (@cloudinary/react 1.x):
Copy to clipboard
// This code example is not currently available.
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation background="blue" height="300" radius="max" width="300" crop="fill" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation background="blue" height="300" radius="max" width="300" crop="fill" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
// This code example is not currently available.
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation background="blue" height="300" radius="max" width="300" crop="fill">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Background("blue").Height(300).Radius("max").Width(300).Crop("fill")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setBackground("blue").setHeight(300).setRadius("max").setWidth(300).setCrop("fill")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().background("blue").height(300).radius("max").width(300).crop("fill")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
// This code example is not currently available.

The radius parameter can also be used to round the corners of overlays, which are then also given a transparent background. For example, the uploaded mp4 video named dog overlaid on the same video named dog with width set to 100 pixels, maximum radius cropping and north east gravity:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("dog", :transformation=>[
  {:width=>300, :crop=>"scale"},
  {:overlay=>"video:dog"},
  {:width=>100, :crop=>"scale"},
  {:radius=>"max"},
  {:flags=>"layer_apply", :gravity=>"north_east"}
  ])
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('dog.mp4'))
  ->resize(Resize::scale()->width(300))
  ->overlay(Overlay::source(
  Source::video("dog")
  ->transformation((new Transformation())
  ->resize(Resize::scale()->width(100))
  ->roundCorners(RoundCorners::max()))
  )
  ->position((new Position())
  ->gravity(
  Gravity::compass(
  Compass::northEast()))
  )
  );
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("dog", array("transformation"=>array(
  array("width"=>300, "crop"=>"scale"),
  array("overlay"=>"video:dog"),
  array("width"=>100, "crop"=>"scale"),
  array("radius"=>"max"),
  array("flags"=>"layer_apply", "gravity"=>"north_east")
  )))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog").video(transformation=[
  {'width': 300, 'crop': "scale"},
  {'overlay': "video:dog"},
  {'width': 100, 'crop': "scale"},
  {'radius': "max"},
  {'flags': "layer_apply", 'gravity': "north_east"}
  ])
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("dog", {transformation: [
  {width: 300, crop: "scale"},
  {overlay: "video:dog"},
  {width: 100, crop: "scale"},
  {radius: "max"},
  {flags: "layer_apply", gravity: "north_east"}
  ]})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation()
  .width(300).crop("scale").chain()
  .overlay(new Layer().publicId("video:dog")).chain()
  .width(100).crop("scale").chain()
  .radius("max").chain()
  .flags("layer_apply").gravity("north_east")).videoTag("dog");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
// This code example is not currently available.
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog', {transformation: [
  {width: 300, crop: "scale"},
  {overlay: new cloudinary.Layer().publicId("video:dog")},
  {width: 100, crop: "scale"},
  {radius: "max"},
  {flags: "layer_apply", gravity: "north_east"}
  ]}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("dog", {transformation: [
  {width: 300, crop: "scale"},
  {overlay: new cloudinary.Layer().publicId("video:dog")},
  {width: 100, crop: "scale"},
  {radius: "max"},
  {flags: "layer_apply", gravity: "north_east"}
  ]})
React (@cloudinary/react 1.x):
Copy to clipboard
// This code example is not currently available.
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog" >
  <Transformation width="300" crop="scale" />
  <Transformation overlay="video:dog" />
  <Transformation width="100" crop="scale" />
  <Transformation radius="max" />
  <Transformation flags="layer_apply" gravity="north_east" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog" >
  <cld-transformation width="300" crop="scale" />
  <cld-transformation :overlay="video:dog" />
  <cld-transformation width="100" crop="scale" />
  <cld-transformation radius="max" />
  <cld-transformation flags="layer_apply" gravity="north_east" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
// This code example is not currently available.
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog" >
  <cl-transformation width="300" crop="scale">
  </cl-transformation>
  <cl-transformation overlay="video:dog">
  </cl-transformation>
  <cl-transformation width="100" crop="scale">
  </cl-transformation>
  <cl-transformation radius="max">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="north_east">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Width(300).Crop("scale").Chain()
  .Overlay(new Layer().PublicId("video:dog")).Chain()
  .Width(100).Crop("scale").Chain()
  .Radius("max").Chain()
  .Flags("layer_apply").Gravity("north_east")).BuildVideoTag("dog")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setWidth(300).setCrop("scale").chain()
  .setOverlay("video:dog").chain()
  .setWidth(100).setCrop("scale").chain()
  .setRadius("max").chain()
  .setFlags("layer_apply").setGravity("north_east")).generate("dog.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
  .width(300).crop("scale").chain()
  .overlay(new Layer().publicId("video:dog")).chain()
  .width(100).crop("scale").chain()
  .radius("max").chain()
  .flags("layer_apply").gravity("north_east")).resourceType("video").generate("dog.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
// This code example is not currently available.

See full syntax: r (round corners) in the Transformation Reference.

Transparency

You can convert any relatively solid color in a video overlay to be fully transparent, thus making the base video visible in the transparent areas. This means you can remove plain colored backgrounds from a video overlay or remove a solid colored element from the subject of a video overlay, such that the content of the video behind that element shows through. This functionality works like a green-screen effect, but can be applied to any HEX color.

To make a color transparent in your video overlay, apply both the make_transparent effect (e_make_transparent in URLs) and the color parameter (co_ in URLs) to your video overlay component. You can also specify a tolerance value for the make_transparent effect to allow for minor differences in the shade of the specified color.

Note
The make_transparent parameter is supported only for videos within an overlay component. You cannot apply this parameter to a video without an overlay.

For example, suppose you have the following product video that was produced with a blue screen background:

You could use that product video as an overlay on top of a video showing a nice background scene. You could then make the blue background of your overlay video transparent using the make_transparent parameter together with the color parameter set to the Hex color #0e80d8 (the specific shade of blue used in this video).

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("docs/sunset_waves", :transformation=>[
  {:width=>500, :crop=>"scale"},
  {:overlay=>"video:docs:bluescreen_watches"},
  {:flags=>"relative", :width=>0.6, :crop=>"scale"},
  {:color=>"#0e80d8", :effect=>"make_transparent:20"},
  {:flags=>"layer_apply", :gravity=>"north"},
  {:duration=>"15.0"}
  ])
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('docs/sunset_waves.mp4'))
  ->resize(Resize::scale()->width(500))
  ->overlay(Overlay::source(
  Source::video("docs/bluescreen_watches")
  ->transformation((new Transformation())
  ->resize(Resize::scale()->width(0.6)
  ->relative()
  )
  ->effect(Effect::makeTransparent()->tolerance(20)
  ->colorToReplace(Color::rgb("0e80d8"))
  ))
  )
  ->position((new Position())
  ->gravity(
  Gravity::compass(
  Compass::north()))
  )
  )
  ->videoEdit(VideoEdit::trim()->duration(15.0));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("docs/sunset_waves", array("transformation"=>array(
  array("width"=>500, "crop"=>"scale"),
  array("overlay"=>"video:docs:bluescreen_watches"),
  array("flags"=>"relative", "width"=>"0.6", "crop"=>"scale"),
  array("color"=>"#0e80d8", "effect"=>"make_transparent:20"),
  array("flags"=>"layer_apply", "gravity"=>"north"),
  array("duration"=>"15.0")
  )))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("docs/sunset_waves").video(transformation=[
  {'width': 500, 'crop': "scale"},
  {'overlay': "video:docs:bluescreen_watches"},
  {'flags': "relative", 'width': "0.6", 'crop': "scale"},
  {'color': "#0e80d8", 'effect': "make_transparent:20"},
  {'flags': "layer_apply", 'gravity': "north"},
  {'duration': "15.0"}
  ])
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("docs/sunset_waves", {transformation: [
  {width: 500, crop: "scale"},
  {overlay: "video:docs:bluescreen_watches"},
  {flags: "relative", width: "0.6", crop: "scale"},
  {color: "#0e80d8", effect: "make_transparent:20"},
  {flags: "layer_apply", gravity: "north"},
  {duration: "15.0"}
  ]})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation()
  .width(500).crop("scale").chain()
  .overlay(new Layer().publicId("video:docs:bluescreen_watches")).chain()
  .flags("relative").width(0.6).crop("scale").chain()
  .color("#0e80d8").effect("make_transparent:20").chain()
  .flags("layer_apply").gravity("north").chain()
  .duration("15.0")).videoTag("docs/sunset_waves");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width(0.6).relative())
          .effect(makeTransparent().tolerance(20).colorToReplace("#0e80d8"))
      )
    ).position(new Position().gravity(compass("north")))
  )
  .videoEdit(trim().duration("15.0"));
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('docs/sunset_waves', {transformation: [
  {width: 500, crop: "scale"},
  {overlay: new cloudinary.Layer().publicId("video:docs:bluescreen_watches")},
  {flags: "relative", width: "0.6", crop: "scale"},
  {color: "#0e80d8", effect: "make_transparent:20"},
  {flags: "layer_apply", gravity: "north"},
  {duration: "15.0"}
  ]}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("docs/sunset_waves", {transformation: [
  {width: 500, crop: "scale"},
  {overlay: new cloudinary.Layer().publicId("video:docs:bluescreen_watches")},
  {flags: "relative", width: "0.6", crop: "scale"},
  {color: "#0e80d8", effect: "make_transparent:20"},
  {flags: "layer_apply", gravity: "north"},
  {duration: "15.0"}
  ]})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width(0.6).relative())
          .effect(makeTransparent().tolerance(20).colorToReplace("#0e80d8"))
      )
    ).position(new Position().gravity(compass("north")))
  )
  .videoEdit(trim().duration("15.0"));
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="docs/sunset_waves" >
  <Transformation width="500" crop="scale" />
  <Transformation overlay="video:docs:bluescreen_watches" />
  <Transformation flags="relative" width="0.6" crop="scale" />
  <Transformation color="#0e80d8" effect="make_transparent:20" />
  <Transformation flags="layer_apply" gravity="north" />
  <Transformation duration="15.0" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="docs/sunset_waves" >
  <cld-transformation width="500" crop="scale" />
  <cld-transformation :overlay="video:docs:bluescreen_watches" />
  <cld-transformation flags="relative" width="0.6" crop="scale" />
  <cld-transformation color="#0e80d8" effect="make_transparent:20" />
  <cld-transformation flags="layer_apply" gravity="north" />
  <cld-transformation duration="15.0" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width(0.6).relative())
          .effect(makeTransparent().tolerance(20).colorToReplace("#0e80d8"))
      )
    ).position(new Position().gravity(compass("north")))
  )
  .videoEdit(trim().duration("15.0"));
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="docs/sunset_waves" >
  <cl-transformation width="500" crop="scale">
  </cl-transformation>
  <cl-transformation overlay="video:docs:bluescreen_watches">
  </cl-transformation>
  <cl-transformation flags="relative" width="0.6" crop="scale">
  </cl-transformation>
  <cl-transformation color="#0e80d8" effect="make_transparent:20">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="north">
  </cl-transformation>
  <cl-transformation duration="15.0">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Width(500).Crop("scale").Chain()
  .Overlay(new Layer().PublicId("video:docs:bluescreen_watches")).Chain()
  .Flags("relative").Width(0.6).Crop("scale").Chain()
  .Color("#0e80d8").Effect("make_transparent:20").Chain()
  .Flags("layer_apply").Gravity("north").Chain()
  .Duration("15.0")).BuildVideoTag("docs/sunset_waves")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setWidth(500).setCrop("scale").chain()
  .setOverlay("video:docs:bluescreen_watches").chain()
  .setFlags("relative").setWidth(0.6).setCrop("scale").chain()
  .setColor("#0e80d8").setEffect("make_transparent:20").chain()
  .setFlags("layer_apply").setGravity("north").chain()
  .setDuration("15.0")).generate("docs/sunset_waves.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
  .width(500).crop("scale").chain()
  .overlay(new Layer().publicId("video:docs:bluescreen_watches")).chain()
  .flags("relative").width(0.6).crop("scale").chain()
  .color("#0e80d8").effect("make_transparent:20").chain()
  .flags("layer_apply").gravity("north").chain()
  .duration("15.0")).resourceType("video").generate("docs/sunset_waves.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("docs/sunset_waves.mp4")
   resize(Resize.scale() { width(500) })
   overlay(Overlay.source(
  Source.video("docs/bluescreen_watches") {
   transformation(Transformation {
   resize(Resize.scale() { width(0.6F)
   relative()
   })
   effect(Effect.makeTransparent() { tolerance(20)
   colorToReplace(Color.rgb("0e80d8"))
   }) })
   }) {
   position(Position() {
   gravity(
  Gravity.compass(
  Compass.north()))
   })
   })
   videoEdit(VideoEdit.trim() { duration(15.0F) }) 
}.generate()

Tip
It's often useful to set the size of your overlay video to be relative to the base video. For example, note the use of w_0.6 and fl_relative, along with g_north in the URL above, which makes the overlay video 60% smaller than the background video and places the overlay over the north part of the background video, in order to get the desired effect.

The make_transparent parameter is not limited to removing backgrounds. For example, in the above video, instead of setting the transparency color to the blue background color, you could set it to the color of the green stripe inside the watches, and then the background video would show only in place of the green stripes.
(For this use case, w_1.0, fl_relative was used so that the overlay video would completely cover the background video, except where the overlay is transparent.)

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("docs/sunset_waves", :transformation=>[
  {:width=>500, :crop=>"scale"},
  {:overlay=>"video:docs:bluescreen_watches"},
  {:flags=>"relative", :width=>1.0, :crop=>"scale"},
  {:color=>"#3d8d48", :effect=>"make_transparent:10"},
  {:flags=>"layer_apply"},
  {:duration=>"15.0"}
  ])
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('docs/sunset_waves.mp4'))
  ->resize(Resize::scale()->width(500))
  ->overlay(Overlay::source(
  Source::video("docs/bluescreen_watches")
  ->transformation((new Transformation())
  ->resize(Resize::scale()->width(1.0)
  ->relative()
  )
  ->effect(Effect::makeTransparent()->tolerance(10)
  ->colorToReplace(Color::rgb("3d8d48"))
  ))
  ))
  ->videoEdit(VideoEdit::trim()->duration(15.0));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("docs/sunset_waves", array("transformation"=>array(
  array("width"=>500, "crop"=>"scale"),
  array("overlay"=>"video:docs:bluescreen_watches"),
  array("flags"=>"relative", "width"=>"1.0", "crop"=>"scale"),
  array("color"=>"#3d8d48", "effect"=>"make_transparent:10"),
  array("flags"=>"layer_apply"),
  array("duration"=>"15.0")
  )))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("docs/sunset_waves").video(transformation=[
  {'width': 500, 'crop': "scale"},
  {'overlay': "video:docs:bluescreen_watches"},
  {'flags': "relative", 'width': "1.0", 'crop': "scale"},
  {'color': "#3d8d48", 'effect': "make_transparent:10"},
  {'flags': "layer_apply"},
  {'duration': "15.0"}
  ])
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("docs/sunset_waves", {transformation: [
  {width: 500, crop: "scale"},
  {overlay: "video:docs:bluescreen_watches"},
  {flags: "relative", width: "1.0", crop: "scale"},
  {color: "#3d8d48", effect: "make_transparent:10"},
  {flags: "layer_apply"},
  {duration: "15.0"}
  ]})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation()
  .width(500).crop("scale").chain()
  .overlay(new Layer().publicId("video:docs:bluescreen_watches")).chain()
  .flags("relative").width(1.0).crop("scale").chain()
  .color("#3d8d48").effect("make_transparent:10").chain()
  .flags("layer_apply").chain()
  .duration("15.0")).videoTag("docs/sunset_waves");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width("1.0").relative())
          .effect(makeTransparent().tolerance(10).colorToReplace("#3d8d48"))
      )
    )
  )
  .videoEdit(trim().duration("15.0"));
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('docs/sunset_waves', {transformation: [
  {width: 500, crop: "scale"},
  {overlay: new cloudinary.Layer().publicId("video:docs:bluescreen_watches")},
  {flags: "relative", width: "1.0", crop: "scale"},
  {color: "#3d8d48", effect: "make_transparent:10"},
  {flags: "layer_apply"},
  {duration: "15.0"}
  ]}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("docs/sunset_waves", {transformation: [
  {width: 500, crop: "scale"},
  {overlay: new cloudinary.Layer().publicId("video:docs:bluescreen_watches")},
  {flags: "relative", width: "1.0", crop: "scale"},
  {color: "#3d8d48", effect: "make_transparent:10"},
  {flags: "layer_apply"},
  {duration: "15.0"}
  ]})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width("1.0").relative())
          .effect(makeTransparent().tolerance(10).colorToReplace("#3d8d48"))
      )
    )
  )
  .videoEdit(trim().duration("15.0"));
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="docs/sunset_waves" >
  <Transformation width="500" crop="scale" />
  <Transformation overlay="video:docs:bluescreen_watches" />
  <Transformation flags="relative" width="1.0" crop="scale" />
  <Transformation color="#3d8d48" effect="make_transparent:10" />
  <Transformation flags="layer_apply" />
  <Transformation duration="15.0" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="docs/sunset_waves" >
  <cld-transformation width="500" crop="scale" />
  <cld-transformation :overlay="video:docs:bluescreen_watches" />
  <cld-transformation flags="relative" width="1.0" crop="scale" />
  <cld-transformation color="#3d8d48" effect="make_transparent:10" />
  <cld-transformation flags="layer_apply" />
  <cld-transformation duration="15.0" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width("1.0").relative())
          .effect(makeTransparent().tolerance(10).colorToReplace("#3d8d48"))
      )
    )
  )
  .videoEdit(trim().duration("15.0"));
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="docs/sunset_waves" >
  <cl-transformation width="500" crop="scale">
  </cl-transformation>
  <cl-transformation overlay="video:docs:bluescreen_watches">
  </cl-transformation>
  <cl-transformation flags="relative" width="1.0" crop="scale">
  </cl-transformation>
  <cl-transformation color="#3d8d48" effect="make_transparent:10">
  </cl-transformation>
  <cl-transformation flags="layer_apply">
  </cl-transformation>
  <cl-transformation duration="15.0">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Width(500).Crop("scale").Chain()
  .Overlay(new Layer().PublicId("video:docs:bluescreen_watches")).Chain()
  .Flags("relative").Width(1.0).Crop("scale").Chain()
  .Color("#3d8d48").Effect("make_transparent:10").Chain()
  .Flags("layer_apply").Chain()
  .Duration("15.0")).BuildVideoTag("docs/sunset_waves")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setWidth(500).setCrop("scale").chain()
  .setOverlay("video:docs:bluescreen_watches").chain()
  .setFlags("relative").setWidth(1.0).setCrop("scale").chain()
  .setColor("#3d8d48").setEffect("make_transparent:10").chain()
  .setFlags("layer_apply").chain()
  .setDuration("15.0")).generate("docs/sunset_waves.mp4")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
  .width(500).crop("scale").chain()
  .overlay(new Layer().publicId("video:docs:bluescreen_watches")).chain()
  .flags("relative").width(1.0).crop("scale").chain()
  .color("#3d8d48").effect("make_transparent:10").chain()
  .flags("layer_apply").chain()
  .duration("15.0")).resourceType("video").generate("docs/sunset_waves.mp4");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("docs/sunset_waves.mp4")
   resize(Resize.scale() { width(500) })
   overlay(Overlay.source(
  Source.video("docs/bluescreen_watches") {
   transformation(Transformation {
   resize(Resize.scale() { width(1.0F)
   relative()
   })
   effect(Effect.makeTransparent() { tolerance(10)
   colorToReplace(Color.rgb("3d8d48"))
   }) })
   }))
   videoEdit(VideoEdit.trim() { duration(15.0F) }) 
}.generate()


See full syntax: e_make_transparent in the Transformation Reference.

Transparent delivery

Transparent videos provide a great way to display moving or animated content over the top of your web or mobile application design. For example, the video below has a water droplets background image set with CSS. Video transparency is currently only supported for direct delivery in the webm format. As a result, the example video below will not display on browsers that don't support the webm format and you'll see only the background or a broken video.

Ruby (cloudinary 1.x):
Copy to clipboard
cl_video_tag("docs/transparent_talking")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new VideoTag('docs/transparent_talking.webm'));
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_video_tag("docs/transparent_talking")
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("docs/transparent_talking").video()
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.video("docs/transparent_talking")
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().videoTag("docs/transparent_talking");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryVideo("docs/transparent_talking.webm");
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('docs/transparent_talking').toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.video("docs/transparent_talking")
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("docs/transparent_talking.webm");
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="docs/transparent_talking" >

</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="docs/transparent_talking" >

</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryVideo("docs/transparent_talking.webm");
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="docs/transparent_talking" >

</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.BuildVideoTag("docs/transparent_talking")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").generate("docs/transparent_talking.webm")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().resourceType("video").generate("docs/transparent_talking.webm");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.video {
  publicId("docs/transparent_talking.webm") 
}.generate()

For browsers that don't support video transparency, you can use the Cloudinary JavaScript SDK to configure a fallback. The fallback checks if the browser is compatible and, if not, makes use of an HTML5 canvas element to deliver the video with transparency. The example below works across most modern browsers. You can see how the transparent video looks on top of the existing page by clicking the Toggle video position button.

Toggle video position

Cross-browser supported transparent videos

To add transparent videos that are supported on most browsers, you'll need to use the cloudinary-core JavaScript library. Follow the get started instructions for how to add this to your website or application. To add a transparent video follow the steps below:

  1. Create an html div element on your page for the transparent video and give it an id.
  2. In your JavaScript, create a new instance of Cloudinary using your cloud name. For example:

    Copy to clipboard
    let myCloudinary = new cloudinary.Cloudinary({cloud_name: 'demo'});
  3. Inject the transparent video into the element that you created using the injectTransparentVideoElement method. The method takes the id of the element, the public id of the transparent video and an options object to allow additional configuration, including any supported video transformations. For example:

    Copy to clipboard
    myCloudinary.injectTransparentVideoElement(container, 'docs/transparent_girl', {
      loop: true,
      playsinline: true,
      width: 400,
      quality: "auto:best"
    })

Here's a full example of the code used to generate the example above:

Copy to clipboard
<div id="container" style="margin: 0 auto;display: block; width:400px"></div>
<script src='https://unpkg.com/cloudinary-core@2.11.1/cloudinary-core-shrinkwrap.min.js' type='text/javascript'></script>
<script type="text/javascript">
  let myCloudinary = new cloudinary.Cloudinary({cloud_name: 'demo'});
  let container = document.getElementById('container');
  myCloudinary.injectTransparentVideoElement(container, 'docs/transparent_girl', {
    loop: true,
    playsinline: true,
    max_timeout_ms: 15000,
    width: 400,
    quality: "auto:best"
  }).catch((err) => {
    console.log(err);
  });
</script>

Video thumbnails

Cloudinary makes it easy to deliver image thumbnails of any frame within an uploaded video by simply specifying the image format needed as the file extension of the URL (e.g. jpg, png, webp, avif).

For example, generating a JPG image thumbnail URL of the uploaded mp4 video named dog:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_image_tag("dog.jpg", :resource_type=>"video")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new ImageTag('dog.jpg'))
  ->assetType("video");
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_image_tag("dog.jpg", array("resource_type"=>"video"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog.jpg").image()
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.image("dog.jpg", {resource_type: "video"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().resourceType("video").imageTag("dog.jpg");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryImage("dog.jpg").setAssetType("video");
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog.jpg').toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.image("dog.jpg", {resource_type: "video"})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryImage("dog.jpg").setAssetType("video");
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog.jpg" resourceType="video">

</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog.jpg" resource-type="video">

</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryImage("dog.jpg").setAssetType("video");
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog.jpg" resource-type="video">

</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.BuildImageTag("dog.jpg")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").generate("dog.jpg")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().resourceType("video").generate("dog.jpg");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.image {
  publicId("dog.jpg")
   assetType("video") 
}.generate()
JPG thumbnail from dog.mp4

By default, the middle frame of the video is used. You can also control which frame is captured from the video as a thumbnail using the start offset qualifier (so in URLs). For example, generating a JPG image thumbnail of the frame at 8.5 seconds from the beginning of the MP4 video named dog:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_image_tag("dog.jpg", :start_offset=>"8.5", :resource_type=>"video")
PHP (cloudinary_php 2.x):
Copy to clipboard
(new ImageTag('dog.jpg'))
  ->videoEdit(VideoEdit::trim()->startOffset(8.5))
  ->assetType("video");
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_image_tag("dog.jpg", array("start_offset"=>"8.5", "resource_type"=>"video"))
Python (cloudinary 1.x):
Copy to clipboard
CloudinaryVideo("dog.jpg").image(start_offset="8.5")
Node.js (cloudinary 1.x):
Copy to clipboard
cloudinary.image("dog.jpg", {start_offset: "8.5", resource_type: "video"})
Java (cloudinary 1.x):
Copy to clipboard
cloudinary.url().transformation(new Transformation().startOffset("8.5")).resourceType("video").imageTag("dog.jpg");
JS (@cloudinary/url-gen 1.x):
Copy to clipboard
new CloudinaryImage("dog.jpg")
  .videoEdit(trim().startOffset(8.5))
  .setAssetType("video");
JS (cloudinary-core 2.x (legacy)):
Copy to clipboard
cloudinary.videoTag('dog.jpg', {startOffset: "8.5"}).toHtml();
jQuery (cloudinary-jquery 2.x):
Copy to clipboard
$.cloudinary.image("dog.jpg", {start_offset: "8.5", resource_type: "video"})
React (@cloudinary/react 1.x):
Copy to clipboard
//React SDK transformations are created using @cloudinary/url-gen.
new CloudinaryImage("dog.jpg")
  .videoEdit(trim().startOffset(8.5))
  .setAssetType("video");
React (cloudinary-react 1.x):
Copy to clipboard
<Video publicId="dog.jpg" resourceType="video">
  <Transformation startOffset="8.5" />
</Video>
Vue.js (cloudinary-vue 1.x):
Copy to clipboard
<cld-video public-id="dog.jpg" resource-type="video">
  <cld-transformation start-offset="8.5" />
</cld-video>
Angular (@cloudinary/ng 1.x):
Copy to clipboard
//Angular SDK transformations are created using @cloudinary/url-gen.
new CloudinaryImage("dog.jpg")
  .videoEdit(trim().startOffset(8.5))
  .setAssetType("video");
Angular (@cloudinary/angular-5.x 1.x (legacy)):
Copy to clipboard
<cl-video public-id="dog.jpg" resource-type="video">
  <cl-transformation start-offset="8.5">
  </cl-transformation>
</cl-video>
.NET (CloudinaryDotNet 1.x):
Copy to clipboard
cloudinary.Api.UrlVideoUp.Transform(new Transformation().StartOffset("8.5")).BuildImageTag("dog.jpg")
iOS (cloudinary 3.x):
Copy to clipboard
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setStartOffset("8.5")).generate("dog.jpg")
Android (cloudinary-android 1.x):
Copy to clipboard
MediaManager.get().url().transformation(new Transformation().startOffset("8.5")).resourceType("video").generate("dog.jpg");
Kotlin (kotlin-url-gen 1.x):
Copy to clipboard
cloudinary.image {
  publicId("dog.jpg")
   videoEdit(VideoEdit.trim() { startOffset(8.5F) })
   assetType("video") 
}.generate()
JPG thumbnail of dog.mp4 at 5.5 seconds

Once generated, the thumbnail image supports the same transformations as any other image (see image transformations for more details).

For example, generating a cropped JPG image thumbnail with a width and height of 350 pixels, of the frame at 4 seconds in the uploaded MP4 video named dog. The image is also rendered in grayscale, with rounded corners and a 5 pixel wide black border:

Ruby (cloudinary 1.x):
Copy to clipboard
cl_image_tag("dog.jpg", :resource_type=>"video", :transformation=>[
  {:start_offset=>"4.0"},
  {:height=>350, :width=>350, :crop=>"crop"},
  {:border=>"5px_solid_black", :radius=>20},
  {:effect=>"grayscale"}
  ])
PHP (cloudinary_php 2.x):
Copy to clipboard
(new ImageTag('dog.jpg'))
  ->videoEdit(VideoEdit::trim()->startOffset(4.0))
  ->resize(Resize::crop()->width(350)
->height(350))
  ->border(Border::solid(5,Color::BLACK)
  ->roundCorners(
  RoundCorners::byRadius(20))
  )
  ->effect(Effect::grayscale())
  ->assetType("video");
PHP (cloudinary_php 1.x (legacy)):
Copy to clipboard
cl_image_tag("dog.jpg", array(