| from __future__ import annotations |
|
|
| from copy import deepcopy |
| from typing import Any |
|
|
|
|
| TIMELINE_TRACK_TYPES = [ |
| "video", |
| "audio", |
| "text", |
| "overlay", |
| "sticker", |
| "subtitle", |
| ] |
|
|
| TIMELINE_OPERATIONS = [ |
| "drag", |
| "split", |
| "trim", |
| "ripple_delete", |
| "insert", |
| "replace", |
| "group", |
| "lock", |
| "hide", |
| "duplicate", |
| ] |
|
|
| VIDEO_EDITING_OPERATIONS = [ |
| "cut", |
| "split", |
| "trim", |
| "merge", |
| "concat", |
| "reverse", |
| "freeze_frame", |
| "speed", |
| "speed_ramp", |
| "time_remap", |
| "slow_motion", |
| "fast_motion", |
| "reverse_playback", |
| "crop", |
| "rotate", |
| "flip", |
| "resize", |
| "scale", |
| "zoom", |
| "pan", |
| "motion_blur", |
| "stabilization", |
| "lens_correction", |
| "compress", |
| "normalize", |
| "loop", |
| "gif", |
| "frames", |
| "watermark", |
| "overlay_text", |
| "burn_subtitles", |
| "convert", |
| ] |
|
|
| AI_EDITING_FEATURES = [ |
| "auto_edit", |
| "auto_highlight_detection", |
| "auto_scene_detection", |
| "auto_reframe", |
| "auto_crop", |
| "auto_remove_silence", |
| "auto_beat_sync", |
| "auto_color_match", |
| "auto_motion_tracking", |
| "auto_subtitle_generation", |
| "auto_hook_detection", |
| "auto_thumbnail_selection", |
| "auto_music_selection", |
| "auto_b_roll_placement", |
| "auto_caption_animation", |
| "auto_viral_score", |
| "auto_platform_optimization", |
| ] |
|
|
| KEYFRAME_PROPERTIES = [ |
| "position", |
| "scale", |
| "rotation", |
| "opacity", |
| "blur", |
| "brightness", |
| "contrast", |
| "saturation", |
| "hue", |
| "volume", |
| "playback_speed", |
| "mask", |
| "shadow", |
| "glow", |
| "text_animation", |
| ] |
|
|
| TRANSITION_FAMILIES = [ |
| "basic", |
| "fade", |
| "dissolve", |
| "slide", |
| "push", |
| "zoom", |
| "spin", |
| "blur", |
| "whip", |
| "flash", |
| "glitch", |
| "light_leak", |
| "film_burn", |
| "camera_shake", |
| "3d_flip", |
| "cube", |
| "ripple", |
| "ink", |
| "morph", |
| "stretch", |
| "liquid", |
| "elastic", |
| "motion_blur", |
| ] |
|
|
| VIDEO_EFFECTS = [ |
| "glitch", |
| "rgb_split", |
| "shake", |
| "crt", |
| "vhs", |
| "noise", |
| "film_grain", |
| "bloom", |
| "glow", |
| "chromatic_aberration", |
| "lens_flare", |
| "dream", |
| "neon", |
| "cyberpunk", |
| "rain", |
| "snow", |
| "fog", |
| "lightning", |
| "fire", |
| "smoke", |
| "particle_system", |
| "spark", |
| "magic", |
| "comic", |
| "cartoon", |
| "anime", |
| "sketch", |
| "oil_painting", |
| "pixel_art", |
| "sharp_pop", |
| "clean_beauty", |
| "warm_glow", |
| "cinematic", |
| "dreamy", |
| "flash_pop", |
| "motion_blur", |
| "noir", |
| ] |
|
|
| FILTER_FORMATS = [".cube", ".3dl", ".csp"] |
|
|
| FILTER_PRESETS = [ |
| "cinema", |
| "vintage", |
| "warm", |
| "cold", |
| "black_and_white", |
| "hdr", |
| "instagram", |
| "tiktok", |
| "moody", |
| "travel", |
| "nature", |
| "food", |
| "portrait", |
| "luxury", |
| "night", |
| ] |
|
|
| TEXT_FEATURES = [ |
| "rich_text", |
| "curved_text", |
| "vertical_text", |
| "gradient_text", |
| "outline", |
| "shadow", |
| "glow", |
| "stroke", |
| "letter_spacing", |
| "word_spacing", |
| "animation_presets", |
| "typing_animation", |
| "bounce", |
| "wave", |
| "zoom", |
| "pop", |
| "fade", |
| "roll", |
| "tracking", |
| ] |
|
|
| CAPTION_FEATURES = [ |
| "whisper_transcription", |
| "word_timestamps", |
| "sentence_timestamps", |
| "emoji_insertion", |
| "speaker_detection", |
| "karaoke_captions", |
| "tiktok_captions", |
| "capcut_captions", |
| "animated_captions", |
| "subtitle_templates", |
| ] |
|
|
| STICKER_PACKS = [ |
| "png", |
| "svg", |
| "gif", |
| "animated_stickers", |
| "emoji_packs", |
| "reaction_packs", |
| "social_media_packs", |
| "call_to_action_packs", |
| ] |
|
|
| SHAPES = [ |
| "rectangle", |
| "circle", |
| "triangle", |
| "arrow", |
| "line", |
| "polygon", |
| "speech_bubble", |
| "custom_svg", |
| ] |
|
|
| MASK_TYPES = [ |
| "rectangle", |
| "circle", |
| "linear", |
| "radial", |
| "freehand", |
| "bezier", |
| "ai_subject_mask", |
| "ai_sky_mask", |
| "ai_person_mask", |
| ] |
|
|
| CHROMA_KEY_FEATURES = [ |
| "green_screen", |
| "blue_screen", |
| "ai_background_removal", |
| "edge_feathering", |
| "spill_suppression", |
| "shadow_preservation", |
| ] |
|
|
| AUDIO_TOOLS = [ |
| "music", |
| "voiceover", |
| "noise_reduction", |
| "equalizer", |
| "compressor", |
| "limiter", |
| "pitch_shift", |
| "voice_changer", |
| "fade", |
| "ducking", |
| "normalization", |
| "ai_enhancement", |
| "beat_detection", |
| "beat_markers", |
| ] |
|
|
| MUSIC_PROVIDERS = ["musicgen", "suno_api", "stable_audio"] |
| MUSIC_STYLES = ["background_music", "lo_fi", "cinematic", "nasheed", "hip_hop", "corporate", "podcast", "meditation"] |
|
|
| VOICE_PROVIDERS = ["kokoro", "xtts", "piper", "openvoice"] |
| VOICE_FEATURES = ["voice_cloning", "multi_speaker", "emotion", "speed", "pitch", "style_transfer"] |
|
|
| IMAGE_GENERATION_PROVIDERS = ["flux", "sdxl", "controlnet"] |
| IMAGE_GENERATION_FEATURES = ["image_editing", "background_replacement", "object_removal", "upscaling"] |
|
|
| VIDEO_GENERATION_PROVIDERS = ["wan", "ltx_video", "hunyuan_video", "veo_api"] |
| VIDEO_GENERATION_FEATURES = ["animate_images", "image_to_video", "text_to_video"] |
|
|
| AI_ASSISTANTS = [ |
| "script_writer", |
| "hook_generator", |
| "title_generator", |
| "description_generator", |
| "hashtag_generator", |
| "seo_optimizer", |
| "thumbnail_prompt_generator", |
| "b_roll_planner", |
| "storyboard_generator", |
| ] |
|
|
| TEMPLATE_CATEGORIES = [ |
| "youtube_shorts", |
| "tiktok", |
| "instagram_reels", |
| "facebook_reels", |
| "motivational", |
| "podcasts", |
| "gaming", |
| "news", |
| "luxury", |
| "business", |
| "education", |
| "finance", |
| "relationship", |
| "wedding", |
| "birthday", |
| "travel", |
| "cooking", |
| "fitness", |
| "anime", |
| "sports", |
| "product_ads", |
| "real_estate", |
| "e_commerce", |
| "faceless_channels", |
| "quote_videos", |
| "audiograms", |
| "story_videos", |
| "before_and_after", |
| "reaction_videos", |
| "countdown_videos", |
| ] |
|
|
| EXPORT_FORMATS = ["mp4", "mov", "avi", "mkv", "gif", "webm", "png_sequence", "jpeg_sequence", "audio_only"] |
|
|
| EXPORT_PRESETS = [ |
| "1080p", |
| "2k", |
| "4k", |
| "8k", |
| "tiktok", |
| "youtube", |
| "instagram", |
| "facebook", |
| "twitter", |
| "linkedin", |
| ] |
|
|
| API_ENDPOINTS = { |
| "upload": "POST /upload", |
| "project_create": "POST /project/create", |
| "project_save": "POST /project/save", |
| "timeline_add": "POST /timeline/add", |
| "timeline_operation": "POST /timeline/operation", |
| "effect_apply": "POST /effect/apply", |
| "filter_apply": "POST /filter/apply", |
| "transition_add": "POST /transition/add", |
| "caption_generate": "POST /caption/generate", |
| "music_generate": "POST /music/generate", |
| "voice_generate": "POST /voice/generate", |
| "image_generate": "POST /image/generate", |
| "video_generate": "POST /video/generate", |
| "thumbnail_create": "POST /thumbnail/create", |
| "render": "POST /render", |
| "status": "GET /status/{job_id}", |
| "download": "GET /download/{job_id}", |
| "publish": "POST /publish", |
| } |
|
|
|
|
| def capability_catalog() -> dict[str, Any]: |
| return deepcopy( |
| { |
| "product": "Ava2lon Studio AI", |
| "principles": { |
| "cpu_first": True, |
| "optional_gpu": True, |
| "api_parity": True, |
| "async_long_running_tasks": True, |
| "status_polling": True, |
| "webhooks": True, |
| "plugin_support": True, |
| "template_driven": True, |
| "non_destructive_projects": True, |
| "multi_platform_export": True, |
| }, |
| "timeline": { |
| "track_types": TIMELINE_TRACK_TYPES, |
| "operations": TIMELINE_OPERATIONS, |
| "unlimited_tracks": True, |
| }, |
| "editing": VIDEO_EDITING_OPERATIONS, |
| "ai_editing": AI_EDITING_FEATURES, |
| "keyframes": KEYFRAME_PROPERTIES, |
| "transitions": TRANSITION_FAMILIES, |
| "effects": VIDEO_EFFECTS, |
| "filters": {"formats": FILTER_FORMATS, "presets": FILTER_PRESETS}, |
| "text": TEXT_FEATURES, |
| "captions": CAPTION_FEATURES, |
| "stickers": STICKER_PACKS, |
| "shapes": SHAPES, |
| "masks": MASK_TYPES, |
| "chroma_key": CHROMA_KEY_FEATURES, |
| "audio": AUDIO_TOOLS, |
| "music_generator": {"providers": MUSIC_PROVIDERS, "styles": MUSIC_STYLES}, |
| "voice_generator": {"providers": VOICE_PROVIDERS, "features": VOICE_FEATURES}, |
| "image_generation": {"providers": IMAGE_GENERATION_PROVIDERS, "features": IMAGE_GENERATION_FEATURES}, |
| "video_generation": {"providers": VIDEO_GENERATION_PROVIDERS, "features": VIDEO_GENERATION_FEATURES}, |
| "assistants": AI_ASSISTANTS, |
| "templates": TEMPLATE_CATEGORIES, |
| "exports": {"formats": EXPORT_FORMATS, "presets": EXPORT_PRESETS}, |
| "api_endpoints": API_ENDPOINTS, |
| } |
| ) |
|
|
|
|
| def is_timeline_operation(operation: str) -> bool: |
| return operation in TIMELINE_OPERATIONS |
|
|
|
|
| def is_track_type(track_type: str) -> bool: |
| return track_type in TIMELINE_TRACK_TYPES |
|
|