start_encode2_raw
Submit a job with the raw query JSON.
The `query` dict can be either the wrapped form `{"query": {...inner...}}`
or the inner object directly — the underlying client auto-wraps if needed.
The inner query MUST have shape:
{
"source": "<url>",
"encoder_version": 2,
"format": [ # ARRAY of output specs
{
"output": "mp4", # STRING type field. NOT "format".
... # encoding params per the recipe
}
]
}
Common composition mistakes this tool catches up front:
- `"format": "mp4"` inside an entry instead of `"output": "mp4"`.
- Missing `output` field.
- Unknown `output` value.
- `format` as a string at the top level (must be an array).
- `advanced_hls` / `advanced_dash` / `webm_dash` / `hls_audio` without a
non-empty `stream[]` array (not a drop-in `output` swap on the MP4
shape — see `qencode://recipe/hls_abr`).
- `vmaf` without `distorted` (`source` = reference, `distorted` = encoded).
- `video_intelligence` without `mode` (use `mode: "description"`, not
`features`). Source must be https://; `description` modes need ≥10s
clip, `search` ≥4s — check duration before submit (metadata job).
- `destination.url` as `s3://<bucket>/…` (no regional `*.s3*.qencode.com` host).
The API treats that as generic S3 and demands `key`/`secret`. Copy
`{destination_prefix}/{new filename or folder}`. Do not copy a listed
object's `destination_url` as dest. `stitch[].url`, `distorted`, subtitle
files, and `logo.source` follow the same public/`cdn_url` vs
private/`destination_url` rule as `source`. Video Intelligence needs
`cdn_url` (https only).
Example vmaf query (encoder v1 — set explicitly here):
{
"source": "https://example.com/original.mp4",
"encoder_version": 1,
"format": [{
"output": "vmaf",
"distorted": "https://example.com/encoded.mp4",
"destination": {"url": "<destination_prefix>/vmaf.json"}
}]
}
Example video_intelligence query (encoder v2):
{
"source": "https://example.com/input.mp4",
"encoder_version": 2,
"format": [{
"output": "video_intelligence",
"mode": "description",
"destination": {"url": "<destination_prefix>/vi"}
}]
}
Unlike `transcode_video`, this tool does **not** auto-inject
`encoder_version`. Set `"encoder_version": 2` at the top of the inner
query for all v2 outputs (`smart_thumbnail`, `ai_detection`,
`video_intelligence`, `m4a`, stitch jobs, …). Use `1` only for VMAF per
`qencode://recipe/vmaf_quality`.
Stitching: a stitch job uses a top-level `stitch` array *instead of*
`source` — the two are mutually exclusive, so do NOT also set `source`
(setting both makes the API reject the job). Each `stitch[]` entry is a
URL string or a `{"url": ..., "start_time": ..., "duration": ...}`
object. Media Storage clips: `cdn_url` if public, `destination_url` if
private — same rule as `source`. Example:
{
"encoder_version": 2,
"stitch": [
{"url": "https://example.com/in.mp4", "start_time": 0, "duration": 5},
{"url": "https://example.com/in.mp4", "start_time": 148, "duration": 5}
],
"format": [{
"output": "mp4", "video_codec": "libx264",
"audio_codec": "libfdk_aac", "bitrate": 2800,
"framerate": "30", "keyframe": "60", "audio_bitrate": 128
}]
}
For complex queries — ABR ladders, DRM, stitching, callbacks — call
`search_qencode_docs(...)` then `fetch_qencode_doc(...)` to read the
matching recipe before composing.
After this returns a `task_token`, in the SAME reply call `list_jobs`
with that token. If the job is already Done with a playable video URL,
also `open_player`. If the deliverable is a json/txt/srt/vtt file, call
`fetch_job_result` and give the user both the URL and the extracted
content.
`payload` is an optional opaque callback tag echoed by Qencode, not the
job body (`query` is). It must be a string or omitted. If a JSON object
is passed, this tool returns `{"error": "..."}` asking you to retry
with a string — it does not stringify the object and does not submit.
Do not put `source` / `format` in `payload`.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| payload | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||