Skip to Content
Video

Video

Endpoints for converting and compressing video files using FFmpeg.


Convert

$0.0003per MB$0.01 min

POST /video/convert

Convert video files between formats with full control over codecs, resolution, frame rate, bitrate, trimming, and audio settings.

Parameters

NameTypeDefaultDescription
targetFormatmp4 | mkv | mov | webm | avi | flv | mpeg | ts | ogg | m4v | 3gp | mp3 | aac | wav | flacmp4Output format. Includes audio-only formats for extraction.
videoCodecauto | h264 | h265 | vp8 | vp9 | av1 | mpeg4 | mpeg2 | theora | copy | noneautoVideo codec. auto picks best for format, copy remuxes, none for audio-only.
audioCodecauto | aac | mp3 | opus | vorbis | flac | pcm_s16le | ac3 | copy | noneautoAudio codec. auto picks best for format, none strips audio.
presetultrafast | superfast | veryfast | faster | fast | medium | slow | slower | veryslowmediumFFmpeg encoding speed/quality preset.
crfnumberConstant Rate Factor (0-51 for H.264/H.265, 4-63 for VP9). Lower = better quality.
videoBitratestringTarget video bitrate (e.g. 2M, 5000k).
audioBitratestringTarget audio bitrate (e.g. 128k, 320k).
widthnumberTarget width in pixels (maintains aspect ratio if only one dimension set).
heightnumberTarget height in pixels.
resolution240p | 360p | 480p | 720p | 1080p | 1440p | 2160pResolution preset (convenience shortcut for height).
fpsnumberTarget frame rate (e.g. 24, 30, 60).
startTimestringTrim start position (e.g. 00:01:30 or 90).
endTimestringTrim end position.
durationstringMax duration from startTime.
sampleRatenumberAudio sample rate in Hz (e.g. 44100, 48000).
audioChannelsnumberNumber of audio channels (1=mono, 2=stereo, 6=5.1).
pixelFormatauto | yuv420p | yuv422p | yuv444p | rgb24autoPixel format.
stripMetadatatrue | falsefalseRemove metadata from output.
deinterlacetrue | falsefalseApply yadif deinterlacing.
rotate90 | 180 | 270Rotate video.

Example

tempo request -X POST https://api.fylor.com/video/convert \ -F "file=@input.mp4" \ -F "targetFormat=webm" \ -F "videoCodec=vp9" \ -F "audioCodec=opus" \ -F "resolution=720p" \ -o output.webm

Accepted file types

mp4, mkv, webm, avi, mov, flv, wmv, mpeg, ts, 3gp, ogg, m4v

Limits

  • Max file size: 1 GB

Compress

$0.0003per MB$0.01 min

POST /video/compress

Compress video with quality presets. Automatically selects optimal codec settings based on the quality level.

Parameters

NameTypeDefaultDescription
qualitylight | medium | heavy | extrememediumCompression preset. light = minimal compression, extreme = maximum reduction.
codecauto | h264 | h265 | vp9 | av1autoVideo codec override (auto selects best for container).
crfnumberConstant Rate Factor override (0-51 for H.264/H.265, 4-63 for VP9, 0-63 for AV1).
maxResolution240p | 360p | 480p | 720p | 1080p | 1440p | 2160pCap resolution (downscale if larger, never upscale).
videoBitratestringTarget video bitrate instead of CRF (e.g. 2M, 5000k).
audioBitratestringOverride audio bitrate (e.g. 128k, 64k).
audioCodecauto | aac | mp3 | opus | copy | noneautoAudio codec override.
fpsnumberCap frame rate (never increases, e.g. 24, 30).
stripAudiotrue | falsefalseRemove audio track entirely.
stripMetadatatrue | falsetrueRemove metadata from output.
encodingSpeedultrafast | superfast | veryfast | faster | fast | medium | slow | slower | veryslowEncoding speed/quality tradeoff.
twoPasstrue | falsefalseEnable two-pass encoding for tighter bitrate control (doubles processing time, requires videoBitrate).
maxWidthnumberCap width in pixels (never upscales, preserves aspect ratio).
maxHeightnumberCap height in pixels (never upscales, preserves aspect ratio).
deinterlacetrue | falsefalseApply yadif deinterlacing.

Example

tempo request -X POST https://api.fylor.com/video/compress \ -F "file=@video.mp4" \ -F "quality=medium" \ -F "maxResolution=1080p" \ -o compressed.mp4

Accepted file types

mp4, mkv, webm, avi, mov, flv, wmv, mpeg, ts, 3gp, ogg, m4v

Limits

  • Max file size: 1 GB

Response Headers

Every response includes:

HeaderDescription
X-Request-IdUnique request identifier (UUID). Use this for support issues or when submitting feedback.

Two-Step Upload (for AI Agents)

If your client can only send JSON (e.g., AgentCash), use the two-step flow instead of direct multipart upload.

Step 1: Pay and create a job

Video endpoints use per-MB pricing, so you must include fileSizeBytes in the JSON body.

curl -X POST https://api.fylor.app/video/convert \ -H "Content-Type: application/json" \ -H "Authorization: Payment <token>" \ -d '{"targetFormat": "webm", "videoCodec": "vp9", "fileSizeBytes": 52428800}'

Response:

{ "jobId": "550e8400-e29b-41d4-a716-446655440000", "uploadUrl": "/jobs/550e8400-e29b-41d4-a716-446655440000/upload", "expiresIn": 300 }

Step 2: Upload the file

curl -X POST https://api.fylor.app/jobs/550e8400-e29b-41d4-a716-446655440000/upload \ -F "file=@input.mp4" \ -o output.webm

Notes

  • Jobs expire after 5 minutes and are single-use.
  • fileSizeBytes must be within 10% of the actual file size.
  • Both video endpoints support this flow: /video/convert, /video/compress.
Last updated on