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.
crfnumber—Constant Rate Factor (0-51 for H.264/H.265, 4-63 for VP9). Lower = better quality.
videoBitratestring—Target video bitrate (e.g. 2M, 5000k).
audioBitratestring—Target audio bitrate (e.g. 128k, 320k).
widthnumber—Target width in pixels (maintains aspect ratio if only one dimension set).
heightnumber—Target height in pixels.
resolution240p | 360p | 480p | 720p | 1080p | 1440p | 2160p—Resolution preset (convenience shortcut for height).
fpsnumber—Target frame rate (e.g. 24, 30, 60).
startTimestring—Trim start position (e.g. 00:01:30 or 90).
endTimestring—Trim end position.
durationstring—Max duration from startTime.
sampleRatenumber—Audio sample rate in Hz (e.g. 44100, 48000).
audioChannelsnumber—Number 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 | 270—Rotate 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).
crfnumber—Constant Rate Factor override (0-51 for H.264/H.265, 4-63 for VP9, 0-63 for AV1).
maxResolution240p | 360p | 480p | 720p | 1080p | 1440p | 2160p—Cap resolution (downscale if larger, never upscale).
videoBitratestring—Target video bitrate instead of CRF (e.g. 2M, 5000k).
audioBitratestring—Override audio bitrate (e.g. 128k, 64k).
audioCodecauto | aac | mp3 | opus | copy | noneautoAudio codec override.
fpsnumber—Cap 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 | veryslow—Encoding speed/quality tradeoff.
twoPasstrue | falsefalseEnable two-pass encoding for tighter bitrate control (doubles processing time, requires videoBitrate).
maxWidthnumber—Cap width in pixels (never upscales, preserves aspect ratio).
maxHeightnumber—Cap 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