Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions apps/docs/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,16 @@ export function FathomIcon(props: SVGProps<SVGSVGElement>) {
</svg>
)
}
export function FFmpegIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'>
<path
fill='#388e3c'
d='M39.5,42h-9c-1,0-1.9-0.6-2.3-1.5c-0.4-0.9-0.2-2,0.5-2.7l8.3-8.3v-3.9L21.3,41.3 c-0.5,0.5-1.1,0.7-1.8,0.7h-11c-1,0-1.9-0.6-2.3-1.5c-0.4-0.9-0.2-2,0.5-2.7L33.5,11h-3.9L10.3,30.3c-0.7,0.7-1.8,0.9-2.7,0.5 C6.6,30.4,6,29.5,6,28.5v-11c0-0.7,0.3-1.3,0.7-1.8l4.7-4.7h-3C7.1,11,6,9.9,6,8.5S7.1,6,8.5,6h9c1,0,1.9,0.6,2.3,1.5 c0.4,0.9,0.2,2-0.5,2.7L11,18.5v3.9L26.7,6.7C27.2,6.3,27.8,6,28.5,6h11c1,0,1.9,0.6,2.3,1.5c0.4,0.9,0.2,2-0.5,2.7L14.5,37h3.9 l19.3-19.3c0.7-0.7,1.8-0.9,2.7-0.5c0.9,0.4,1.5,1.3,1.5,2.3v11c0,0.7-0.3,1.3-0.7,1.8L36.5,37h3c1.4,0,2.5,1.1,2.5,2.5 S40.9,42,39.5,42z'
/>
</svg>
)
}
export function LinkupIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 154 107' fill='none'>
Expand Down
2 changes: 2 additions & 0 deletions apps/docs/components/ui/icon-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import {
ExtendIcon,
EyeIcon,
FathomIcon,
FFmpegIcon,
FindymailIcon,
FirecrawlIcon,
FirefliesIcon,
Expand Down Expand Up @@ -271,6 +272,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
extend: ExtendIcon,
extend_v2: ExtendIcon,
fathom: FathomIcon,
ffmpeg: FFmpegIcon,
file: DocumentIcon,
file_v2: DocumentIcon,
file_v3: DocumentIcon,
Expand Down
316 changes: 316 additions & 0 deletions apps/docs/content/docs/en/tools/ffmpeg.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,316 @@
---
title: FFmpeg
description: Process video and audio files with FFmpeg
---

import { BlockInfoCard } from "@/components/ui/block-info-card"

<BlockInfoCard
type="ffmpeg"
color="#FFFFFF"
/>

## Usage Instructions

{/* MANUAL-CONTENT-START:usage */}
The FFmpeg block runs the FFmpeg media engine on Sim's servers — there is no external service, API key, or OAuth to configure. It takes a media file as input (uploaded directly or referenced from a previous block as a `UserFile`), processes it, and returns the result as a new `UserFile` you can pass to any downstream block.

Pick an **Operation**, supply the input file, and fill in the fields shown for that operation:

| Operation | What it does | Key inputs | Output |
| --- | --- | --- | --- |
| **Convert Format** | Transcode to a different container/codec | `Output Format` (required, e.g. `mp4`, `webm`, `mp3`); optional `Video Codec` / `Audio Codec` | Converted media file |
| **Extract Audio** | Pull the audio track out of a video | `Output Format` (defaults to `mp3`) | Audio file |
| **Trim / Cut** | Keep a segment of the media | `Start Time` and/or `Duration` (seconds or `HH:MM:SS`) | Trimmed media file |
| **Compress / Scale** | Reduce file size and/or rescale video | `Scale` (e.g. `1280x720`, `1280:-2`), `Quality (CRF)` 0–51, optional `Video Bitrate` | Compressed video file |
| **Get Media Info** | Inspect the file with `ffprobe` | — | Metadata only (duration, codecs, resolution, streams) — no file |
| **Extract Thumbnail** | Capture a single frame as an image | `Timestamp` (defaults to 1s), `Output Format` (`jpg`/`png`/`webp`) | Image file |
| **Concatenate** | Join multiple clips into one | `Media Files` (2+, **same codec/format**) | Joined media file |
| **Adjust Volume** | Change audio loudness | `Volume` — multiplier (`1.5`, `0.5`) or decibels (`10dB`, `-6dB`) | Media file |
| **Change Speed** | Speed up or slow down playback | `Speed` multiplier (`2` = 2× faster, `0.5` = half) | Retimed media file |

**File handling.** Inputs and outputs are standard Sim `UserFile` objects, so the block chains naturally — e.g. *Convert → Trim → Extract Thumbnail*, or feed the output of an upload/HTTP block straight into FFmpeg. Every operation except **Get Media Info** returns a `file` output; **Get Media Info** returns structured metadata instead.

**Notes & limits.**
- **Concatenate** uses FFmpeg's concat demuxer with stream copy, so all inputs must share the same codec, resolution, and format (typical for clips exported from one source). Mixed-codec inputs will fail.
- **Change Speed** automatically retimes whichever streams exist — video via `setpts`, audio via `atempo` (chained for speeds beyond 0.5×–2×).
- Input and output files are capped at 200 MB each (this includes the joined output of **Concatenate**).
- **Scale** and **Volume** accept only `width:height` dimensions and numeric/decibel values respectively — other characters are rejected.
- Requires the FFmpeg binary on the server (bundled via `ffmpeg-static`). `ffprobe` from the system PATH is additionally needed for **Get Media Info** and **Change Speed** (which inspects streams before retiming).
{/* MANUAL-CONTENT-END */}


Transcode, trim, compress, concatenate, and inspect video and audio files server-side with FFmpeg. Convert formats, extract audio, capture thumbnails, adjust volume, and change playback speed — no external service required.



## Tools

### `ffmpeg_convert`

Convert (transcode) a video or audio file to a different container/format

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `file` | file | Yes | The media file to convert |
| `format` | string | Yes | Target output format/container \(e.g. mp4, webm, mov, mkv, mp3, wav\) |
| `videoCodec` | string | No | Optional video codec override \(e.g. libx264, vp9\) |
| `audioCodec` | string | No | Optional audio codec override \(e.g. aac, libmp3lame\) |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `file` | file | Processed media file |
| `fileName` | string | Generated output file name |
| `format` | string | Output or detected container format |
| `size` | number | Output file size in bytes |
| `durationSeconds` | number | Media duration in seconds |
| `bitrate` | number | Overall bitrate in bits per second |
| `width` | number | Video width in pixels |
| `height` | number | Video height in pixels |
| `hasVideo` | boolean | Whether a video stream is present |
| `hasAudio` | boolean | Whether an audio stream is present |
| `videoCodec` | string | Primary video codec |
| `audioCodec` | string | Primary audio codec |
| `streams` | array | All detected media streams |

### `ffmpeg_extract_audio`

Extract the audio track from a video file into an audio file

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `file` | file | Yes | The video file to extract audio from |
| `format` | string | No | Output audio format \(mp3, wav, aac, flac, ogg, m4a, opus\). Defaults to mp3 |
| `audioCodec` | string | No | Optional audio codec override \(e.g. aac, libmp3lame\) |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `file` | file | Processed media file |
| `fileName` | string | Generated output file name |
| `format` | string | Output or detected container format |
| `size` | number | Output file size in bytes |
| `durationSeconds` | number | Media duration in seconds |
| `bitrate` | number | Overall bitrate in bits per second |
| `width` | number | Video width in pixels |
| `height` | number | Video height in pixels |
| `hasVideo` | boolean | Whether a video stream is present |
| `hasAudio` | boolean | Whether an audio stream is present |
| `videoCodec` | string | Primary video codec |
| `audioCodec` | string | Primary audio codec |
| `streams` | array | All detected media streams |

### `ffmpeg_trim`

Cut a segment from a video or audio file using a start time and/or duration

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `file` | file | Yes | The media file to trim |
| `startTime` | string | No | Start offset in seconds or HH:MM:SS\(.ms\), e.g. 5 or 00:00:05 |
| `duration` | string | No | Duration to keep in seconds or HH:MM:SS\(.ms\), e.g. 30 or 00:00:30 |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `file` | file | Processed media file |
| `fileName` | string | Generated output file name |
| `format` | string | Output or detected container format |
| `size` | number | Output file size in bytes |
| `durationSeconds` | number | Media duration in seconds |
| `bitrate` | number | Overall bitrate in bits per second |
| `width` | number | Video width in pixels |
| `height` | number | Video height in pixels |
| `hasVideo` | boolean | Whether a video stream is present |
| `hasAudio` | boolean | Whether an audio stream is present |
| `videoCodec` | string | Primary video codec |
| `audioCodec` | string | Primary audio codec |
| `streams` | array | All detected media streams |

### `ffmpeg_compress`

Compress and/or rescale a video to reduce file size

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `file` | file | Yes | The video file to compress |
| `scale` | string | No | Optional output dimensions, e.g. 1280x720, 1280:720, or 1280:-2 \(keep aspect ratio\) |
| `crf` | number | No | Constant Rate Factor \(0 = lossless, 23 = default, 51 = worst quality\) |
| `videoBitrate` | string | No | Optional target video bitrate, e.g. 1M or 800k |
| `videoCodec` | string | No | Optional video codec override \(defaults to libx264\) |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `file` | file | Processed media file |
| `fileName` | string | Generated output file name |
| `format` | string | Output or detected container format |
| `size` | number | Output file size in bytes |
| `durationSeconds` | number | Media duration in seconds |
| `bitrate` | number | Overall bitrate in bits per second |
| `width` | number | Video width in pixels |
| `height` | number | Video height in pixels |
| `hasVideo` | boolean | Whether a video stream is present |
| `hasAudio` | boolean | Whether an audio stream is present |
| `videoCodec` | string | Primary video codec |
| `audioCodec` | string | Primary audio codec |
| `streams` | array | All detected media streams |

### `ffmpeg_probe`

Inspect a media file and return metadata (duration, format, codecs, resolution)

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `file` | file | Yes | The media file to inspect |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `file` | file | Processed media file |
| `fileName` | string | Generated output file name |
| `format` | string | Output or detected container format |
| `size` | number | Output file size in bytes |
| `durationSeconds` | number | Media duration in seconds |
| `bitrate` | number | Overall bitrate in bits per second |
| `width` | number | Video width in pixels |
| `height` | number | Video height in pixels |
| `hasVideo` | boolean | Whether a video stream is present |
| `hasAudio` | boolean | Whether an audio stream is present |
| `videoCodec` | string | Primary video codec |
| `audioCodec` | string | Primary audio codec |
| `streams` | array | All detected media streams |

### `ffmpeg_thumbnail`

Extract a single frame from a video at a given timestamp as an image

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `file` | file | Yes | The video file to extract a frame from |
| `time` | string | No | Timestamp in seconds or HH:MM:SS\(.ms\), e.g. 5 or 00:00:05. Defaults to 1s |
| `format` | string | No | Output image format \(jpg, png, webp\). Defaults to jpg |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `file` | file | Processed media file |
| `fileName` | string | Generated output file name |
| `format` | string | Output or detected container format |
| `size` | number | Output file size in bytes |
| `durationSeconds` | number | Media duration in seconds |
| `bitrate` | number | Overall bitrate in bits per second |
| `width` | number | Video width in pixels |
| `height` | number | Video height in pixels |
| `hasVideo` | boolean | Whether a video stream is present |
| `hasAudio` | boolean | Whether an audio stream is present |
| `videoCodec` | string | Primary video codec |
| `audioCodec` | string | Primary audio codec |
| `streams` | array | All detected media streams |

### `ffmpeg_concat`

Join multiple media files of the same format and codec into a single output file

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `files` | file[] | Yes | Two or more media files to join, in order. Files must share the same codec |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `file` | file | Processed media file |
| `fileName` | string | Generated output file name |
| `format` | string | Output or detected container format |
| `size` | number | Output file size in bytes |
| `durationSeconds` | number | Media duration in seconds |
| `bitrate` | number | Overall bitrate in bits per second |
| `width` | number | Video width in pixels |
| `height` | number | Video height in pixels |
| `hasVideo` | boolean | Whether a video stream is present |
| `hasAudio` | boolean | Whether an audio stream is present |
| `videoCodec` | string | Primary video codec |
| `audioCodec` | string | Primary audio codec |
| `streams` | array | All detected media streams |

### `ffmpeg_volume`

Adjust the audio volume of a video or audio file

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `file` | file | Yes | The media file to adjust |
| `volume` | string | Yes | Volume as a multiplier \(e.g. 1.5, 0.5\) or decibels \(e.g. 10dB, -6dB\) |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `file` | file | Processed media file |
| `fileName` | string | Generated output file name |
| `format` | string | Output or detected container format |
| `size` | number | Output file size in bytes |
| `durationSeconds` | number | Media duration in seconds |
| `bitrate` | number | Overall bitrate in bits per second |
| `width` | number | Video width in pixels |
| `height` | number | Video height in pixels |
| `hasVideo` | boolean | Whether a video stream is present |
| `hasAudio` | boolean | Whether an audio stream is present |
| `videoCodec` | string | Primary video codec |
| `audioCodec` | string | Primary audio codec |
| `streams` | array | All detected media streams |

### `ffmpeg_speed`

Speed up or slow down playback of a video or audio file

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `file` | file | Yes | The media file to retime |
| `speed` | number | Yes | Playback speed multiplier \(0.5 = half speed, 2 = double speed\) |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `file` | file | Processed media file |
| `fileName` | string | Generated output file name |
| `format` | string | Output or detected container format |
| `size` | number | Output file size in bytes |
| `durationSeconds` | number | Media duration in seconds |
| `bitrate` | number | Overall bitrate in bits per second |
| `width` | number | Video width in pixels |
| `height` | number | Video height in pixels |
| `hasVideo` | boolean | Whether a video stream is present |
| `hasAudio` | boolean | Whether an audio stream is present |
| `videoCodec` | string | Primary video codec |
| `audioCodec` | string | Primary audio codec |
| `streams` | array | All detected media streams |


1 change: 1 addition & 0 deletions apps/docs/content/docs/en/tools/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"exa",
"extend",
"fathom",
"ffmpeg",
"file",
"findymail",
"firecrawl",
Expand Down
2 changes: 2 additions & 0 deletions apps/sim/app/(landing)/integrations/data/icon-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import {
ExaAIIcon,
ExtendIcon,
FathomIcon,
FFmpegIcon,
FindymailIcon,
FirecrawlIcon,
FirefliesIcon,
Expand Down Expand Up @@ -267,6 +268,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
exa: ExaAIIcon,
extend_v2: ExtendIcon,
fathom: FathomIcon,
ffmpeg: FFmpegIcon,
file_v4: DocumentIcon,
findymail: FindymailIcon,
firecrawl: FirecrawlIcon,
Expand Down
Loading
Loading