Skip to main content

Find your next tool

Docs/API/Media API: video and audio conversion
API

Media API: video and audio conversion

Compress, convert, trim, resize, mute and turn video into GIF, and convert or compress audio, through the media endpoint.

Short answer

Upload the file with a direct upload, then POST /api/v1/media/process/ with the objectKey as sourceKey, an operation (convert, compress-video, compress-audio, trim-video, trim-audio, resize-video, change-video-speed, mute-video, video-to-gif, gif-to-mp4) and the target format. Poll the returned job. Uploads are limited to 50 MB per file.

Operations and options

Inputs: MP4, MOV, MKV, AVI, WebM, MP3, WAV, M4A, FLAC, OGG, AAC and GIF.

operationUseful fields
convertformat: mp4, webm, mkv, mp3, wav, flac, m4a, ogg, aac, gif
compress-videocrf (18–40, higher = smaller) or targetMb for a size target
compress-audiobitrate, e.g. "128k"
trim-video / trim-audiostart and duration in seconds
resize-video / change-video-resolutionwidth, height
change-video-speedspeed, e.g. 1.5
mute-video, video-to-gif, gif-to-mp4format; duration for GIF length

Compress a video

Measured on production: a 10-second 720p MP4 of 2.5 MB came back as a 1.6 MB H.264/AAC file in about 19 seconds. Long or high-bitrate videos take proportionally longer.

curl -X POST 'https://maxscanner.app/api/v1/media/process/' \
  -H "Authorization: Bearer $MAXSCANNER_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{ "operation": "compress-video", "sourceKey": "users/<id>/media/inbox/…-clip.mp4", "filename": "clip.mp4", "format": "mp4" }'

Practical advice

  • Poll media jobs less often (every 10 seconds) and allow several minutes for long videos
  • Prefer MP4 output: it plays everywhere and, from this API, is usually smaller than WebM, which is encoded for speed
  • Trim before you compress to save time
  • Check GET /api/v1/media/health/ before a large batch: it reports whether the media worker is available

Frequently asked questions

What is the largest video I can process?

50 MB per upload today. The media worker itself accepts up to 500 MB, so contact support if you need larger files.

Is audio kept when I compress a video?

Yes, as AAC, unless you use mute-video.

Related guides