Skip to content

Commit 340a7df

Browse files
tsmith512Pakhi Sinhaimakelaa
authored andcommitted
[Stream] Audio Mode for Media Transformations (cloudflare#23883)
* Media Transformations Audio Mode * Update src/content/changelog/stream/2025-07-11-media-transformations-audio-mode.mdx Co-authored-by: Taylor Smith <[email protected]> * Update src/content/changelog/stream/2025-07-11-media-transformations-audio-mode.mdx Co-authored-by: Taylor Smith <[email protected]> * Update src/content/docs/stream/transform-videos/index.mdx Co-authored-by: Taylor Smith <[email protected]> * Update src/content/docs/stream/transform-videos/index.mdx Co-authored-by: Taylor Smith <[email protected]> * Roll forward changelog date --------- Co-authored-by: Pakhi Sinha <[email protected]> Co-authored-by: Pakhi <[email protected]>
1 parent e09b566 commit 340a7df

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: Audio mode for Media Transforamtions
3+
description: >
4+
Media Transformations now supports `audio` mode, which extracts audio from a video.
5+
date: 2025-07-22
6+
---
7+
8+
The addition of this feature allows a user to extract audio from a source video, outputting
9+
an M4A file to use in downstream workflows like AI inference, content moderation, or transcription.
10+
11+
For example,
12+
13+
``` text title="Example URL"
14+
https://example.com/cdn-cgi/media/<OPTIONS>/<SOURCE-VIDEO>
15+
https://example.com/cdn-cgi/media/mode=audio,time=3s,duration=60s/<input video with diction>
16+
```
17+
18+
For more information, learn about [Transforming Videos](/stream/transform-videos/).

src/content/docs/stream/transform-videos/index.mdx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,13 @@ Specifies the kind of output to generate.
5454
- `video`: Outputs an H.264/AAC optimized MP4 file.
5555
- `frame`: Outputs a still image.
5656
- `spritesheet`: Outputs a JPEG with multiple frames.
57+
- `audio`: Outputs an AAC encoded M4A file.
5758

5859
### `time`
5960

6061
Specifies when to start extracting the output in the input file. Depends on `mode`:
6162

62-
- When `mode` is `spritesheet` or `video`, specifies the timestamp where the output will start.
63+
- When `mode` is `spritesheet`, `video`, or `audio`, specifies the timestamp where the output will start.
6364
- When `mode` is `frame`, specifies the timestamp from which to extract the still image.
6465
- Formats as a time string, for example: 5s, 2m
6566
- Acceptable range: 0 – 10m
@@ -69,7 +70,7 @@ Specifies when to start extracting the output in the input file. Depends on `mod
6970

7071
The duration of the output video or spritesheet. Depends on `mode`:
7172

72-
- When `mode` is `video`, specifies the duration of the output.
73+
- When `mode` is `video` or `audio`, specifies the duration of the output.
7374
- When `mode` is `spritesheet`, specifies the time range from which to select frames.
7475
- Acceptable range: 1s - 60s (or 1m)
7576
- Default: input duration or 60 seconds, whichever is shorter
@@ -102,12 +103,18 @@ When `mode` is `video`, specifies whether or not to include the source audio in
102103
- `false`: Output will be silent.
103104
- Default: `true`
104105

106+
When `mode` is `audio`, audio cannot be false.
107+
105108
### `format`
106109

107110
If `mode` is `frame`, specifies the image output format.
108111

109112
- Acceptable options: `jpg`, `png`
110113

114+
If `mode` is `audio`, specifies the audio output format.
115+
116+
- Acceptable options: `m4a` (default)
117+
111118
## Source video requirements
112119

113120
Input video must be less than 100MB.
@@ -128,6 +135,6 @@ Media Transformations will be free for all customers while in beta.
128135
After that, Media Transforamtions and Image Transformations will use the same subscriptions and usage metrics.
129136

130137
- Generating a still frame (single image) from a video counts as 1 transformation.
131-
- Generating an optimized video counts as 1 transformation _per second of the output_ video.
138+
- Generating an optimized video or extracting audio counts as 1 transformation _per second of the output_ content.
132139
- Each unique transformation is only billed once per month.
133140
- 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

Comments
 (0)