Guide

Get video metadata with an API

How do I read a video's duration, resolution and codecs over an API?

Use /api/ffprobe/job/ instead of the ffmpeg endpoint. It inspects the file and returns ffprobe's JSON without writing an output, and it usually answers 200 on the spot rather than queueing a job.

The ffmpeg command

What you would run locally, for reference.

ffprobe -v error -select_streams v:0 \
  -show_entries stream=width,height,r_frame_rate \
  -of json input.mp4

The API request

The same flags, sent as JSON. Authenticate with Authorization: Token <your-api-token>.

POST /api/ffprobe/job/
{
  "input_source": "https://example.com/input.mp4",
  "options": [
    "-select_streams",
    "v:0",
    "-show_entries",
    "stream=width,height,r_frame_rate"
  ]
}

Worth knowing

  • This endpoint answers two ways and a client has to handle both: 200 with the metadata in the body, or 202 with a job_id to poll when the probe has real work to do (a slow external URL, or -count_frames).
  • Send no -show_* flag and you get everything ffprobe knows (-show_format -show_streams). Ask for specific entries and the sections you didn't ask for come back empty.
  • -of/-print_format and -v/-loglevel are rejected with a 400 — the server controls them to keep the output parseable.

What it costs

Jobs bill in processing seconds — the CPU time this one actually uses — with a floor of 25 seconds per GB pulled out of storage to run it, so a stream-copy still counts. Uploading the output and downloading it afterwards are free. See the plans.

Related guides

Start free API reference

Ask me for anything

QuickFFmpeg is early and plenty is still missing. Tell me what you need and it goes straight to the top of my list.

This arrives anonymously. Log in first if you'd like an answer.