Skip to main content
POST
/
video
/
{video_id}
/
stream
Create video stream
curl --request POST \
  --url https://api.videodb.io/video/{video_id}/stream/ \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "format": "mp4",
  "quality": "high"
}
'
{
  "success": true,
  "data": {
    "stream_url": "https://stream.videodb.io/v/12345"
  }
}
Generate a streamable URL for the entire video or create a custom stream from specific timeline segments.
import videodb

conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]

# Get full stream URL (returns existing if available)
stream_url = video.generate_stream()

# Create stream from custom timeline (in seconds)
# Format: [(start, end), (start, end), ...]
timeline = [(0, 30), (60, 90)]
custom_stream_url = video.generate_stream(timeline=timeline)

print(f"Stream URL: {stream_url}")
print(f"Custom stream: {custom_stream_url}")
  • Returns a pre-existing stream URL if available (no re-processing needed)
  • Timeline allows creating videos with multiple segments automatically stitched
  • Timeline format: list of (start_time, end_time) tuples in seconds
  • Stream URLs are HLS format and work with most video players
  • Stream URLs remain valid as long as the video is stored

Authorizations

x-access-token
string
header
required

API key for authentication (sk-xxx format)

Path Parameters

video_id
string
required
Example:

"m-12345"

Body

application/json
format
enum<string>
Available options:
mp4,
webm,
hls
Example:

"mp4"

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

"high"

Response

200 - application/json

Stream created

success
boolean
Example:

true

data
object