Skip to content

DocsAPI referenceOperations

Compile without running

The spec, command body and ffmpeg_command a job would get, or the refusal creating it would get. No job is made and no credits are used; uploads are not looked up, so ffmpeg_command names an upload ./<input name>.upload.

POST /v1/jobs/compile

Needs an API key: Authorization: Bearer $VIDEXO_API_KEY.

Body CompileRequest

Body fields
NameTypeDescription
inputs map of string to string or objectInput names to sources. A name becomes the alias in_<name>.
outputs array of Output
webhook_url string, URL, up to 2,048 characters or nullAn https URL that gets the job when it ends (M4).
metadata map of string to string, up to 500 charactersYour own string pairs, returned with the job and its webhook: at most 20 keys of up to 40 characters, values up to 500.
preset stringA preset name (GET /v1/presets); its options are the defaults and the output's own fields win.
filename string, up to 105 charactersThe stored file name, <name>.<format> by default; one extension, matching format.
format one of mp4, mov, webm, mkv, ts, mp3, m4a, aac, wav, flac, ogg, opus, jpg, png, gif, jsonThe container or image format; from filename, or the type's default.
strip_metadata booleanDrop the input's global and stream metadata (GPS, device tags).
trim objectThe part of the input to use: start, and end or duration.
crop objectA rectangle of the input frame, in input pixels.
rotate one of 90 or one of 180 or one of 270Degrees clockwise.
flip one of horizontal, verticalMirror the picture.
resize objectA new size: width, height, aspect, and how the picture fits (fit).
speed number, 0.25 to 4How fast it plays, 0.25 to 4; the sound keeps its pitch.
fps number, 1 to 120A constant frame rate.
color objectBrightness, contrast, saturation, gamma and hue.
sharpen objectAn unsharp mask.
blur objectA box blur of the whole frame, or of up to 4 regions.
overlays array of objectImages or videos drawn over the picture, in order.
text array of TextLayerUp to 8 text layers, drawn after overlays in order.
subtitles SubtitlesCaptions from an SRT or WebVTT input, burned into the picture at their cue times.
fade objectFade in at the start and out at the end; out needs trim.duration or trim.end.
video objectThe video encoder: codec, quality or CRF, preset, maximum bitrate, pixel format.
audio one of false or objectfalse for no sound, or the audio encoder and filters.
visualize objectA waveform or spectrum video drawn from the input's sound.
at number, 0 to 86400 or string or one of autoThe frame time, or "auto" for the most representative of the first 300 frames.
times array of number, 0 to 86400 or stringOne image per time, <name>_1, <name>_2, ...; not with at.
quality one of low, medium, highJPEG quality; PNG ignores it.
interval number, 0.5 to 3600Seconds between frames.
columns integer, 1 to 16Frames across.
rows integer, 1 to 16Frames down.
tile_width integer, 16 to 640Each frame fits in a square of this many pixels.
exact_times booleanDecode every frame for exact tile times, instead of key frames only.
colors integer, 2 to 256Colours in the palette.
threshold number, 1 to 100The score, 1 to 100, at which a frame starts a new scene (default 10, scdet's).
extra_inputs map of string to string or object
input string or objectAn http or https URL, videxo://uploads/<upload_id>, { "url" } or { "upload_id" }.
operation one of transcodeThe per-operation endpoint whose body this is.
type one of video, audio
images array of string or objectThe pictures in order: sources, or { "source", "duration", "motion", "text", "transition" }.
duration number, 0.1 to 300Seconds each image stays on screen unless it says otherwise (default 3).
motion one of zoom-in, zoom-out, pan-left, pan-right, pan-up, pan-downA slow zoom or pan across the picture, which then always fills the frame (Ken Burns).
transition objectThe transition into each image but the first, unless it sets its own.

Request

bash
curl "$VIDEXO_API_URL/v1/jobs/compile" \
  -H "Authorization: Bearer $VIDEXO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "operation": "transcode",
  "input": "https://videxo.io/samples/talk.mp4",
  "preset": "web-720p"
}'

Response

200 JSON
{
  "spec": {
    "inputs": {
      "source": {
        "url": "https://videxo.io/samples/talk.mp4"
      }
    },
    "outputs": [
      {
        "name": "video",
        "type": "video",
        "preset": "web-720p",
        "input": "source",
        "filename": "video.mp4",
        "format": "mp4",
        "resize": {
          "width": 1280,
          "height": 720,
          "fit": "contain",
          "enlarge": false
        },
        "video": {
          "codec": "h264",
          "crf": 23,
          "encoder_preset": "veryfast",
          "pixel_format": "yuv420p",
          "faststart": true
        },
        "audio": {
          "codec": "aac",
          "bitrate": "128k"
        }
      }
    ]
  },
  "command": "-i {{in_source}} -map 0:v:0 -vf \"scale='min(iw,1280)':'min(ih,720)':force_original_aspect_ratio=decrease:force_divisible_by=2\" -c:v libx264 -preset veryfast -crf 23 -pix_fmt yuv420p -map 0:a:0? -c:a aac -b:a 128k -movflags +faststart {{out_video}}",
  "input_files": {
    "in_source": "https://videxo.io/samples/talk.mp4"
  },
  "output_files": {
    "out_video": "video.mp4"
  },
  "ffmpeg_command": "ffmpeg -i https://videxo.io/samples/talk.mp4 -map 0:v:0 -vf 'scale='\\''min(iw,1280)'\\'':'\\''min(ih,720)'\\'':force_original_aspect_ratio=decrease:force_divisible_by=2' -c:v libx264 -preset veryfast -crf 23 -pix_fmt yuv420p -map '0:a:0?' -c:a aac -b:a 128k -movflags +faststart video.mp4",
  "steps": [
    {
      "tool": "ffmpeg",
      "inputs": [
        "source"
      ],
      "outputs": [
        "video"
      ],
      "command": "ffmpeg -i https://videxo.io/samples/talk.mp4 -map 0:v:0 -vf 'scale='\\''min(iw,1280)'\\'':'\\''min(ih,720)'\\'':force_original_aspect_ratio=decrease:force_divisible_by=2' -c:v libx264 -preset veryfast -crf 23 -pix_fmt yuv420p -map '0:a:0?' -c:a aac -b:a 128k -movflags +faststart video.mp4"
    }
  ]
}

Responses

Responses
StatusBodyWhen
200CompileResultWhat the job would run.
400Probleminvalid_request (with errors)
401Problemauthentication_failed (missing_api_key, invalid_api_key, api_key_revoked, api_key_expired)
403Problempermission_denied (token_scope): a client token cannot call this route
413Problemlimit_exceeded (request_body_size): the body is larger than 512 KB
415Probleminvalid_request (not_json): the body is not sent as application/json
429Problemrate_limited, with Retry-After in seconds
500Probleminternal_error