Examples

Copy-paste cURL recipes for the most common FFmpeg jobs on FFHub.

Seven recipes you can drop straight into a terminal. Replace YOUR_API_KEY with your token from /dashboard/api-keys and the input URL with your own.

If your input is a local file, upload it first — see Upload Files.

Don't want to write code? Every recipe below has a point-and-click version under /tools: Compress · Convert · Extract audio · Video → GIF · Trim · Merge · Watermark. Drag a file, click a button, done.

1. Compress a video

H.264 + CRF 28 cuts the file size 5–10× with barely visible quality loss. Higher CRF = smaller file.

curl -X POST https://api.ffhub.io/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "command": "ffmpeg -i https://storage.ffhub.io/sample.mp4 -c:v libx264 -preset fast -crf 28 -c:a aac -b:a 96k output.mp4"
  }'

2. Convert format (MOV → MP4)

Copy the streams without re-encoding when the codecs already fit — instant and lossless.

curl -X POST https://api.ffhub.io/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "command": "ffmpeg -i https://storage.ffhub.io/sample.mov -c:v copy -c:a copy output.mp4"
  }'

3. Extract audio (MP4 → MP3)

-vn drops video, libmp3lame encodes MP3 at a sane default bitrate.

curl -X POST https://api.ffhub.io/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "command": "ffmpeg -i https://storage.ffhub.io/sample.mp4 -vn -c:a libmp3lame -q:a 2 audio.mp3"
  }'

4. Video to GIF

10 fps, 480px wide, infinite loop. Smaller scale = smaller GIF.

curl -X POST https://api.ffhub.io/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "command": "ffmpeg -i https://storage.ffhub.io/sample.mp4 -vf fps=10,scale=480:-1 -loop 0 output.gif"
  }'

5. Trim a clip

Cut from 10s to 40s (30 seconds long). -c copy skips re-encoding so it's nearly instant.

curl -X POST https://api.ffhub.io/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "command": "ffmpeg -ss 00:00:10 -i https://storage.ffhub.io/sample.mp4 -t 00:00:30 -c copy output.mp4"
  }'

6. Merge two videos

Both inputs must use the same codec / resolution / fps. The concat filter is safe; the demuxer is faster but pickier.

curl -X POST https://api.ffhub.io/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "command": "ffmpeg -i https://storage.ffhub.io/a.mp4 -i https://storage.ffhub.io/b.mp4 -filter_complex [0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a] -map [v] -map [a] output.mp4"
  }'

7. Add a watermark

PNG with transparency, anchored 10px from the top-right corner.

curl -X POST https://api.ffhub.io/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "command": "ffmpeg -i https://storage.ffhub.io/sample.mp4 -i https://storage.ffhub.io/logo.png -filter_complex overlay=W-w-10:10 -c:a copy output.mp4"
  }'

Need something not listed here? FFHub runs any FFmpeg command — just send yours. The full filter / option reference lives at ffmpeg.org/ffmpeg.html.

Examples — FFHub Docs