You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/stream/transform-videos/index.mdx
+58-83Lines changed: 58 additions & 83 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,151 +6,126 @@ sidebar:
6
6
7
7
---
8
8
9
-
Media Transformations let you optimize and manipulate videos stored _outside_ of
10
-
the Cloudflare Stream product. Transformed videos and images are served from one
11
-
of your zones on Cloudflare.
9
+
Media Transformations let you optimize and manipulate videos stored _outside_ of the Cloudflare Stream. Transformed videos and images are served from one of your zones on Cloudflare.
for your zone. If your zone already has Image Transformations enabled, then it
16
-
is ready to optimize videos with Media Transformations, too.
11
+
To transform a video or image, you must [enable transformations](/stream/transform-videos/#getting-started) for your zone. If your zone already has Image Transformations enabled, you can also optimize videos with Media Transformations.
17
12
18
13
## Getting started
19
14
20
-
You can dynamically optimize and generate still images from videos that
21
-
are stored _outside_ of Cloudflare Stream with Media Transforamtions.
15
+
You can dynamically optimize and generate still images from videos that are stored _outside_ of Cloudflare Stream with Media Transformations.
22
16
23
-
Cloudflare will automatically cache every transformed video or image on our
24
-
global network so that you store only the original image at your origin.
17
+
Cloudflare will automatically cache every transformed video or image on our global network so that you store only the original image at your origin.
25
18
26
19
To enable transformations on your zone:
27
20
28
-
- Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account.
29
-
- Go to **Stream** > **Transformations**.
30
-
- Locate the specific zone where you want to enable transformations.
31
-
- Select **Enable** for zone.
21
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account.
22
+
2. Go to **Stream** > **Transformations**.
23
+
3. Locate the specific zone where you want to enable transformations.
24
+
4. Select **Enable** for zone.
32
25
33
26
## Transform a video by URL
34
27
35
-
You can convert and resize videos by requesting them via a specially-formatted URL,
36
-
without writing any code. The URL format is:
28
+
You can convert and resize videos by requesting them via a specially-formatted URL, without writing any code. The URL format is:
The result is an MP4 that can be used in an HTML video element without a player library.
61
46
62
-
###Options
47
+
## Options
63
48
64
-
####`mode`
49
+
### `mode`
65
50
66
-
Specify the kind of output to generate.
51
+
Specifies the kind of output to generate.
67
52
68
-
-`video` — output an (H.264/AAC) optimized MP4 file
69
-
-`frame` — output a still image
70
-
-`spritesheet` — output a JPEG with multiple frames
53
+
-`video`: Outputs an H.264/AAC optimized MP4 file.
54
+
-`frame`: Outputs a still image.
55
+
-`spritesheet`: Outputs a JPEG with multiple frames.
71
56
72
-
####`time`
57
+
### `time`
73
58
74
-
When, in the input file, to start extracting the output. Depends on `mode`:
59
+
Specifies when to start extracting the output in the input file. Depends on `mode`:
75
60
76
-
- When `mode` is `spritesheet` or `video`, the timestamp where the output will start
77
-
- When `mode` is `frame`, the timestamp from which to extract the still image
78
-
-Format as a time string, for example: 5s, 2m
61
+
- When `mode` is `spritesheet` or `video`, specifies the timestamp where the output will start.
62
+
- When `mode` is `frame`, specifies the timestamp from which to extract the still image.
63
+
-Formats as a time string, for example: 5s, 2m
79
64
- Acceptable range: 0 – 30s
80
65
- Default: 0
81
66
82
-
####`duration`
67
+
### `duration`
83
68
84
69
The duration of the output video or spritesheet. Depends on `mode`:
85
70
86
-
- When `mode` is `video`, the duration of the output.
87
-
- When `mode` is `spritesheet`, the time range from which to select frames.
71
+
- When `mode` is `video`, specifies the duration of the output.
72
+
- When `mode` is `spritesheet`, specifies the time range from which to select frames.
88
73
89
-
####`fit`
74
+
### `fit`
90
75
91
-
In combination with `width` and `height`, how to resize and crop the output. In
92
-
the event the output is resized, it will always resize proportionally so content
93
-
is not stretched.
76
+
In combination with `width` and `height`, specifies how to resize and crop the output. If the output is resized, it will always resize proportionally so content is not stretched.
94
77
95
-
-`contain` — Respecting aspect ratio, scale a video up or down to be entirely
96
-
contained within output dimensions.
97
-
-`scale-down` — Same as contain, but downscale to fit only. Do not upscale.
98
-
-`cover` — Respecting aspect ratio, scale a video up or down to entirely cover
99
-
the output dimensions, with a center-weighted crop of the remainder.
78
+
-`contain`: Respecting aspect ratio, scales a video up or down to be entirely contained within output dimensions.
79
+
-`scale-down`: Same as contain, but downscales to fit only. Do not upscale.
80
+
-`cover`: Respecting aspect ratio, scales a video up or down to entirely cover the output dimensions, with a center-weighted crop of the remainder.
100
81
101
-
####`height`
82
+
### `height`
102
83
103
84
Specifies maximum height of the output in pixels. Exact behavior depends on `fit`.
104
85
105
-
- Acceptable range: 10 - 2000 pixels
86
+
- Acceptable range: 10-2000 pixels
106
87
107
-
####`width`
88
+
### `width`
108
89
109
-
Specifies maximum width of the image in pixels. Exact behavior depends on `fit`.
90
+
Specifies the maximum width of the image in pixels. Exact behavior depends on `fit`.
110
91
111
-
- Acceptable range: 10 - 2000 pixels
92
+
- Acceptable range: 10-2000 pixels
112
93
113
-
####`audio`
94
+
### `audio`
114
95
115
-
When `mode` is `video`, specifies whether or not to include the source audio in
116
-
the output.
96
+
When `mode` is `video`, specifies whether or not to include the source audio in the output.
117
97
118
-
- true — include source audio
119
-
- false — output will be silent
120
-
- Default: true
98
+
-`true`: Includes source audio.
99
+
-`false`: Output will be silent.
100
+
- Default: `true`
121
101
122
-
####`format`
102
+
### `format`
123
103
124
-
If `mode` is `frame`, specifies image output format.
104
+
If `mode` is `frame`, specifies the image output format.
125
105
126
-
- Acceptable options: jpg, png
106
+
- Acceptable options: `jpg`, `png`
127
107
128
-
###Source video requirements
108
+
## Source video requirements
129
109
130
-
Input video must be less than 40MB. Please contact Stream if this input
131
-
limitation is not acceptable.
110
+
Input video must be less than 40MB. Contact Stream if the input limitation is unacceptable.
132
111
133
-
Input video should be an MP4 with H.264 encoded video and AAC or MP3 encoded
134
-
audio. Other formats may work but are untested.
112
+
Input video should be an MP4 with H.264 encoded video and AAC or MP3 encoded audio. Other formats may work but are untested.
135
113
136
114
## Limitations
137
115
138
-
Media Transformations is currently in beta. During this period:
116
+
Media Transformations are currently in beta. During this period:
139
117
140
118
- Transformations are available for all enabled zones free-of-charge.
141
-
- Restricting allowed origins for transformations is coming soon.
142
-
- Outputs from Media Transformations will be cached, but in the event they must
143
-
be regenerated, the origin fetch is not cached and may result in subsequent
144
-
requests to the origin asset.
119
+
- Restricting allowed origins for transformations are coming soon.
120
+
- Outputs from Media Transformations will be cached, but if they must be regenerated, the origin fetch is not cached and may result in subsequent requests to the origin asset.
145
121
146
122
## Pricing
147
123
148
124
Media Transformations will be free for all customers while in beta.
149
125
150
-
After that, Media Transforamtions and Image Transformations will use the same
151
-
subscriptions and usage metrics. Generating a still frame (single image) from a
152
-
video counts as 1 transformation. Generating an optimized video counts as 1
153
-
transformation _per second of the output_ video. Each unique transformation is
154
-
only billed once per month. All Media and Image Transformations cost $0.50 per
155
-
1,000 monthly unique transformation operations, with a free monthly allocation
156
-
of 5,000.
126
+
After that, Media Transforamtions and Image Transformations will use the same subscriptions and usage metrics.
127
+
128
+
- Generating a still frame (single image) from a video counts as 1 transformation.
129
+
- Generating an optimized video counts as 1 transformation _per second of the output_ video.
130
+
- Each unique transformation is only billed once per month.
131
+
- All Media and Image Transformations cost $0.50 per 1,000 monthly unique transformation operations, with a free monthly allocation of 5,000.
0 commit comments