cerevox
Version:
TypeScript SDK for browser automation and secure command execution in highly available and scalable micro computer environments
624 lines • 21.8 kB
JSON
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "VideoProject Schema",
"description": "JSON Schema for VideoProject data structure used in videokit-ts library for AI-driven video assembly",
"type": "object",
"properties": {
"version": {
"type": "string",
"description": "Project version, typically '1.0'",
"example": "1.0"
},
"project": {
"type": "object",
"description": "Project metadata",
"properties": {
"name": {
"type": "string",
"description": "Project name"
},
"id": {
"type": "string",
"description": "Unique project identifier"
}
},
"required": ["name", "id"]
},
"settings": {
"type": "object",
"description": "Video project settings",
"properties": {
"fps": {
"type": "number",
"minimum": 0,
"exclusiveMinimum": true,
"description": "Frames per second",
"example": 30
},
"resolution": {
"type": "object",
"description": "Video resolution",
"properties": {
"width": {
"type": "integer",
"minimum": 16,
"description": "Video width in pixels"
},
"height": {
"type": "integer",
"minimum": 16,
"description": "Video height in pixels"
}
},
"required": ["width", "height"]
},
"pixelFormat": {
"type": "string",
"description": "Pixel format (e.g., 'yuv420p')",
"example": "yuv420p"
},
"sampleRate": {
"type": "integer",
"minimum": 1,
"description": "Audio sample rate (e.g., 48000)",
"example": 48000
},
"channels": {
"type": "integer",
"minimum": 1,
"description": "Audio channels (1 or 2)",
"example": 2
},
"timebase": {
"type": "string",
"description": "Time base (e.g., '1/1000' for milliseconds)",
"example": "1/1000"
}
},
"required": ["fps", "resolution", "pixelFormat", "sampleRate", "channels", "timebase"]
},
"assets": {
"type": "array",
"description": "Media assets used in the project",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique asset identifier"
},
"type": {
"type": "string",
"enum": ["video", "audio", "image"],
"description": "Asset type"
},
"uri": {
"type": "string",
"description": "Asset file path (absolute or relative)"
},
"durationMs": {
"type": "integer",
"description": "Asset duration in milliseconds (optional)"
},
"fps": {
"type": "number",
"description": "Asset frame rate (optional, for video assets)"
}
},
"required": ["id", "type", "uri"]
}
},
"timeline": {
"type": "object",
"description": "Timeline containing tracks and mix settings",
"properties": {
"tracks": {
"type": "array",
"description": "Timeline tracks",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique track identifier"
},
"type": {
"type": "string",
"enum": ["video", "audio", "subtitle"],
"description": "Track type"
},
"muted": {
"type": "boolean",
"description": "Whether track is muted (optional)"
},
"opacity": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Track opacity for video tracks (optional)"
},
"clips": {
"type": "array",
"description": "Clips in this track",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique clip identifier"
},
"assetId": {
"type": "string",
"description": "Reference to asset ID"
},
"startMs": {
"type": "integer",
"minimum": 0,
"description": "Start time on timeline in milliseconds"
},
"inMs": {
"type": "integer",
"minimum": 0,
"description": "Start time in asset in milliseconds"
},
"durationMs": {
"type": "integer",
"minimum": 1,
"description": "Clip duration in milliseconds"
},
"transform": {
"type": "object",
"description": "Visual transformation settings (optional)",
"properties": {
"scale": {
"type": "number",
"description": "Scale factor"
},
"rotate": {
"type": "number",
"description": "Rotation in degrees"
},
"anchor": {
"type": "string",
"enum": ["center", "topleft", "topright", "bottomleft", "bottomright"],
"description": "Anchor point for transformations"
},
"position": {
"type": "object",
"description": "Position (normalized 0..1)",
"properties": {
"x": { "type": "number" },
"y": { "type": "number" }
},
"required": ["x", "y"]
},
"fit": {
"type": "string",
"enum": ["contain", "cover", "stretch"],
"description": "How to fit content"
}
}
},
"speed": {
"type": "number",
"minimum": 0,
"exclusiveMinimum": true,
"description": "Playback speed multiplier (optional)"
},
"effects": {
"type": "array",
"description": "Applied effects (optional)",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Effect name (fadeIn, fadeOut, gain, blur, color, speed, or custom)"
},
"params": {
"type": "object",
"description": "Effect parameters (optional)",
"additionalProperties": true
}
},
"required": ["name"]
}
},
"transitionIn": {
"type": "object",
"description": "Transition in effect (optional)",
"properties": {
"name": {
"type": "string",
"enum": [
"xfade",
"fade",
"wipeleft",
"wiperight",
"wipeup",
"wipedown",
"slideleft",
"slideright",
"slideup",
"slidedown",
"circlecrop",
"rectcrop",
"distance",
"fadeblack",
"fadewhite",
"radial",
"smoothleft",
"smoothright",
"smoothup",
"smoothdown",
"circleopen",
"circleclose",
"vertopen",
"vertclose",
"horzopen",
"horzclose",
"dissolve",
"pixelize",
"diagtl",
"diagtr",
"diagbl",
"diagbr"
],
"description": "Transition name - supports various xfade transition types"
},
"durationMs": {
"type": "integer",
"minimum": 1,
"description": "Transition duration in milliseconds"
},
"params": {
"type": "object",
"description": "Optional transition parameters",
"additionalProperties": true
}
},
"required": ["name", "durationMs"]
},
"transitionOut": {
"type": "object",
"description": "Transition out effect (optional)",
"properties": {
"name": {
"type": "string",
"enum": [
"xfade",
"fade",
"wipeleft",
"wiperight",
"wipeup",
"wipedown",
"slideleft",
"slideright",
"slideup",
"slidedown",
"circlecrop",
"rectcrop",
"distance",
"fadeblack",
"fadewhite",
"radial",
"smoothleft",
"smoothright",
"smoothup",
"smoothdown",
"circleopen",
"circleclose",
"vertopen",
"vertclose",
"horzopen",
"horzclose",
"dissolve",
"pixelize",
"diagtl",
"diagtr",
"diagbl",
"diagbr"
],
"description": "Transition name - supports various xfade transition types"
},
"durationMs": {
"type": "integer",
"minimum": 1,
"description": "Transition duration in milliseconds"
},
"params": {
"type": "object",
"description": "Optional transition parameters",
"additionalProperties": true
}
},
"required": ["name", "durationMs"]
},
"filters": {
"type": "array",
"description": "Applied filters (optional)",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Filter name (e.g., blur, brightness, contrast, saturation, hue, etc.)"
},
"params": {
"type": "object",
"description": "Filter parameters (optional)",
"additionalProperties": true
}
},
"required": ["name"]
}
}
},
"required": ["id", "assetId", "startMs", "inMs", "durationMs"]
}
}
},
"required": ["id", "type", "clips"]
}
},
"mix": {
"type": "object",
"description": "Audio mixing settings (optional)",
"properties": {
"ducking": {
"type": "array",
"description": "Audio ducking rules (optional)",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Ducking rule identifier"
},
"musicTrackId": {
"type": "string",
"description": "Music track ID to be ducked"
},
"dialogTrackId": {
"type": "string",
"description": "Dialog track ID that triggers ducking"
},
"params": {
"type": "object",
"description": "Ducking parameters (optional)",
"properties": {
"threshold": {
"type": "number",
"description": "Threshold level (0..1, ~-dBFS)"
},
"ratio": {
"type": "number",
"description": "Compression ratio (6..12 typical)"
},
"attackMs": {
"type": "number",
"description": "Attack time in milliseconds (0..100)"
},
"releaseMs": {
"type": "number",
"description": "Release time in milliseconds (100..800)"
},
"musicPreGain": {
"type": "number",
"description": "Music pre-gain in dB (e.g., -12)"
}
}
}
},
"required": ["id", "musicTrackId", "dialogTrackId"]
}
}
}
}
},
"required": ["tracks"]
},
"subtitles": {
"type": "array",
"description": "Subtitle items (optional)",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique subtitle identifier"
},
"text": {
"type": "string",
"description": "Subtitle text content"
},
"startMs": {
"type": "integer",
"minimum": 0,
"description": "Start time in milliseconds"
},
"endMs": {
"type": "integer",
"minimum": 1,
"description": "End time in milliseconds"
},
"audio": {
"type": "string",
"description": "Optional reference to asset ID for dialog audio"
},
"syncStrategy": {
"type": "string",
"enum": ["与storyboard的script完全一致", "用户修改", "其他文件一致性"],
"default": "与storyboard的script完全一致",
"description": "字幕同步策略:'与storyboard的script完全一致' 表示字幕与故事板脚本完全同步,'用户修改' 表示用户手动添加或修改的字幕,'其他文件一致性' 表示字幕与其他文件(如视频、音频)的一致性"
},
"style": {
"type": "object",
"description": "Subtitle styling (optional)",
"properties": {
"fontFamily": {
"type": "string",
"description": "Font family name"
},
"fontSize": {
"type": "number",
"description": "Font size in pixels"
},
"bold": {
"type": "boolean",
"description": "Whether text is bold"
},
"color": {
"type": "string",
"pattern": "^#[0-9a-fA-F]{6}$",
"description": "Text color in #RRGGBB format"
},
"outlineColor": {
"type": "string",
"pattern": "^#[0-9a-fA-F]{6}$",
"description": "Outline color in #RRGGBB format"
},
"outlineWidth": {
"type": "number",
"description": "Outline width in pixels"
},
"align": {
"type": "string",
"enum": ["left", "center", "right"],
"description": "Text alignment"
},
"verticalAlign": {
"type": "string",
"enum": ["top", "middle", "bottom"],
"description": "Vertical alignment (default: bottom)"
},
"position": {
"type": "object",
"description": "Position (normalized 0..1)",
"properties": {
"x": { "type": "number" },
"y": { "type": "number" }
},
"required": ["x", "y"]
}
}
}
},
"required": ["id", "text", "startMs", "endMs", "syncStrategy"]
}
},
"export": {
"type": "object",
"description": "Export configuration",
"properties": {
"container": {
"type": "string",
"description": "Output container format (mp4, mov, mkv)",
"example": "mp4"
},
"videoCodec": {
"type": "string",
"description": "Video codec (libx264, libx265)",
"example": "libx264"
},
"crf": {
"type": "integer",
"description": "Constant Rate Factor for video quality (optional)"
},
"preset": {
"type": "string",
"description": "Encoding preset (ultrafast..veryslow) (optional)"
},
"audioCodec": {
"type": "string",
"description": "Audio codec (aac, libopus)",
"example": "aac"
},
"audioBitrate": {
"type": "string",
"description": "Audio bitrate (e.g., '192k') (optional)"
},
"outFile": {
"type": "string",
"description": "Output file path (optional, defaults to 'output.{container}')"
}
},
"required": ["container", "videoCodec", "audioCodec"]
}
},
"required": ["version", "project", "settings", "assets", "timeline", "export"],
"examples": [
{
"version": "1.0",
"project": {
"name": "Sample Video Project",
"id": "project-001"
},
"settings": {
"fps": 30,
"resolution": {
"width": 1920,
"height": 1080
},
"pixelFormat": "yuv420p",
"sampleRate": 48000,
"channels": 2,
"timebase": "1/1000"
},
"assets": [
{
"id": "video-001",
"type": "video",
"uri": "/path/to/video.mp4",
"durationMs": 10000,
"fps": 30
},
{
"id": "audio-001",
"type": "audio",
"uri": "/path/to/audio.mp3",
"durationMs": 15000
}
],
"timeline": {
"tracks": [
{
"id": "video-track-1",
"type": "video",
"clips": [
{
"id": "clip-001",
"assetId": "video-001",
"startMs": 0,
"inMs": 0,
"durationMs": 5000
}
]
},
{
"id": "audio-track-1",
"type": "audio",
"clips": [
{
"id": "clip-002",
"assetId": "audio-001",
"startMs": 0,
"inMs": 0,
"durationMs": 5000
}
]
}
]
},
"export": {
"container": "mp4",
"videoCodec": "libx264",
"audioCodec": "aac",
"crf": 23,
"preset": "medium"
}
}
]
}