Skip to main content
POST
/
compile
Compile media content
curl --request POST \
  --url https://api.videodb.io/compile/ \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "inputs": [
    {
      "media_id": "m-12345",
      "start_time": 10,
      "end_time": 30
    }
  ],
  "output_format": "mp4",
  "callback_url": "https://webhook.example.com/callback"
}
'
{
  "success": true,
  "status": "processing",
  "data": {
    "id": "job-123",
    "output_url": "https://api.videodb.io/async-response/job-123"
  }
}
Compile search results or a list of videos/scenes into a single playable stream. Useful for creating compilations from search queries or combining specific video segments.
import videodb

conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()

# Search for videos
search_results = coll.search(query="action scenes")

# Compile search results into a stream
stream_url = search_results.compile()

print(f"Compiled stream: {stream_url}")
  • Compile is useful for creating highlight reels or compilations from search results
  • Each timeline entry needs video ID and time range (start, end in seconds)
  • Returns a playable stream URL
  • Compile automatically stitches segments together in order

Authorizations

x-access-token
string
header
required

API key for authentication (sk-xxx format)

Body

application/json
inputs
object[]
required
output_format
enum<string>
Available options:
mp4,
webm,
hls
Example:

"mp4"

callback_url
string
Example:

"https://webhook.example.com/callback"

Response

200 - application/json

Compilation started

success
boolean
Example:

true

status
enum<string>
Available options:
processing,
done,
failed
Example:

"processing"

data
object