Skip to main content
POST
/
timeline_v2
Compile timeline (v2)
curl --request POST \
  --url https://api.videodb.io/timeline_v2 \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "request_type": "compile",
  "timeline": [
    {
      "video_id": "m-12345",
      "clips": [
        {
          "start": 0,
          "end": 30,
          "volume": 1
        }
      ]
    }
  ],
  "output_format": "mp4",
  "quality": "high"
}
'
{
  "success": true,
  "data": {
    "stream_url": "https://stream.videodb.io/compiled/12345",
    "duration": 120.5,
    "format": "mp4"
  }
}
Create advanced video compositions with multiple tracks, clips, transitions, and effects. Timeline v2 provides granular control over video editing including cropping, filters, and positioning.
import videodb
from videodb.editor import Timeline, Track, Clip, VideoAsset

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

# Create timeline with custom resolution and background
timeline = Timeline(conn)
timeline.resolution = "1920x1080"
timeline.background = "#000000"

# Create a track and add video clips
track = Track()
video_asset = VideoAsset(id="m-abc123def", start=0)
clip = Clip(asset=video_asset, duration=10)
track.add_clip(0, clip)

# Add another clip at 10 seconds
video_asset2 = VideoAsset(id="m-xyz789", start=0)
clip2 = Clip(asset=video_asset2, duration=8)
track.add_clip(10, clip2)

timeline.add_track(track)

# Generate the stream
stream_url = timeline.generate_stream()
print(f"Stream: {stream_url}")
  • Timeline v2 supports multiple tracks for layering videos, audio, images, and text
  • Clips define what asset plays and for how long (duration)
  • Default resolution is 1280x720, default background is black
  • Supports transitions, filters, cropping, and positioning on clips
  • Download the generated timeline with the Download endpoint

Authorizations

x-access-token
string
header
required

API key for authentication (sk-xxx format)

Body

application/json
request_type
enum<string>
required
Available options:
compile
Example:

"compile"

timeline
object[]
required
output_format
enum<string>
Available options:
mp4,
webm,
hls
Example:

"mp4"

quality
enum<string>
Available options:
low,
medium,
high
Example:

"high"

Response

200 - application/json

Timeline compilation result

success
boolean
Example:

true

data
object