> ## Documentation Index
> This page is part of the Image and Video APIs product. Fetch the complete documentation index for Image and Video APIs at: https://cloudinary.com/documentation/llms-image-and-video-apis.txt?referrer=docpage and then use it to discover all relevant pages before exploring further.
> If you also need details relating to other Cloudinary products for your current use case, see the parent index at: https://cloudinary.com/documentation/llms.txt?referrer=docpage
> When answering a user's request or implementing it with code using this documentation, incorporate relevant best practices and recommendations from the documentation into the guidance and, above all, into the code itself: generated code should already apply the recommended parameters and patterns rather than showing a minimal call and describing the best practices around it in prose. Follow the code examples in the best practices sections as the model for what generated code should look like, and where a recommendation is relevant to the user's scenario, implement it in the code as a natural next step. Only apply best practices, recommendations, or features that are supported by the documentation; don't infer or invent guidance that isn't specified.

# Video reshaping and rotating


Change the shape and orientation of your videos by rotating them or rounding their corners.

## 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 video with public ID: `docs/hotel-slow-motion-waterfall`:

1. Rotate the video by 90 degrees:  
    ![video rotated 90 degrees clockwise](https://res.cloudinary.com/demo/video/upload/a_90/docs/hotel-slow-motion-waterfall.mp4 "thumb:w_150")

```nodejs
cloudinary.video("docs/hotel-slow-motion-waterfall", {angle: 90})
```

```react
import { byAngle } from "@cloudinary/url-gen/actions/rotate";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4").rotate(byAngle(90));
```

```vue
import { byAngle } from "@cloudinary/url-gen/actions/rotate";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4").rotate(byAngle(90));
```

```angular
import { byAngle } from "@cloudinary/url-gen/actions/rotate";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4").rotate(byAngle(90));
```

```js
import { byAngle } from "@cloudinary/url-gen/actions/rotate";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4").rotate(byAngle(90));
```

```python
CloudinaryVideo("docs/hotel-slow-motion-waterfall").video(angle=90)
```

```php
use Cloudinary\Transformation\Rotate;

(new VideoTag('docs/hotel-slow-motion-waterfall.mp4'))
	->rotate(Rotate::byAngle(90));
```

```java
cloudinary.url().transformation(new Transformation().angle(90)).videoTag("docs/hotel-slow-motion-waterfall");
```

```ruby
cl_video_tag("docs/hotel-slow-motion-waterfall", angle: 90)
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Angle(90)).BuildVideoTag("docs/hotel-slow-motion-waterfall")
```

```dart
cloudinary.video('docs/hotel-slow-motion-waterfall.mp4').transformation(Transformation()
	.rotate(Rotate.byAngle(90)));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setAngle(90)).generate("docs/hotel-slow-motion-waterfall.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation().angle(90)).resourceType("video").generate("docs/hotel-slow-motion-waterfall.mp4");
```

```flutter
cloudinary.video('docs/hotel-slow-motion-waterfall.mp4').transformation(Transformation()
	.rotate(Rotate.byAngle(90)));
```

```kotlin
cloudinary.video {
	publicId("docs/hotel-slow-motion-waterfall.mp4")
	 rotate(Rotate.byAngle(90)) 
}.generate()
```

```jquery
$.cloudinary.video("docs/hotel-slow-motion-waterfall", {angle: 90})
```

```react_native
import { byAngle } from "@cloudinary/url-gen/actions/rotate";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4").rotate(byAngle(90));
```
1. Rotate the video by -20 degrees (automatically adds a bounding box):  
    ![video rotated 20 degrees counterclockwise](https://res.cloudinary.com/demo/video/upload/a_-20/docs/hotel-slow-motion-waterfall.mp4 "thumb:w_200")

```nodejs
cloudinary.video("docs/hotel-slow-motion-waterfall", {angle: -20})
```

```react
import { byAngle } from "@cloudinary/url-gen/actions/rotate";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4").rotate(
  byAngle(-20)
);
```

```vue
import { byAngle } from "@cloudinary/url-gen/actions/rotate";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4").rotate(
  byAngle(-20)
);
```

```angular
import { byAngle } from "@cloudinary/url-gen/actions/rotate";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4").rotate(
  byAngle(-20)
);
```

```js
import { byAngle } from "@cloudinary/url-gen/actions/rotate";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4").rotate(
  byAngle(-20)
);
```

```python
CloudinaryVideo("docs/hotel-slow-motion-waterfall").video(angle=-20)
```

```php
use Cloudinary\Transformation\Rotate;

(new VideoTag('docs/hotel-slow-motion-waterfall.mp4'))
	->rotate(Rotate::byAngle(-20));
```

```java
cloudinary.url().transformation(new Transformation().angle(-20)).videoTag("docs/hotel-slow-motion-waterfall");
```

```ruby
cl_video_tag("docs/hotel-slow-motion-waterfall", angle: -20)
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Angle(-20)).BuildVideoTag("docs/hotel-slow-motion-waterfall")
```

```dart
cloudinary.video('docs/hotel-slow-motion-waterfall.mp4').transformation(Transformation()
	.rotate(Rotate.byAngle(-20)));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setAngle(-20)).generate("docs/hotel-slow-motion-waterfall.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation().angle(-20)).resourceType("video").generate("docs/hotel-slow-motion-waterfall.mp4");
```

```flutter
cloudinary.video('docs/hotel-slow-motion-waterfall.mp4').transformation(Transformation()
	.rotate(Rotate.byAngle(-20)));
```

```kotlin
cloudinary.video {
	publicId("docs/hotel-slow-motion-waterfall.mp4")
	 rotate(Rotate.byAngle(-20)) 
}.generate()
```

```jquery
$.cloudinary.video("docs/hotel-slow-motion-waterfall", {angle: -20})
```

```react_native
import { byAngle } from "@cloudinary/url-gen/actions/rotate";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4").rotate(
  byAngle(-20)
);
```
1. Vertically mirror flip the video and rotate by 45 degrees (automatically adds a bounding box):  
    ![video vertically flipped and rotated 45 degrees clockwise](https://res.cloudinary.com/demo/video/upload/a_vflip.45/docs/hotel-slow-motion-waterfall.mp4  "thumb:w_200")

```nodejs
cloudinary.video("docs/hotel-slow-motion-waterfall", {angle: ["vflip", 45]})
```

```react
import { mode, byAngle } from "@cloudinary/url-gen/actions/rotate";
import { verticalFlip } from "@cloudinary/url-gen/qualifiers/rotationMode";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4")
  .rotate(mode(verticalFlip()))
  .rotate(byAngle(45));
```

```vue
import { mode, byAngle } from "@cloudinary/url-gen/actions/rotate";
import { verticalFlip } from "@cloudinary/url-gen/qualifiers/rotationMode";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4")
  .rotate(mode(verticalFlip()))
  .rotate(byAngle(45));
```

```angular
import { mode, byAngle } from "@cloudinary/url-gen/actions/rotate";
import { verticalFlip } from "@cloudinary/url-gen/qualifiers/rotationMode";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4")
  .rotate(mode(verticalFlip()))
  .rotate(byAngle(45));
```

```js
import { mode, byAngle } from "@cloudinary/url-gen/actions/rotate";
import { verticalFlip } from "@cloudinary/url-gen/qualifiers/rotationMode";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4")
  .rotate(mode(verticalFlip()))
  .rotate(byAngle(45));
```

```python
CloudinaryVideo("docs/hotel-slow-motion-waterfall").video(angle=["vflip", 45])
```

```php
use Cloudinary\Transformation\Rotate;
use Cloudinary\Transformation\RotationMode;

(new VideoTag('docs/hotel-slow-motion-waterfall.mp4'))
	->rotate(Rotate::mode(
	RotationMode::verticalFlip()))
	->rotate(Rotate::byAngle(45));
```

```java
cloudinary.url().transformation(new Transformation().angle("vflip", "45")).videoTag("docs/hotel-slow-motion-waterfall");
```

```ruby
cl_video_tag("docs/hotel-slow-motion-waterfall", angle: ["vflip", 45])
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Angle("vflip", "45")).BuildVideoTag("docs/hotel-slow-motion-waterfall")
```

```dart
cloudinary.video('docs/hotel-slow-motion-waterfall.mp4').transformation(Transformation()
	.rotate(Rotate.mode(
	RotationMode.verticalFlip()))
	.rotate(Rotate.byAngle(45)));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setAngle("vflip", "45")).generate("docs/hotel-slow-motion-waterfall.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation().angle("vflip", "45")).resourceType("video").generate("docs/hotel-slow-motion-waterfall.mp4");
```

```flutter
cloudinary.video('docs/hotel-slow-motion-waterfall.mp4').transformation(Transformation()
	.rotate(Rotate.mode(
	RotationMode.verticalFlip()))
	.rotate(Rotate.byAngle(45)));
```

```kotlin
cloudinary.video {
	publicId("docs/hotel-slow-motion-waterfall.mp4")
	 rotate(Rotate.mode(
	RotationMode.verticalFlip()))
	 rotate(Rotate.byAngle(45)) 
}.generate()
```

```jquery
$.cloudinary.video("docs/hotel-slow-motion-waterfall", {angle: ["vflip", 45]})
```

```react_native
import { mode, byAngle } from "@cloudinary/url-gen/actions/rotate";
import { verticalFlip } from "@cloudinary/url-gen/qualifiers/rotationMode";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4")
  .rotate(mode(verticalFlip()))
  .rotate(byAngle(45));
```
1. Crop the video to a 1:1 aspect ratio circle, then rotate the video by 30 degrees (automatically adds a bounding box) and finally trim the extra whitespace that was added:
    ![video cropped to a 200x200 circle, rotated 30 degrees clockwise and trimmed](https://res.cloudinary.com/demo/video/upload/c_fill,ar_1.0/r_max/a_30/e_trim/docs/hotel-slow-motion-waterfall.mp4  "thumb:w_200")

```nodejs
cloudinary.video("docs/hotel-slow-motion-waterfall", {transformation: [
  {aspect_ratio: "1.0", crop: "fill"},
  {radius: "max"},
  {angle: 30},
  {effect: "trim"}
  ]})
```

```react
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";
import { byAngle } from "@cloudinary/url-gen/actions/rotate";
import { trim } from "@cloudinary/url-gen/actions/reshape";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4")
  .resize(fill().aspectRatio("1.0"))
  .roundCorners(max())
  .rotate(byAngle(30))
  .reshape(trim());
```

```vue
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";
import { byAngle } from "@cloudinary/url-gen/actions/rotate";
import { trim } from "@cloudinary/url-gen/actions/reshape";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4")
  .resize(fill().aspectRatio("1.0"))
  .roundCorners(max())
  .rotate(byAngle(30))
  .reshape(trim());
```

```angular
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";
import { byAngle } from "@cloudinary/url-gen/actions/rotate";
import { trim } from "@cloudinary/url-gen/actions/reshape";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4")
  .resize(fill().aspectRatio("1.0"))
  .roundCorners(max())
  .rotate(byAngle(30))
  .reshape(trim());
```

```js
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";
import { byAngle } from "@cloudinary/url-gen/actions/rotate";
import { trim } from "@cloudinary/url-gen/actions/reshape";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4")
  .resize(fill().aspectRatio("1.0"))
  .roundCorners(max())
  .rotate(byAngle(30))
  .reshape(trim());
```

```python
CloudinaryVideo("docs/hotel-slow-motion-waterfall").video(transformation=[
  {'aspect_ratio': "1.0", 'crop': "fill"},
  {'radius': "max"},
  {'angle': 30},
  {'effect': "trim"}
  ])
```

```php
use Cloudinary\Transformation\Resize;
use Cloudinary\Transformation\RoundCorners;
use Cloudinary\Transformation\Rotate;
use Cloudinary\Transformation\Reshape;

(new VideoTag('docs/hotel-slow-motion-waterfall.mp4'))
	->resize(Resize::fill()->aspectRatio(1.0))
	->roundCorners(RoundCorners::max())
	->rotate(Rotate::byAngle(30))
	->reshape(Reshape::trim());
```

```java
cloudinary.url().transformation(new Transformation()
  .aspectRatio("1.0").crop("fill").chain()
  .radius("max").chain()
  .angle(30).chain()
  .effect("trim")).videoTag("docs/hotel-slow-motion-waterfall");
```

```ruby
cl_video_tag("docs/hotel-slow-motion-waterfall", transformation: [
  {aspect_ratio: "1.0", crop: "fill"},
  {radius: "max"},
  {angle: 30},
  {effect: "trim"}
  ])
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .AspectRatio("1.0").Crop("fill").Chain()
  .Radius("max").Chain()
  .Angle(30).Chain()
  .Effect("trim")).BuildVideoTag("docs/hotel-slow-motion-waterfall")
```

```dart
cloudinary.video('docs/hotel-slow-motion-waterfall.mp4').transformation(Transformation()
	.resize(Resize.fill().aspectRatio('1.0'))
	.roundCorners(RoundCorners.max())
	.rotate(Rotate.byAngle(30))
	.reshape(Reshape.trim()));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setAspectRatio("1.0").setCrop("fill").chain()
  .setRadius("max").chain()
  .setAngle(30).chain()
  .setEffect("trim")).generate("docs/hotel-slow-motion-waterfall.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation()
  .aspectRatio("1.0").crop("fill").chain()
  .radius("max").chain()
  .angle(30).chain()
  .effect("trim")).resourceType("video").generate("docs/hotel-slow-motion-waterfall.mp4");
```

```flutter
cloudinary.video('docs/hotel-slow-motion-waterfall.mp4').transformation(Transformation()
	.addTransformation("c_fill,ar_1.0/r_max/a_30/e_trim"));
```

```kotlin
cloudinary.video {
	publicId("docs/hotel-slow-motion-waterfall.mp4")
	 resize(Resize.fill() { aspectRatio(1.0F) })
	 roundCorners(RoundCorners.max())
	 rotate(Rotate.byAngle(30))
	 reshape(Reshape.trim()) 
}.generate()
```

```jquery
$.cloudinary.video("docs/hotel-slow-motion-waterfall", {transformation: [
  {aspect_ratio: "1.0", crop: "fill"},
  {radius: "max"},
  {angle: 30},
  {effect: "trim"}
  ]})
```

```react_native
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";
import { byAngle } from "@cloudinary/url-gen/actions/rotate";
import { trim } from "@cloudinary/url-gen/actions/reshape";

new CloudinaryVideo("docs/hotel-slow-motion-waterfall.mp4")
  .resize(fill().aspectRatio("1.0"))
  .roundCorners(max())
  .rotate(byAngle(30))
  .reshape(trim());
```

**See full syntax**: [a (angle)](transformation_reference#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, resizing the video to a width of 300 pixels and with rounded corners set to a radius of 30 pixels:

![Video with rounded corners set to 30 pixels](https://res.cloudinary.com/demo/video/upload/c_scale,w_300/r_30/docs/van-driving-mountain-road.mp4 "poster: https://res.cloudinary.com/demo/video/upload/c_scale,w_300/r_30/f_auto/fl_preserve_transparency/v1/docs/van-driving-mountain-road")

```nodejs
cloudinary.video("docs/van-driving-mountain-road", {transformation: [
  {width: 300, crop: "scale"},
  {radius: 30}
  ]})
```

```react
import { scale } from "@cloudinary/url-gen/actions/resize";
import { byRadius } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(scale().width(300))
  .roundCorners(byRadius(30));
```

```vue
import { scale } from "@cloudinary/url-gen/actions/resize";
import { byRadius } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(scale().width(300))
  .roundCorners(byRadius(30));
```

```angular
import { scale } from "@cloudinary/url-gen/actions/resize";
import { byRadius } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(scale().width(300))
  .roundCorners(byRadius(30));
```

```js
import { scale } from "@cloudinary/url-gen/actions/resize";
import { byRadius } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(scale().width(300))
  .roundCorners(byRadius(30));
```

```python
CloudinaryVideo("docs/van-driving-mountain-road").video(transformation=[
  {'width': 300, 'crop': "scale"},
  {'radius': 30}
  ])
```

```php
use Cloudinary\Transformation\Resize;
use Cloudinary\Transformation\RoundCorners;

(new VideoTag('docs/van-driving-mountain-road.mp4'))
	->resize(Resize::scale()->width(300))
	->roundCorners(RoundCorners::byRadius(30));
```

```java
cloudinary.url().transformation(new Transformation()
  .width(300).crop("scale").chain()
  .radius(30)).videoTag("docs/van-driving-mountain-road");
```

```ruby
cl_video_tag("docs/van-driving-mountain-road", transformation: [
  {width: 300, crop: "scale"},
  {radius: 30}
  ])
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Width(300).Crop("scale").Chain()
  .Radius(30)).BuildVideoTag("docs/van-driving-mountain-road")
```

```dart
cloudinary.video('docs/van-driving-mountain-road.mp4').transformation(Transformation()
	.resize(Resize.scale().width(300))
	.roundCorners(RoundCorners.byRadius(30)));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setWidth(300).setCrop("scale").chain()
  .setRadius(30)).generate("docs/van-driving-mountain-road.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation()
  .width(300).crop("scale").chain()
  .radius(30)).resourceType("video").generate("docs/van-driving-mountain-road.mp4");
```

```flutter
cloudinary.video('docs/van-driving-mountain-road.mp4').transformation(Transformation()
	.addTransformation("c_scale,w_300/r_30"));
```

```kotlin
cloudinary.video {
	publicId("docs/van-driving-mountain-road.mp4")
	 resize(Resize.scale() { width(300) })
	 roundCorners(RoundCorners.byRadius(30)) 
}.generate()
```

```jquery
$.cloudinary.video("docs/van-driving-mountain-road", {transformation: [
  {width: 300, crop: "scale"},
  {radius: 30}
  ]})
```

```react_native
import { scale } from "@cloudinary/url-gen/actions/resize";
import { byRadius } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(scale().width(300))
  .roundCorners(byRadius(30));
```

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

![Video with rounded corners set to max](https://res.cloudinary.com/demo/video/upload/c_fill,h_300,w_300/r_max/docs/van-driving-mountain-road.mp4 "poster: https://res.cloudinary.com/demo/video/upload/c_fill,h_300,w_300/r_max//f_auto/fl_preserve_transparency/docs/van-driving-mountain-road")

```nodejs
cloudinary.video("docs/van-driving-mountain-road", {transformation: [
  {height: 300, width: 300, crop: "fill"},
  {radius: "max"}
  ]})
```

```react
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(fill().width(300).height(300))
  .roundCorners(max());
```

```vue
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(fill().width(300).height(300))
  .roundCorners(max());
```

```angular
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(fill().width(300).height(300))
  .roundCorners(max());
```

```js
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(fill().width(300).height(300))
  .roundCorners(max());
```

```python
CloudinaryVideo("docs/van-driving-mountain-road").video(transformation=[
  {'height': 300, 'width': 300, 'crop': "fill"},
  {'radius': "max"}
  ])
```

```php
use Cloudinary\Transformation\Resize;
use Cloudinary\Transformation\RoundCorners;

(new VideoTag('docs/van-driving-mountain-road.mp4'))
	->resize(Resize::fill()->width(300)
->height(300))
	->roundCorners(RoundCorners::max());
```

```java
cloudinary.url().transformation(new Transformation()
  .height(300).width(300).crop("fill").chain()
  .radius("max")).videoTag("docs/van-driving-mountain-road");
```

```ruby
cl_video_tag("docs/van-driving-mountain-road", transformation: [
  {height: 300, width: 300, crop: "fill"},
  {radius: "max"}
  ])
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Height(300).Width(300).Crop("fill").Chain()
  .Radius("max")).BuildVideoTag("docs/van-driving-mountain-road")
```

```dart
cloudinary.video('docs/van-driving-mountain-road.mp4').transformation(Transformation()
	.resize(Resize.fill().width(300)
.height(300))
	.roundCorners(RoundCorners.max()));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setHeight(300).setWidth(300).setCrop("fill").chain()
  .setRadius("max")).generate("docs/van-driving-mountain-road.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation()
  .height(300).width(300).crop("fill").chain()
  .radius("max")).resourceType("video").generate("docs/van-driving-mountain-road.mp4");
```

```flutter
cloudinary.video('docs/van-driving-mountain-road.mp4').transformation(Transformation()
	.addTransformation("c_fill,h_300,w_300/r_max"));
```

```kotlin
cloudinary.video {
	publicId("docs/van-driving-mountain-road.mp4")
	 resize(Resize.fill() { width(300)
 height(300) })
	 roundCorners(RoundCorners.max()) 
}.generate()
```

```jquery
$.cloudinary.video("docs/van-driving-mountain-road", {transformation: [
  {height: 300, width: 300, crop: "fill"},
  {radius: "max"}
  ]})
```

```react_native
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(fill().width(300).height(300))
  .roundCorners(max());
```

You can also change the background color of the video using the [background parameter](video_color_effects#background_color). 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, resizing the video to a width and height of 300 pixels, and with maximum radius cropping using a blue background:

![Video with dimensions set to the same value and rounded corners set to max](https://res.cloudinary.com/demo/video/upload/b_gray,c_fill,h_300,r_max,w_300/docs/van-driving-mountain-road.mp4)

```nodejs
cloudinary.video("docs/van-driving-mountain-road", {background: "gray", height: 300, radius: "max", width: 300, crop: "fill"})
```

```react
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(fill().width(300).height(300))
  .roundCorners(max())
  .backgroundColor("gray");
```

```vue
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(fill().width(300).height(300))
  .roundCorners(max())
  .backgroundColor("gray");
```

```angular
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(fill().width(300).height(300))
  .roundCorners(max())
  .backgroundColor("gray");
```

```js
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(fill().width(300).height(300))
  .roundCorners(max())
  .backgroundColor("gray");
```

```python
CloudinaryVideo("docs/van-driving-mountain-road").video(background="gray", height=300, radius="max", width=300, crop="fill")
```

```php
use Cloudinary\Transformation\Resize;
use Cloudinary\Transformation\RoundCorners;

(new VideoTag('docs/van-driving-mountain-road.mp4'))
	->resize(Resize::fill()->width(300)
->height(300))
	->roundCorners(RoundCorners::max())
	->backgroundColor(Color::GRAY);
```

```java
cloudinary.url().transformation(new Transformation().background("gray").height(300).radius("max").width(300).crop("fill")).videoTag("docs/van-driving-mountain-road");
```

```ruby
cl_video_tag("docs/van-driving-mountain-road", background: "gray", height: 300, radius: "max", width: 300, crop: "fill")
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Background("gray").Height(300).Radius("max").Width(300).Crop("fill")).BuildVideoTag("docs/van-driving-mountain-road")
```

```dart
cloudinary.video('docs/van-driving-mountain-road.mp4').transformation(Transformation()
	.resize(Resize.fill().width(300)
.height(300))
	.roundCorners(RoundCorners.max())
	.backgroundColor(Color.GRAY));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setBackground("gray").setHeight(300).setRadius("max").setWidth(300).setCrop("fill")).generate("docs/van-driving-mountain-road.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation().background("gray").height(300).radius("max").width(300).crop("fill")).resourceType("video").generate("docs/van-driving-mountain-road.mp4");
```

```flutter
cloudinary.video('docs/van-driving-mountain-road.mp4').transformation(Transformation()
	.addTransformation("b_gray,c_fill,h_300,r_max,w_300"));
```

```kotlin
cloudinary.video {
	publicId("docs/van-driving-mountain-road.mp4")
	 resize(Resize.fill() { width(300)
 height(300) })
	 roundCorners(RoundCorners.max())
	 backgroundColor(Color.GRAY) 
}.generate()
```

```jquery
$.cloudinary.video("docs/van-driving-mountain-road", {background: "gray", height: 300, radius: "max", width: 300, crop: "fill"})
```

```react_native
import { fill } from "@cloudinary/url-gen/actions/resize";
import { max } from "@cloudinary/url-gen/actions/roundCorners";

new CloudinaryVideo("docs/van-driving-mountain-road.mp4")
  .resize(fill().width(300).height(300))
  .roundCorners(max())
  .backgroundColor("gray");
```

The radius parameter is also used to round the corners of overlays, which are then also given a transparent background. For example, overlaying a man talking video with width and height set to 100 pixels, maximum radius cropping and north east gravity:

![video on video elipsoid overlay.mp4](https://res.cloudinary.com/demo/video/upload/c_scale,w_300/l_video:man_talking/c_fill,h_100,w_100/r_max/fl_layer_apply,g_north_east/man_on_phone.mp4)

```nodejs
cloudinary.video("man_on_phone", {transformation: [
  {width: 300, crop: "scale"},
  {overlay: "video:man_talking"},
  {height: 100, width: 100, crop: "fill"},
  {radius: "max"},
  {gravity: "north_east", flags: "layer_apply"}
  ]})
```

```react
import { scale, fill } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { max } from "@cloudinary/url-gen/actions/roundCorners";
import { video } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("man_on_phone.mp4")
  .resize(scale().width(300))
  .overlay(
    source(
      video("man_talking").transformation(
        new Transformation()
          .resize(fill().width(100).height(100))
          .roundCorners(max())
      )
    ).position(new Position().gravity(compass("north_east")))
  );
```

```vue
import { scale, fill } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { max } from "@cloudinary/url-gen/actions/roundCorners";
import { video } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("man_on_phone.mp4")
  .resize(scale().width(300))
  .overlay(
    source(
      video("man_talking").transformation(
        new Transformation()
          .resize(fill().width(100).height(100))
          .roundCorners(max())
      )
    ).position(new Position().gravity(compass("north_east")))
  );
```

```angular
import { scale, fill } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { max } from "@cloudinary/url-gen/actions/roundCorners";
import { video } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("man_on_phone.mp4")
  .resize(scale().width(300))
  .overlay(
    source(
      video("man_talking").transformation(
        new Transformation()
          .resize(fill().width(100).height(100))
          .roundCorners(max())
      )
    ).position(new Position().gravity(compass("north_east")))
  );
```

```js
import { scale, fill } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { max } from "@cloudinary/url-gen/actions/roundCorners";
import { video } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("man_on_phone.mp4")
  .resize(scale().width(300))
  .overlay(
    source(
      video("man_talking").transformation(
        new Transformation()
          .resize(fill().width(100).height(100))
          .roundCorners(max())
      )
    ).position(new Position().gravity(compass("north_east")))
  );
```

```python
CloudinaryVideo("man_on_phone").video(transformation=[
  {'width': 300, 'crop': "scale"},
  {'overlay': "video:man_talking"},
  {'height': 100, 'width': 100, 'crop': "fill"},
  {'radius': "max"},
  {'gravity': "north_east", 'flags': "layer_apply"}
  ])
```

```php
use Cloudinary\Transformation\Resize;
use Cloudinary\Transformation\Overlay;
use Cloudinary\Transformation\RoundCorners;
use Cloudinary\Transformation\Source;
use Cloudinary\Transformation\Position;
use Cloudinary\Transformation\Gravity;
use Cloudinary\Transformation\Compass;

(new VideoTag('man_on_phone.mp4'))
	->resize(Resize::scale()->width(300))
	->overlay(Overlay::source(
	Source::video("man_talking")
	->transformation((new Transformation())
	->resize(Resize::fill()->width(100)
->height(100))
	->roundCorners(RoundCorners::max()))
	)
	->position((new Position())
	->gravity(
	Gravity::compass(
	Compass::northEast()))
	)
	);
```

```java
cloudinary.url().transformation(new Transformation()
  .width(300).crop("scale").chain()
  .overlay(new Layer().publicId("video:man_talking")).chain()
  .height(100).width(100).crop("fill").chain()
  .radius("max").chain()
  .gravity("north_east").flags("layer_apply")).videoTag("man_on_phone");
```

```ruby
cl_video_tag("man_on_phone", transformation: [
  {width: 300, crop: "scale"},
  {overlay: "video:man_talking"},
  {height: 100, width: 100, crop: "fill"},
  {radius: "max"},
  {gravity: "north_east", flags: "layer_apply"}
  ])
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Width(300).Crop("scale").Chain()
  .Overlay(new Layer().PublicId("video:man_talking")).Chain()
  .Height(100).Width(100).Crop("fill").Chain()
  .Radius("max").Chain()
  .Gravity("north_east").Flags("layer_apply")).BuildVideoTag("man_on_phone")
```

```dart
cloudinary.video('man_on_phone.mp4').transformation(Transformation()
	.resize(Resize.scale().width(300))
	.overlay(Overlay.source(
	Source.video("man_talking")
	.transformation(new Transformation()
	.resize(Resize.fill().width(100)
.height(100))
	.roundCorners(RoundCorners.max()))
	)
	.position(Position()
	.gravity(
	Gravity.compass(
	Compass.northEast()))
	)
	));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setWidth(300).setCrop("scale").chain()
  .setOverlay("video:man_talking").chain()
  .setHeight(100).setWidth(100).setCrop("fill").chain()
  .setRadius("max").chain()
  .setGravity("north_east").setFlags("layer_apply")).generate("man_on_phone.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation()
  .width(300).crop("scale").chain()
  .overlay(new Layer().publicId("video:man_talking")).chain()
  .height(100).width(100).crop("fill").chain()
  .radius("max").chain()
  .gravity("north_east").flags("layer_apply")).resourceType("video").generate("man_on_phone.mp4");
```

```flutter
cloudinary.video('man_on_phone.mp4').transformation(Transformation()
	.resize(Resize.scale().width(300))
	.overlay(Overlay.source(
	Source.video("man_talking")
	.transformation(new Transformation()
	.addTransformation())
	)
	.position(Position()
	.gravity(
	Gravity.compass(
	Compass.northEast()))
	)
	));
```

```kotlin
cloudinary.video {
	publicId("man_on_phone.mp4")
	 resize(Resize.scale() { width(300) })
	 overlay(Overlay.source(
	Source.video("man_talking") {
	 transformation(Transformation {
	 resize(Resize.fill() { width(100)
 height(100) })
	 roundCorners(RoundCorners.max()) })
	 }) {
	 position(Position() {
	 gravity(
	Gravity.compass(
	Compass.northEast()))
	 })
	 }) 
}.generate()
```

```jquery
$.cloudinary.video("man_on_phone", {transformation: [
  {width: 300, crop: "scale"},
  {overlay: new cloudinary.Layer().publicId("video:man_talking")},
  {height: 100, width: 100, crop: "fill"},
  {radius: "max"},
  {gravity: "north_east", flags: "layer_apply"}
  ]})
```

```react_native
import { scale, fill } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { max } from "@cloudinary/url-gen/actions/roundCorners";
import { video } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("man_on_phone.mp4")
  .resize(scale().width(300))
  .overlay(
    source(
      video("man_talking").transformation(
        new Transformation()
          .resize(fill().width(100).height(100))
          .roundCorners(max())
      )
    ).position(new Position().gravity(compass("north_east")))
  );
```

**See full syntax**: [r (round corners)](transformation_reference#r_round_corners) in the _Transformation Reference_.

> **READING**:
>
> * [Video effects and enhancements](video_effects_and_enhancements): Overview of all video effects and enhancements.

> * [Video color effects](video_color_effects): Background color, 3D LUTs, borders, and transparency.

> * [Video artistic effects](video_artistic_effects): Blur, deshake, vignette, and visual noise.

> * [Video playback effects](video_playback_effects): Fade, loop, playback speed, reverse, boomerang, and progress bar.

> * [Video previews and posters](video_previews_and_posters): AI-based previews, thumbnails, and poster images.

